1

I am aware of the Wait mechanisms in Selenium (e.g. Wait for page load in Selenium) but my problem is slightly different:

How to wait until Tomcat is up and running? A wait-for-page-load-mechanism won't help: the browser actually loads a page, but it's a "Problem loading page", "Unable to connect" etc. error page.

Which mechanism to use to wait for the actual page to load and to reload-and-wait again if necessary (i.e. an error page is loaded)? I mean: I can wait for a particular DOM element to load (an OK-ish solution but not that generic), but I still need to reload if the error page shows up.

Thanks!

Pawel Os.
  • 611
  • 8
  • 26
  • What did you try so far? – Selaron Dec 17 '18 at 09:58
  • Right now I am trying to put the wait-for-a-DOM-element in a loop and reload before every loop iteration. Guess that should work just fine. But in case someone has a cleaner, more generic way - I would appreciate sharing it ;) – Pawel Os. Dec 17 '18 at 10:08

1 Answers1

1

There is no built-in function in selenium to handle "Problem loading page" or "Unable to connect" you have to handle it yourself.

ewwink
  • 18,382
  • 2
  • 44
  • 54
  • I solved it manually: checking for a particular DOM element to show up in loop. Within each loop iteration the execution halts for a few seconds to wait until the page builds up & after each iteration the page is refreshed. – Pawel Os. Dec 17 '18 at 16:15