我有一段代码,用于检查网页是否在1分钟内加载。我收到TimeoutException的Unreachable catch块。谁能告诉我为什么?感谢
公共类PageLoadedin1min {
public static void main(String[] args) {
WebDriver driver =new FirefoxDriver();
driver.manage().timeouts().pageLoadTimeout(1, TimeUnit.SECONDS) ;
try
{
driver.get("http://localhost/login.do");
System.out.println("Page Loaded in a min");
}
catch(TimeoutException e)
{
System.out.println("Page is not loaded in a min");
}
}
}