Wait for page load in Selenium

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

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

30条回答
  •  一生所求
    2020-11-22 07:53

    Ruby implementation:

    wait = Selenium::WebDriver::Wait.new(:timeout => 10)
    wait.until {
        @driver.execute_script("return document.readyState;") == "complete" 
    }
    

提交回复
热议问题