【发布时间】:2012-12-21 13:59:09
【问题描述】:
当调用driver.findElement(By.className("item")); 找不到元素时,selenium webDriver 什么也不做
驱动程序甚至不会抛出我有时期待的 ElementNotfoundException。它只是挂起。
这是一个例子:
ProfilesIni allProfiles = new ProfilesIni();
FirefoxProfile profile = allProfiles.getProfile("default");
driver = new FirefoxDriver(profile);
driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
driver.get(APP_ADDRESS);
WebElement sBoxPopup = driver.findElement(By
.className("item"));
...
驱动程序挂在 driver.findElement(...) 上。即使我删除了implicitlyWait,它也会挂起。 自 4 天以来,我一直在寻找错误。我希望有人能给点提示。 我正在使用 Firefox 17.0.1 和 selenium-java/-server 2.28。我还将 selenium 版本降级为 2.25,但没有任何反应。
【问题讨论】:
标签: java eclipse firefox selenium-webdriver