The test scope in Maven means the dependency is available only during test compilation and execution. It is not packaged in the final artifact, which is ideal for Selenium WebDriver.
import org.openqa.selenium.WebDriver; public class Test { public static void main(String[] args) { WebDriver driver = null; } }
Without the Selenium dependency, the compiler cannot find the org.openqa.selenium package, causing a compilation error.
The official Selenium Java client library artifact is selenium-java. Version 4.10.0 is the latest stable release. Other artifactIds or versions are incorrect for this purpose.
testImplementation ensures the dependency is available only during test compilation and execution, which is appropriate for Selenium WebDriver.
This error means Selenium cannot find the browser driver executable like chromedriver. You must set the system property webdriver.chrome.driver to the correct path.