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

后端 未结 9 1610
误落风尘
误落风尘 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 20:04

    Using 'openAndWait' in place of 'open' will do the trick.

    From the website:

    Many Actions can be called with the "AndWait" suffix, e.g. "clickAndWait". This suffix tells Selenium that the action will cause the browser to make a call to the server, and that Selenium should wait for a new page to load.

提交回复
热议问题