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:
Comments
Post a Comment