Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add 'Wait Until Page Loaded' keyword #107

Closed
know1nos opened this issue Sep 10, 2012 · 10 comments
Closed

add 'Wait Until Page Loaded' keyword #107

know1nos opened this issue Sep 10, 2012 · 10 comments

Comments

@know1nos
Copy link

This is a useful keyword in the original SeleniumLibrary, is it possible to add it to the Selenium2Library?

@j1z0
Copy link
Contributor

j1z0 commented Sep 11, 2012

There is no need with webdriver. Wait until page load is automatic with webdriver. However it is important to note this doesn't take into account Ajax.

Cheers,
Jeremy

On Sep 10, 2012, at 23:48, know1nos notifications@github.com wrote:

This is a useful keyword in the original SeleniumLibrary, is it possible to add it to the Selenium2Library?


Reply to this email directly or view it on GitHub.

@rtomac
Copy link
Contributor

rtomac commented Sep 19, 2012

Jeremy is right, Selenium2/WebDriver is a "blocking" API so it will naturally wait until an action (like a page load) is completed. We intentionally pulled that keyword when initially writing the library for that reason.

That said, I would like to hear the context you needed it in @know1nos. I too have run into a special situation where I thought it might be useful and I'm curious if your situation is the same.

@aaltat
Copy link
Contributor

aaltat commented Nov 5, 2015

There has not been activity for this issue for few years and we are planning to close the old issues if they are not anymore valid ones. If you feel that this is still valid issue, could you send an update. If update is not received in a month, we will assume that this is not anymore an issues and we will close this issue.

@aaltat
Copy link
Contributor

aaltat commented Dec 10, 2015

Closed because of inactivity. If someone encounters similar or same problem please open a new issue.

@aaltat aaltat closed this as completed Dec 10, 2015
@andreabisello
Copy link

andreabisello commented Jun 4, 2018

@aaltat please consider this scenario

Open Browser chrome http://url_with_some_very_slow_blocking_javascript
Go To http://another.url

if the first page has some very slow blocking javascript, it will wait until the download of all of these javascript before moving to page2?

thanks

@aaltat
Copy link
Contributor

aaltat commented Jun 4, 2018

As explained in the previous posts, starting from Selenium 2, Selenium provides blocking type of API. This means that Selenium will wait until page is loaded from a browser perspective. But the problem is that browser does not know what JavaScript is doing behind the scenes and therefore browser indicates too early that page loading is done. Also pages sometimes might be build in that way that whole page does not have a single state. Instead different objects in the page have their own load states. Therefore it's impossible to build a keyword which would solve everyone's, or even a small subset, problems in this matter. Instead it's better to talk to the development and find a solution for you that indicates when your page is loaded. Find a thing, which you need to poll to be sure that page is fully loaded. This is usually called testability.

But because this is problem is in the downstream and there is nothing in the SeleniumLibrary side which could be done to solve the problem, I am keeping this issue closed in the foreseen future.

@andreabisello
Copy link

@aaltat i agree with your approch.
if the website works well, there should be no long waiting time on syncronous phase of javascript.
in one of my use case, i need to move on a page in order to make the login, then i need to move to another page with the session token acquired, and i don't care about the content of the "logged user" page. Robot will wait until the "logged user" page is full loaded before move to the new page by the Go To. This is not a robot issue, is a page issue. i never found this behaviour because i never found a very slow website as this one.

@vish4444
Copy link

vish4444 commented Mar 2, 2019

@aaltat agree to your point and also to the fact that this is not so easy to implement.
However, when automating Salesforce platform which uses heavy javascript, native salesforce objects, custom objects, lightning/VisualForce pages, pages having multiple dashboard at times - all these components take lot of time to load. Plus the loading time differs a lot. So here is where I felt dire need of this keyword.
Cheers,

@aaltat
Copy link
Contributor

aaltat commented Mar 2, 2019

With the modern JavaScript Frameworks, there is not anymore single correct way to wait that application is ready. Instead one should look how the application is build and what kind of hook's it offers to ensure that application is ready/loaded.

Also there are already several libraries build on top of the SeleniumLibrary which may already do what you are looking for.

@pekkaklarck
Copy link
Member

At least SalesForce.org uses Robot Framework and has implemented tooling to support it (e.g. their CumulusCI supports it). They might have something to help with page loading as well.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants