FAQ
hi,

so i want to wait until the page is loaded completely, we have loading
image tht is visible until page loads completely (once the page is all
loaded, it becomes invisible).
with the selenium RC , i was checking using
selenium.isVisible(elementID); and this worked perfectly.

when i moved to webdriver..m using

WebDriverWait wait = new WebDriverWait(driver, 30);
Boolean element =
wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id(HTMLElement.IS_WAIT_PRESENT)));

but here, it seems it is not waiting until it loads completely and
immediately executes next command that leads to "Unable to locate element"
error.

if i put sleep in conjunction with above wait code, then it works fine...
try {
Thread.sleep(3000);
} catch (InterruptedException e) {

e.printStackTrace();
}

i am trying to avoid using sleeps...is there any other way

--
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/-/R4pzxTrIAc4J.
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.

Search Discussions

  • Krishnan Mahadevan at Sep 18, 2012 at 9:09 am
    Have you tried
    using org.openqa.selenium.support.ui.ExpectedConditions.visibilityOf(WebElement)
    instead of invisibilityOfElementLocated() because I think the latter waits
    for an element to go invisible, after it was initially visible on the page.


    Thanks & Regards
    Krishnan Mahadevan

    "All the desirable things in life are either illegal, expensive, fattening
    or in love with someone else!"


    On Sat, Sep 15, 2012 at 3:09 AM, taru wrote:

    hi,

    so i want to wait until the page is loaded completely, we have loading
    image tht is visible until page loads completely (once the page is all
    loaded, it becomes invisible).
    with the selenium RC , i was checking using
    selenium.isVisible(elementID); and this worked perfectly.

    when i moved to webdriver..m using

    WebDriverWait wait = new WebDriverWait(driver, 30);
    Boolean element =
    wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id(HTMLElement.IS_WAIT_PRESENT)));

    but here, it seems it is not waiting until it loads completely and
    immediately executes next command that leads to "Unable to locate element"
    error.

    if i put sleep in conjunction with above wait code, then it works fine...
    try {
    Thread.sleep(3000);
    } catch (InterruptedException e) {

    e.printStackTrace();
    }

    i am trying to avoid using sleeps...is there any other way

    --
    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/-/R4pzxTrIAc4J.
    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.
  • Simon Stewart at Sep 18, 2012 at 10:34 am
    Invisibility isn't just whether the element is visible, but whether
    it's also present on the page. It's better to first wait for the
    presence of the element, then wait for it not to be visible.

    Simon
    On Fri, Sep 14, 2012 at 10:39 PM, taru wrote:
    hi,

    so i want to wait until the page is loaded completely, we have loading image
    tht is visible until page loads completely (once the page is all loaded, it
    becomes invisible).
    with the selenium RC , i was checking using
    selenium.isVisible(elementID); and this worked perfectly.

    when i moved to webdriver..m using

    WebDriverWait wait = new WebDriverWait(driver, 30);
    Boolean element =
    wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id(HTMLElement.IS_WAIT_PRESENT)));

    but here, it seems it is not waiting until it loads completely and
    immediately executes next command that leads to "Unable to locate element"
    error.

    if i put sleep in conjunction with above wait code, then it works fine...
    try {
    Thread.sleep(3000);
    } catch (InterruptedException e) {

    e.printStackTrace();
    }

    i am trying to avoid using sleeps...is there any other way

    --
    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/-/R4pzxTrIAc4J.
    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.
  • Ben Thomas at Sep 20, 2012 at 11:27 am
    Try something like this on the element that is on the finished loaded page

    FluentWait<By> fluentWait = new
    FluentWait<By>(By.id("YourElementName"));
    fluentWait.pollingEvery(100, TimeUnit.MILLISECONDS);
    fluentWait.withTimeout(1000, TimeUnit.MILLISECONDS);
    fluentWait.until(new Predicate<By>() {
    public boolean apply(By by) {
    try {
    return driver.findElement(by).isDisplayed();
    } catch (NoSuchElementException ex) {
    return false;
    }
    }
    });



















    On Friday, September 14, 2012 4:39:53 PM UTC-5, taru wrote:

    hi,

    so i want to wait until the page is loaded completely, we have loading
    image tht is visible until page loads completely (once the page is all
    loaded, it becomes invisible).
    with the selenium RC , i was checking using
    selenium.isVisible(elementID); and this worked perfectly.

    when i moved to webdriver..m using

    WebDriverWait wait = new WebDriverWait(driver, 30);
    Boolean element =
    wait.until(ExpectedConditions.invisibilityOfElementLocated(By.id(HTMLElement.IS_WAIT_PRESENT)));

    but here, it seems it is not waiting until it loads completely and
    immediately executes next command that leads to "Unable to locate element"
    error.

    if i put sleep in conjunction with above wait code, then it works fine...
    try {
    Thread.sleep(3000);
    } catch (InterruptedException e) {

    e.printStackTrace();
    }

    i am trying to avoid using sleeps...is there any other way
    --
    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/-/QB2ptHb1jg8J.
    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
Discussion Overview
groupwebdriver @
categorieswatir
postedSep 18, '12 at 8:57a
activeSep 20, '12 at 11:27a
posts4
users4
websitewatir.com

People

Translate

site design / logo © 2021 Grokbase