0
0
Selenium Javatesting~20 mins

Selenium dependency configuration in Selenium Java - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Selenium Dependency Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
Understanding Maven Dependency Scope for Selenium
In a Maven project, which dependency scope should you use for Selenium WebDriver to ensure it is available during test compilation and execution but not included in the final build artifact?
Acompile
Btest
Cprovided
Druntime
Attempts:
2 left
💡 Hint
Think about when Selenium is needed: only during testing, not in production.
Predict Output
intermediate
2:00remaining
Result of Missing Selenium Dependency
What error will occur if you try to run Selenium WebDriver tests in a Java project without adding the Selenium dependency in your build configuration?
Selenium Java
import org.openqa.selenium.WebDriver;

public class Test {
    public static void main(String[] args) {
        WebDriver driver = null;
    }
}
ARuntime error: NullPointerException
BCompilation error: cannot find symbol WebDriver
CCompilation error: package org.openqa.selenium does not exist
DNo error, code runs successfully
Attempts:
2 left
💡 Hint
If the Selenium library is missing, the compiler cannot find its classes.
locator
advanced
2:00remaining
Correct Maven Dependency for Selenium Java 4.10.0
Which of the following Maven dependency snippets correctly adds Selenium Java version 4.10.0 to your project?
A
<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-java</artifactId>
  <version>4.10.0</version>
</dependency>
B
<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-server</artifactId>
  <version>4.10.0</version>
</dependency>
C
<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-java</artifactId>
  <version>3.141.59</version>
</dependency>
D
<dependency>
  <groupId>org.seleniumhq.selenium</groupId>
  <artifactId>selenium-webdriver</artifactId>
  <version>4.10.0</version>
</dependency>
Attempts:
2 left
💡 Hint
Check the artifactId and version carefully.
framework
advanced
2:00remaining
Configuring Selenium WebDriver with Gradle
Which Gradle dependency declaration correctly adds Selenium Java 4.10.0 for testing purposes only?
AcompileOnly 'org.seleniumhq.selenium:selenium-java:4.10.0'
Bimplementation 'org.seleniumhq.selenium:selenium-java:4.10.0'
CruntimeOnly 'org.seleniumhq.selenium:selenium-java:4.10.0'
DtestImplementation 'org.seleniumhq.selenium:selenium-java:4.10.0'
Attempts:
2 left
💡 Hint
Consider when Selenium is needed during the build lifecycle.
🔧 Debug
expert
3:00remaining
Diagnosing Selenium Driver Not Found Error
You have added Selenium Java 4.10.0 dependency correctly, but when running tests, you get the error: "The path to the driver executable must be set by the webdriver.chrome.driver system property". What is the most likely cause?
AWebDriver executable (e.g., chromedriver) path is not set or not found
BTest class is missing @Test annotation
CIncorrect version of Selenium Java dependency
DSelenium dependency is missing from the project
Attempts:
2 left
💡 Hint
Selenium needs a browser driver executable to control the browser.