FAQ

[webdriver] Firefox is not waiting till page is fully loaded - Selenium 2.22.0

Martino
Jun 1, 2012 at 10:50 am
Hi All,

before update to version 2.22.0 firefox was waiting for page to be
fully loaded while now isnt.

I have noticed the same problem with version 2.21.0, with version
2.20.0 all is working fine!!!

Can anyone help on this?

Cheers guys!

--
You received this message because you are subscribed to the Google Groups "webdriver" group.
To post to this group, send email to webdriver@googlegroups.com.
To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
reply

Search Discussions

6 responses

  • Richard Lavoie at Jun 1, 2012 at 10:58 am
    are you using selenium rc or webdriver ?

    If you are using webdriver, the get() method is not guaranteed to fully wait 'til the page is fully loaded neither is any other action that might change of page. You have to wait manually for a particular element to show up before doing the next action if the original action opened a new page.

    Why did it work for 2.20 and before ? This might be due to some slowness in the api and with some changes it is now faster and not taking as much time it used to.

    Rule of thumb #1: never assume that web driver will wait for you, it doesn't wait automagically.

    Richard


    On 2012-06-01, at 06:45, martino wrote:

    Hi All,

    before update to version 2.22.0 firefox was waiting for page to be
    fully loaded while now isnt.

    I have noticed the same problem with version 2.21.0, with version
    2.20.0 all is working fine!!!

    Can anyone help on this?

    Cheers guys!

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
  • Martino at Jun 1, 2012 at 11:06 am
    Thanks DarkRift.

    I am using webDriver....

    well.... there should be a way to tell webDriver to wait untill the stream
    is closed! ;-(

    Any workaround, I mean a generic one... like wait for somethink that will
    be present in all pages?

    Cheers

    Il giorno venerdì 1 giugno 2012 12:58:21 UTC+2, DarkRift ha scritto:
    are you using selenium rc or webdriver ?

    If you are using webdriver, the get() method is not guaranteed to fully
    wait 'til the page is fully loaded neither is any other action that might
    change of page. You have to wait manually for a particular element to show
    up before doing the next action if the original action opened a new page.

    Why did it work for 2.20 and before ? This might be due to some slowness
    in the api and with some changes it is now faster and not taking as much
    time it used to.

    Rule of thumb #1: never assume that web driver will wait for you, it
    doesn't wait automagically.

    Richard


    On 2012-06-01, at 06:45, martino wrote:

    Hi All,

    before update to version 2.22.0 firefox was waiting for page to be
    fully loaded while now isnt.

    I have noticed the same problem with version 2.21.0, with version
    2.20.0 all is working fine!!!

    Can anyone help on this?

    Cheers guys!

    --
    You received this message because you are subscribed to the Google
    Groups "webdriver" group.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to
    webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/webdriver?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/EQzS7znm3Z0J.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
  • Richard Lavoie at Jun 1, 2012 at 11:31 am
    Even a stream closed dosn't mean the page is fully loaded with all the javascript interaction that can be in there doing ajax calls and updating the layout with different calls right on load.

    If your page has no such thing, you can probably wait until the body tag is displayed on the page (I never tested it).

    Usually you use the Page Object pattern as all the page loads have different hook to wait on. Might want to give a try to wait for the body tag.

    Richard


    On 2012-06-01, at 07:06, martino wrote:

    Thanks DarkRift.

    I am using webDriver....

    well.... there should be a way to tell webDriver to wait untill the stream is closed! ;-(

    Any workaround, I mean a generic one... like wait for somethink that will be present in all pages?

    Cheers

    Il giorno venerdì 1 giugno 2012 12:58:21 UTC+2, DarkRift ha scritto:
    are you using selenium rc or webdriver ?

    If you are using webdriver, the get() method is not guaranteed to fully wait 'til the page is fully loaded neither is any other action that might change of page. You have to wait manually for a particular element to show up before doing the next action if the original action opened a new page.

    Why did it work for 2.20 and before ? This might be due to some slowness in the api and with some changes it is now faster and not taking as much time it used to.

    Rule of thumb #1: never assume that web driver will wait for you, it doesn't wait automagically.

    Richard


    On 2012-06-01, at 06:45, martino wrote:

    Hi All,

    before update to version 2.22.0 firefox was waiting for page to be
    fully loaded while now isnt.

    I have noticed the same problem with version 2.21.0, with version
    2.20.0 all is working fine!!!

    Can anyone help on this?

    Cheers guys!

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To view this discussion on the web visit https://groups.google.com/d/msg/webdriver/-/EQzS7znm3Z0J.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
  • Darrell at Jun 1, 2012 at 12:36 pm
    I usually just wait for the object I want to interact with. For
    example, if it is a login page and I want to select an option from a
    SELECT list, I will try finding the SELECT list in a try/catch, inside
    a while loop. For example, given:

    <select id='database'>
    <option value='1'>SQL Server</option>
    <option value='2'>Oracle DB</option>
    <option value='3'>MySQL</option>
    </select>

    I might use:

    public static WebElement findElementWithTimeoutWait(WebDriver
    driver, By by, long timeOut) {
    WebElement e = null;
    long elapsedTime = 0;
    while(elapsedTime < timeOut) {
    try {
    elapsedTime++;
    Thread.sleep(1000);
    e = driver.findElement(by);
    break;
    } catch (NoSuchElementException nse) {
    }
    }
    return e;
    }

    If it finds the element, the moment it finds the element it returns
    it. It will continue checking, once a second, for the element. If
    after timeOut seconds it does not find it, it returns null.

    I deal with a lot of Web 2.0 stuff. The concept of page LOADED doesn't
    exist. AJAX calls are updating the page all the time. So the page
    never finishes loading. By using this method to find elements (rather
    than WebDriver.findElement) I don't have to worry about AJAX calls
    completing. There are more efficient ways of waiting. But there is no
    generic, efficient way of waiting. Each implementation tends to have
    different things you need to wait for.

    Darrell
    On Jun 1, 7:06 am, martino wrote:
    Thanks DarkRift.

    I am using webDriver....

    well.... there should be a way to tell webDriver to wait untill the stream
    is closed!  ;-(

    Any workaround, I mean a generic one... like wait for somethink that will
    be present in all pages?

    Cheers

    Il giorno venerdì 1 giugno 2012 12:58:21 UTC+2, DarkRift ha scritto:








    are you using selenium rc or webdriver ?
    If you are using webdriver, the get() method is not guaranteed to fully
    wait 'til the page is fully loaded neither is any other action that might
    change of page. You have to wait manually for a particular element to show
    up before doing the next action if the original action opened a new page.
    Why did it work for 2.20 and before ? This might be due to some slowness
    in the api and with some changes it is now faster and not taking as much
    time it used to.
    Rule of thumb #1: never assume that web driver will wait for you, it
    doesn't wait automagically.
    Richard
    On 2012-06-01, at 06:45, martino wrote:

    Hi All,
    before update to version 2.22.0 firefox was waiting for page to be
    fully loaded while now isnt.
    I have noticed the same problem with version 2.21.0, with version
    2.20.0 all is working fine!!!
    Can anyone help on this?
    Cheers guys!
    --
    You received this message because you are subscribed to the Google
    Groups "webdriver" group.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to
    webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/webdriver?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
  • Mattayi at Jun 4, 2012 at 12:24 pm
    I read about webdriver blocking api,
    http://code.google.com/p/selenium/wiki/FrequentlyAskedQuestions#Q:_WebDriver_fails_to_find_elements_/_Does_not_block_on_page_loa

    So are we going to move away from that concept.

    On Jun 1, 5:36 pm, darrell wrote:
    I usually just wait for the object I want to interact with. For
    example, if it is a login page and I want to select an option from a
    SELECT list, I will try finding the SELECT list in a try/catch, inside
    a while loop. For example, given:

    <select id='database'>
    <option value='1'>SQL Server</option>
    <option value='2'>Oracle DB</option>
    <option value='3'>MySQL</option>
    </select>

    I might use:

    public static WebElement findElementWithTimeoutWait(WebDriver
    driver, By by, long timeOut) {
    WebElement e = null;
    long elapsedTime = 0;
    while(elapsedTime < timeOut) {
    try {
    elapsedTime++;
    Thread.sleep(1000);
    e = driver.findElement(by);
    break;
    } catch (NoSuchElementException nse) {
    }
    }
    return e;
    }

    If it finds the element, the moment it finds the element it returns
    it. It will continue checking, once a second, for the element. If
    after timeOut seconds it does not find it, it returns null.

    I deal with a lot of Web 2.0 stuff. The concept of page LOADED doesn't
    exist. AJAX calls are updating the page all the time. So the page
    never finishes loading. By using this method to find elements (rather
    than WebDriver.findElement) I don't have to worry about AJAX calls
    completing. There are more efficient ways of waiting. But there is no
    generic, efficient way of waiting. Each implementation tends to have
    different things you need to wait for.

    Darrell

    On Jun 1, 7:06 am, martino wrote:






    Thanks DarkRift.
    I am using webDriver....
    well.... there should be a way to tell webDriver to wait untill the stream
    is closed!  ;-(
    Any workaround, I mean a generic one... like wait for somethink that will
    be present in all pages?
    Cheers
    Il giorno venerdì 1 giugno 2012 12:58:21 UTC+2, DarkRift ha scritto:
    are you using selenium rc or webdriver ?
    If you are using webdriver, the get() method is not guaranteed to fully
    wait 'til the page is fully loaded neither is any other action that might
    change of page. You have to wait manually for a particular element to show
    up before doing the next action if the original action opened a new page.
    Why did it work for 2.20 and before ? This might be due to some slowness
    in the api and with some changes it is now faster and not taking as much
    time it used to.
    Rule of thumb #1: never assume that web driver will wait for you, it
    doesn't wait automagically.
    Richard
    On 2012-06-01, at 06:45, martino wrote:

    Hi All,
    before update to version 2.22.0 firefox was waiting for page to be
    fully loaded while now isnt.
    I have noticed the same problem with version 2.21.0, with version
    2.20.0 all is working fine!!!
    Can anyone help on this?
    Cheers guys!
    --
    You received this message because you are subscribed to the Google
    Groups "webdriver" group.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to
    webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at
    http://groups.google.com/group/webdriver?hl=en.
    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.
  • Darren Cook at Jun 1, 2012 at 11:04 am

    before update to version 2.22.0 firefox was waiting for page to be
    fully loaded while now isnt.

    I have noticed the same problem with version 2.21.0, with version
    2.20.0 all is working fine!!!
    Ooh, if this a bug, can it be turned into a controllable feature? I've
    been struggling to find a way to interact with a page before it is fully
    loaded! (I can do a timeout on get(), but that just returns control to
    my script, I cannot send any getSource or similar commands to the
    browser - I can see in the selenium log window that they are just
    sitting there waiting for the page to finish loading.)

    Ah, but I'm using 2.21.0, so it sounds like we see different behaviour?
    (I'm using Firefox 12.0, selenium 2.21.0, Ubuntu 10.04, PHP webdriver.)

    Darren


    --
    Darren Cook, Software Researcher/Developer

    http://dcook.org/work/ (About me and my work)
    http://dcook.org/blogs.html (My blogs and articles)

    --
    You received this message because you are subscribed to the Google Groups "webdriver" group.
    To post to this group, send email to webdriver@googlegroups.com.
    To unsubscribe from this group, send email to webdriver+unsubscribe@googlegroups.com.
    For more options, visit this group at http://groups.google.com/group/webdriver?hl=en.

Related Discussions

Discussion Navigation
viewthread | post