Follow these detailed steps to successfully integrate your Selenium project with Maven:
Step 1: Copy Required Snippet
Step 2: Set Source File Path
Open your configuration file and specify the sourceFilePath
.
Set the path of the index.html
file in your project where the file generates inside the OutputDirectory
tag.
Example:
<sourceFilePath>${project.build.directory}/test-output/testng-results.xml</sourceFilePath>
Step 3: Set Screenshot Path
Define the screenshotPath
in your project directory for storing failed case screenshots.
Example:
<screenshotImagePath>${project.build.directory}/test-output/screenshots/</screenshotImagePath>
Step 4: Run the Project
Execute the following Maven command in your terminal to initiate the build and test process:
mvn clean test
Check the terminal output to ensure the build and tests have run successfully.
Once everything is set up, the output in the terminal would look something like this: