Wait for page load in Selenium

后端 未结 30 2473
攒了一身酷
攒了一身酷 2020-11-22 07:12

How do you make Selenium 2.0 wait for the page to load?

30条回答
  •  无人及你
    2020-11-22 08:00

    You can use the below existing method to set the time for pageeLoadTimeout in below example if the page is taking more than 20 seconds to load , then it will throw an exception of page reload

     WebDriver driver = new FirefoxDriver();
    driver.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS)
    

提交回复
热议问题