Pythion Selenium - Best way to wait for page load

I’m trying to write a test script for my website using Python and Selenium. I need to wait until a new page has loaded. For example, after I click the Login button on the login page of my site, it is supposed to load a page called Welcome. I want to check that the correct page loaded, and that all the elements on the page that should be there are actually there, and visible, and in the right place. After clicking the login button, what code should I write to wait until the page is loaded before I start checking elements? People often suggest waiting until a specific element ID is present, but this means that I have to know which element will load last? Can I add a specific (maybe invisible) element to the page that will always load last? I’d much rather have a generic way to wait until everything on the page is loaded. Some advice on this would help me a lot.
A slightly related question: how do I most easily write a selenium script that will check that all the elements on the page are present, and visible, and in the right place? There ought surely to be a way to learn all the necessary information (maybe write it into a file) and then use this file to check against when the test script is run?

Thank you - Rowan

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.