小编Sim*_*n N的帖子

使用Internet Explorer 11和Selenium(任何版本)和IEWebDriver(任何版本)都找不到任何元素

我已经搜遍了所有的答案,我找不到任何解决方案.我试图在IE11中运行我的Selenium测试.所有其他浏览器都可以正常工作(包括Edge).如下的简单测试将导致问题......

System.setProperty("webdriver.ie.driver.loglevel","TRACE");
System.setProperty("webdriver.ie.driver.logfile", "C:/Projects/logme.txt");
driver = new InternetExplorerDriver();
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
driver.manage().deleteAllCookies();
driver.manage().window().maximize();
driver.get("http:www.google.com");
driver.findElement(By.id("lst-ib")).click;
Run Code Online (Sandbox Code Playgroud)

IE11将启动并导航到URL,但它无法在任何页面上的任何位置找到任何元素.再一次,我知道人们有这个问题,但没有任何建议解决了我的问题.这是我每次都回来的错误:

org.openqa.selenium.NoSuchElementException: Unable to find element with id == lst-ib (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 3.23 seconds
For documentation on this error, please visit: http://seleniumhq.org/exceptions/no_such_element.html
Build info: version: '3.2.0', revision: '8c03df6b79', time: '2017-02-23 10:51:31 +0000'System info: host: 'DESKTOP-63BRP93', ip: '10.0.110.68', os.name: 'Windows 10', os.arch: 'x86', os.version: '10.0', java.version: '1.8.0_121'
Driver info: org.openqa.selenium.ie.InternetExplorerDriverCapabilities [{browserAttachTimeout=0, ie.enableFullPageScreenshot=true, enablePersistentHover=true, ie.forceCreateProcessApi=false, ie.forceShellWindowsApi=false, pageLoadStrategy=normal, …
Run Code Online (Sandbox Code Playgroud)

java selenium selenium-webdriver internet-explorer-11

13
推荐指数
1
解决办法
3026
查看次数