Not able to locate controls on IE using Selenium IE driver

Hi,

I am writing selenium script on VSTS IDE using C# to automate a workflow on IE. I am using below code but it fails to identify/locate control on IE browser.

——————-Code that iam using——————————-

InternetExplorerOptions opt = new InternetExplorerOptions();

opt.IntroduceInstabilityByIgnoringProtectedModeSettings = true;

opt.IgnoreZoomLevel = true;

IWebDriver driver = new InternetExplorerDriver(“C:\\Program Files (x86)”, opt);

driver.Navigate().GoToUrl(“http://www.bing.com/“);

 

//set current browser to Chrome

Thread.Sleep(4000);

//driver.Manage().Timeouts().ImplicitWait(10, TimeUnit.SECONDS);

driver.FindElement(By.Id(“scpl1”)).Click();

 

Error i see is as below-

An exception of type ‘OpenQA.Selenium.NoSuchWindowException’ occurred in WebDriver.dll but was not handled in user code

Additional information: Unable to find element on closed window

 

Could someone please help me here.

Default Asked on May 23, 2018 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.