Skip to content

add 'Wait Until Page Loaded' keyword #107

Closed

Description

@know1nos

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

Activity

  1. j1z0 commented on Sep 11, 2012

    @j1z0
    Contributor

    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.

  2. rtomac commented on Sep 19, 2012

    @rtomac
    Contributor

    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.

  3. aaltat commented on Nov 5, 2015

    @aaltat
    Contributor

    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.

  4. aaltat commented on Dec 10, 2015

    @aaltat
    Contributor

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

  5. andreabisello commented on Jun 4, 2018

    @andreabisello

    @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

  6. aaltat commented on Jun 4, 2018

    @aaltat
    Contributor

    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.

  7. andreabisello commented on Jun 4, 2018

    @andreabisello

    @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.

  8. vish4444 commented on Mar 2, 2019

    @vish4444

    @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,

  9. aaltat commented on Mar 2, 2019

    @aaltat
    Contributor

    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.

  10. pekkaklarck commented on Mar 2, 2019

    @pekkaklarck
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions