This repository provides a basic setup for Selenium tests using Java. It includes:
- Maven as the build tool
- TestNG as the testing framework
- Selenium WebDriver as the browser automation tool
- ChromeDriver and GeckoDriver for Chrome and Firefox browsers respectively
- WebDriverManager for managing the browser drivers
- Java Development Kit (JDK) 17 or higher
- Maven 3.6.1 or higher
- Chrome and/or Firefox browser installed
- Clone the repository using
git clone https://github.com/ndshah/selenium-interview-test
- Change into the project directory using
cd selenium-test-setup
- Install the dependencies using
mvn clean install
- Update the
webdrivermanager
properties in thepom.xml
file to point to the correct browser driver executable paths - Run the tests using
mvn test
The Selenium tests can be configured using the following environment variables:
BROWSER
: The browser to use for the tests. Supported values arechrome
andfirefox
.DRIVER_PATH
: The path to the browser driver executable.
The environment variables can be set using the mvn
command line options or by creating a settings.xml
file in the project root directory.