Are we nearly ready yet?
How do we know that the page we are interested in has loaded and is ready for us to start running our scripts against?
It sounds like a simple question; however, it is one of the things that always catches people out. If you are ever asked why a script doesn't work when the code seems sensible, your usual reply should probably be, It's a wait problem!
Wait problems are probably the most common error in Selenium scripts; shockingly, most of the time, people don't even know they have them. JavaScript-heavy sites are especially prone to wait problems, but you can run into them with sites that don't use much JavaScript as well.
Why are wait problems so prevalent? It's largely due to people not thinking about the consequences ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access