Testing / Selenium Interview questions
How do you install Selenium WebDriver in a Java project?
In a Maven-based Java project, Selenium is added as a dependency in pom.xml rather than a manual JAR download:
<dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>4.24.0</version> </dependency>
Since Selenium 4.6, there's no need to separately download and manage browser driver executables by hand - Selenium Manager is bundled in and automatically detects the installed browser version, then downloads and caches a matching driver behind the scenes the first time a browser is launched.
Running mvn install afterward pulls the dependency, and a test can then simply call new ChromeDriver() without any prior manual driver setup.
More Related questions...