我在选择框架中的项目时遇到问题。我到达了某个点,然后它失败了。我尝试了很多选项,但无济于事,下面是代码。我进入第一帧,然后:
selenium.open("http://localhost/Clockwise/Main.htm");
// grabs back to driver
WebDriver driver = ((WebDriverBackedSelenium) selenium).getWrappedDriver();
driver.switchTo().frame("MainFrame");
//selenium.selectFrame("MainFrame");
driver.findElement(By.xpath("//li[contains(.,'Reports')]")).click();
//selenium.click("//li[contains(.,'Reports')]")
driver.findElement(By.xpath("//li[contains(.,'Reports')]")).click();
driver.findElement(By.xpath("//li[contains(.,'Reports')]"));
Thread.sleep(3000);
//FAILS HERE
driver.findElement(By.id("SELECTALL2")).click();