I have not come across an answer to answers whether it is possible to check at a specific moment in your Python script if the driver is busy loading or not. Something like:
print(driver == loading)
Is this even possible?
I have not come across an answer to answers whether it is possible to check at a specific moment in your Python script if the driver is busy loading or not. Something like:
print(driver == loading)
Is this even possible?
This question was asked a lot of times before.
Actually you are asking is it possible to validate the page loading was completed.
You can see here and on many similar questions here.
So, you can check page ready state. But it is not reliable enough.
def page_has_loaded(self):
self.log.info("Checking if {} page is loaded.".format(self.driver.current_url))
page_state = self.driver.execute_script('return document.readyState;')
return page_state == 'complete'