JOBSEEKER?

Java Selenium Interview Questions

Practice for Java Selenium interviews by solving TestDome questions. Our interview questions are used by more than 7,000 companies and 450,000 individual test takers.

Jobseekers: Certify Your Knowledge

Take a Certification Test

Companies: Use Our Tests for Screening

Buy a Pack Of Candidates

Need to practice your Java Selenium programming skills for an upcoming job interview? Try solving these Java Selenium interview questions that test knowledge of Java Selenium concepts such as selectors, implicit and explicit waits, and other skills. We’ll provide feedback on your answers, and you can use a hint if you get stuck.

These Java Selenium interview questions are examples of real tasks used by employers to screen job candidates such as web application testers, QA engineers, and others that require knowledge of Java Selenium.

1. Dog Search

Easy 
Java Selenium WebDriver WebDriver Wait New Public

A dog grooming website recently added a search function to their website.

One of their Selenium tests for the search functionality begins like this:

WebDriver driver = new ChromeDriver(chromeOptions);
driver.manage().timeouts().implicitlyWait(5, java.util.concurrent.TimeUnit.SECONDS);

driver.get(dogGroomingURL);
WebElement searchBox = driver.findElement(By.cssSelector(".searchbox"));
searchBox.sendKeys("paw grooming");

WebElement searchButton = driver.findElement(By.id("searchButton"));
searchButton.click();

WebElement searchResults = driver.findElement(By.id("searchResults"));
String text = searchResults.getText();

What can be concluded about the test?

(Select all acceptable answers.)

Solve Question

2. Pet Wiki

Easy 
Java Selenium WebDriver WebDriver Wait New Public

​A pet wiki wants to add Selenium tests for their website. One thing common to many pages that they want to test is dynamic loading of data, and they want to test if it's fast enough.

Finish the getLoadedData method that accepts a WebDriver instance that has the desired page loaded. The method should click the button with the id "load-button" and wait up to 1 second for the button to become enabled again. If the button gets re-enabled in 1 second, the method should return the content of the paragraph with the id "content" as soon as possible. Otherwise, the method should return null.

For example, if getLoadedData is called with a WebDriver instance with the following page loaded, provided here and below:

<!DOCTYPE html>
<html>
  <head>
    <script>
      function loadData() {
        document.getElementById("load-button").disabled = true;
        setTimeout(() => {
          document.getElementById("content").innerHTML = "The Maltese is a breed of dog in the toy group.";
          document.getElementById("load-button").disabled = false;
        }, 500);
      }
    </script>
  </head>
  <body>
    <p id="content" >
      The Maltese....
    </p>
    <button id="load-button" onclick="loadData()">
      Click here to load additional data.
    </button>
  </body>
</html>

the method should return "The Maltese is a breed of dog in the toy group.".

Solve Question

If you feel ready, take one of our timed public Java Selenium Interview Questions tests:
Java Selenium

Java Selenium Online Test (Easy)

Not exactly what you are looking for? Go to our For Jobseekers section.
Dashboard Start Trial Sign In Home Tour Tests Questions Pricing For Jobseekers