Exception (org.openqa.selenium.NoSuchWindowException): using Selenium WebDriver with Java in Internet Explorer -


while using ie automation using selenium webdriver, able open url finding element on page throwing following exception:

org.openqa.selenium.nosuchwindowexception: unable find element on closed window (warning: server did not provide stacktrace information)

i have tried driver.switchto.window() method it's not working. have searched hours , not getting anywhere.

here's code:

public static selenium selenium;  public static void main(string args[]) {      try {          system.setproperty(             "webdriver.ie.driver",             "d:\\driver\\iedriverserver_win32_2.32.3_latest\\iedriverserver.exe");          desiredcapabilities capab = desiredcapabilities.internetexplorer();         capab.setcapability(             internetexplorerdriver.introduce_flakiness_by_ignoring_security_domains,             true);          webdriver driver = new internetexplorerdriver(capab);         driver.get("http://www.google.com");         driver.findelement(by.xpath(".//*[@id='addlang']/a[1]")).click();      } catch (exception e) {         e.printstacktrace();     } } 

remove capability introduce_flakiness_by_ignoring_security_domains , manually set ie protected mode settings same zones.

source:

  1. http://jimevansmusic.blogspot.com/2012/08/youre-doing-it-wrong-protected-mode-and.html

  2. nosuchelementexception occurred during implementation of internetexplorerdriver in selenium webdriver


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

keyboard - C++ GetAsyncKeyState alternative -

android - java.net.UnknownHostException(Unable to resolve host “URL”: No address associated with hostname) -