How do you get selenium to recognize that a page loaded?

后端 未结 9 1613
误落风尘
误落风尘 2020-12-16 19:40

In certain unknown situations selenium does not detect that a page has loaded when using the open method. I am using the Java API. For example (This code will not produce th

9条回答
  •  长情又很酷
    2020-12-16 19:52

    If you page has no AJAX, try to seek footer of page (I also use Junit fail(""), you may use System.err.println() instead):

        element.click();
        int timeout =120; 
        // one loop = 0.5 sec, co it will be one minute 
        WebElement myFooter = null;
    
        for(int i=0; i

提交回复
热议问题