当我试图在我的代码中多次调用back()方法时,脚本没有按预期运行。这是我的脚本 @Test
public void testfun() throws Exception{
WebDriver d= new FirefoxDriver();
d.get("http://selenium.googlecode.com/git/docs/api/java/index.html");
assertEquals("Overview",d.getTitle());
d.switchTo().frame(d.findElement(By.name("packageListFrame")));
d.findElement(By.cssSelector("a[href='com/thoughtworks/selenium/package-frame.html']")).click();
Thread.sleep(3000);
d.navigate().back();
d.switchTo().parentFrame();
d.switchTo().frame(d.findElement(By.name("packageFrame")));
d.findElement(By.cssSelector("a[href*='AddApplicationCache']"));
d.navigate().back();
d.switchTo().parentFrame();
d.switchTo().frame(d.findElement(By.name("classFrame"))).click();
d.findElement(By.cssSelector("a[href='org/openqa/selenium/firefox/package-summary.html']")).click();
}
任何一个有答案的人? 提前致谢