splinter
splinter copied to clipboard
Need functionality to check whether page has been loaded
It is a normal requirement that any point of time we should be able to inspect whether the browser has completed loading the page.
This is a requirement because when a page navigation happens via JavaScript, say on the click of a button somewhere, there is no way of knowing whether the browser has completed loading the page as on click the control comes back (as opposed to visit() where control does not come back unless the page has been completely loaded).
With this functionality, one can inspect and then continue when the page has been loaded.
+1
I've made it on splinter driver for pyfunct. Take a look: https://github.com/gabrielpjordao/pyfunct/blob/master/pyfunct/contrib/splinter_driver.py#L109
We could implement something like this on splinter. What do you guys think about it?
I think it's fine. But Selenium could use its own only way to wait for the page to load (check that other similar issue, I can't access it now) instead of the Javascript way, that could be the default behavior when the driver doesn't support it somehow.
On Tue, Aug 20, 2013 at 7:04 PM, Gabriel [email protected] wrote:
I've made it on splinter driver for pyfunct. Take a look:
https://github.com/gabrielpjordao/pyfunct/blob/master/pyfunct/contrib/splinter_driver.py#L109
We could implement something like this on splinter. What do you guys think about it?
— Reply to this email directly or view it on GitHubhttps://github.com/cobrateam/splinter/issues/237#issuecomment-22981510 .
Douglas Camata Graduando em Ciência da Computação (UENF)
Blog: http://douglascamata.net Github: http://github.com/douglascamata Twitter: @douglascamata http://twitter.com/douglascamata
http://twitter.com/douglascamataSkype: douglas_camata
Linux User #509211
I like Gabriel's approach, it should work in most stacks. Also there's
selenium.wait_for_page_to_load(10000) Lucas Geiger
On Tue, Aug 20, 2013 at 6:10 PM, Douglas Camata [email protected] wrote:
I think it's fine. But Selenium could use its own only way to wait for the page to load (check that other similar issue, I can't access it now) instead of the Javascript way, that could be the default behavior when the driver doesn't support it somehow.
On Tue, Aug 20, 2013 at 7:04 PM, Gabriel [email protected] wrote:
I've made it on splinter driver for pyfunct. Take a look:
https://github.com/gabrielpjordao/pyfunct/blob/master/pyfunct/contrib/splinter_driver.py#L109
We could implement something like this on splinter. What do you guys think about it?
— Reply to this email directly or view it on GitHubhttps://github.com/cobrateam/splinter/issues/237#issuecomment-22981510 .
Douglas Camata Graduando em Ciência da Computação (UENF)
Blog: http://douglascamata.net Github: http://github.com/douglascamata Twitter: @douglascamata http://twitter.com/douglascamata
http://twitter.com/douglascamataSkype: douglas_camata
Linux User #509211
— Reply to this email directly or view it on GitHub.
I'm +1 for visit(wait_page_load=True)
. And each driver should use it native implementation, like wait_for_page_to_load
for selenium drivers.
Nice @andrewsmedina, but I think we should add it to the click event too, which has the problem described on the issue.
@gabrielpjordao I disagree. That could be another separated method and be called just after a click or any other interaction. Maybe there could be an option in click method to automatic call it after the click itself.
Yeah, I'm just saying that it'd be useful to have it possible on click (not default) event, since @andrewsmedina mentioned putting it on visit method.
Maybe something like click(wait_page_load=True)
or a click_and_wait()
shortcut.
Is this still implemented? I am eagerly waiting for this feature
Selenium now waits for page load by default. It must be disabled via an Options parameter: https://www.selenium.dev/documentation/webdriver/drivers/options/#pageloadstrategy
It won't handle complex hydration scenarios, but strategies for dealing with that are going to be specific to the web app being automated.