Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9188481
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T20:01:08+00:00 2026-06-17T20:01:08+00:00

I am new to Selenium WebDriver and am trying to understand the correct way

  • 0

I am new to Selenium WebDriver and am trying to understand the correct way to ‘wait’ for elements to be present.

I am testing a page with a bunch of questions that have radio button answers. As you select answers, Javascript may enable/disable some of the questions on the page.

The problem seems to be that Selenium is ‘clicking too fast’ and not waiting for the Javascript to finish. I have tried solving this problem in two ways – explicit waits solved the problem. Specifically, this works, and solves my issue:

private static WebElement findElement(final WebDriver driver, final By locator, final int timeoutSeconds) {
    FluentWait<WebDriver> wait = new FluentWait<WebDriver>(driver)
            .withTimeout(timeoutSeconds, TimeUnit.SECONDS)
            .pollingEvery(500, TimeUnit.MILLISECONDS)
            .ignoring(NoSuchElementException.class);

    return wait.until(new Function<WebDriver, WebElement>() {
        public WebElement apply(WebDriver webDriver) {
            return driver.findElement(locator);
        }
    });
}

However, I would prefer to use an implicit wait instead of this. I have my web driver configured like this:

driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS);

This does not solve the problem and I get a NoSuchElementException. Additionally, I do not notice a 10 second pause – it just errors out immediately. I have verified this line in the code is being hit with a debugger. What am I doing wrong? Why does implicitlyWait not wait for the element to appear, but FluentWait does?

Note: As I mentioned I already have a work around, I really just want to know why Implicit wait isn’t solving my issue. Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T20:01:09+00:00Added an answer on June 17, 2026 at 8:01 pm

    Remember that there is a difference between several scenarios:

    • An element not being present at all in the DOM.
    • An element being present in the DOM but not visible.
    • An element being present in the DOM but not enabled. (i.e. clickable)

    My guess is that if some of the page is being displayed with javascript, the elements are already present in the browser DOM, but are not visible. The implicit wait only waits for an element to appear in the DOM, so it returns immediately, but when you try to interact with the element you get a NoSuchElementException. You could test this hypothesis by writing a helper method that explicits waits for an element to be be visible or clickable.

    Some examples (in Java):

    public WebElement getWhenVisible(By locator, int timeout) {
        WebElement element = null;
        WebDriverWait wait = new WebDriverWait(driver, timeout);
        element = wait.until(ExpectedConditions.visibilityOfElementLocated(locator));
        return element;
    }
    
    public void clickWhenReady(By locator, int timeout) {
        WebDriverWait wait = new WebDriverWait(driver, timeout);
        WebElement element = wait.until(ExpectedConditions.elementToBeClickable(locator));
        element.click();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to test a web page using Selenium IDE. Am new to
def wait_for_element_present(element) wait = Selenium::WebDriver::Wait.new(:timeout => 30); wait.until{driver.find_element(element)}; end Please take a look at
I am trying to get familiar with the new ruby selenium-webdriver as it appears
I'm new to selenium testing and am trying to get my first test up
I am new to the world of testing. I am using selenium IDE for
I have a selenium webdriver backed code in java for testing an web application.
I use Selenium WebDriver with firefox. Every time selenium generates new anoniumus profile for
I want easy way to launch Selenium webdriver instance and run various tests on
We are trying to migrate our system to WebDriver from Selenium 1. Thorough the
I'm new to Selenium WebDriver using EclipseIDE with TestNG. I'm currently running this sample

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.