Wait for page load in Selenium

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

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

30条回答
  •  南方客
    南方客 (楼主)
    2020-11-22 08:15

    If someone uses selenide:

    public static final Long SHORT_WAIT = 5000L; // 5 seconds
    $("some_css_selector").waitUntil(Condition.appear, SHORT_WAIT);
    

    More Conditions can be found here: http://selenide.org/javadoc/3.0/com/codeborne/selenide/Condition.html

提交回复
热议问题