Search code examples
seleniumtomcatwait

Selenium: Wait for Tomcat to start


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!


Solution

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