Getting Selenium to pause for X seconds

后端 未结 6 2077
小蘑菇
小蘑菇 2020-12-06 16:24

What I am trying to accomplish is browsing to a page, waiting for something to load and then taking and saving a screenshot.

The code I already have is



        
6条回答
  •  一整个雨季
    2020-12-06 16:52

    That wouldnt really be a selenium specific thing. You just want java to sleep for a bit after loading the page but before taking the screenshot.

    Thread.sleep(4000);
    

    put that after your driver.get statement.

提交回复
热议问题