Stop browser load from selenium webdriver

后端 未结 3 1282
生来不讨喜
生来不讨喜 2020-12-28 22:09

My selenium webdriver goes to a page and waits for that page to finish loading. If 30 seconds pass it times-out and the script fails.

Is there anyway to have the

3条回答
  •  半阙折子戏
    2020-12-28 23:03

    You can stop page loading in Ruby using JavaScript function window.stop() and method Selenium::WebDriver::Driver#execute_script:

    driver.execute_script("window.stop()")
    

提交回复
热议问题