Wait for page load in Selenium

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

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

30条回答
  •  误落风尘
    2020-11-22 08:07

    If you set the implicit wait of the driver, then call the findElement method on an element you expect to be on the loaded page, the WebDriver will poll for that element until it finds the element or reaches the time out value.

    driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);
    

    source: implicit-waits

提交回复
热议问题