79398837

Date: 2025-01-30 05:13:42
Score: 1.5
Natty:
Report link

What JeffC answered is correct. Either you check if a specific element on the page has loaded or you wait for the timeout(which you can set yourself to however long you want).

A page "not loading" will display the browser timeout window, which you can check for, but even if the timeout is reached, it doesn't mean the page wouldn't have loaded eventually so it's impossible to tell that it won't load, it all depends on how patient you want to be in waiting for it to do so.

Since you can only check and wait for one element at a time in selenium, what you want to do if you don't want to wait for the timeout of each sequentially is to manually do a loop(with a custom timeout checking the current time + however long you want) that constantly search for each element presence on the page and once one is found, you break the loop and you know which page loaded(what you want, the website error or the browser timeout or whatever else you want to check for).

Reasons:
  • Long answer (-0.5):
  • No code block (0.5):
  • Starts with a question (0.5): What
  • Low reputation (1):
Posted by: Sam Kook