Integrate your Selenium project with Testreport.io
TestReport.io
Last Update 5 bulan yang lalu
Follow these detailed steps to successfully integrate your Selenium project with Maven:
Pre-requieste:
1) Add the Surefire Plugin:
Navigate to the Plugin Management section in your pom.xml file, include the Surefire plugin, and specify the path to your XML configuration file.
2) Add the Failsafe Plugin:
Ensure the Maven Failsafe plugin is added outside the <pluginManagement> section in your pom.xml file. also specify the path to your XML configuration file.
Step 1: Copy Required Snippet
- Copy the required snippet from testreport.io.
- Open the POM.xml file from your Selenium framework.
- Paste the code into your POM.xml file to configure the necessary dependencies.
Step 2: Set Source File Path
-
Open your configuration file and specify the sourceFilePath.
-
Set the path of the testng-results.xml file in your project where the file generates inside the OutputDirectory tag.
Example:
Step 3: Set Screenshot Path
- If you integrated screenshot then Define the screenshotPath in your project directory for storing failed case screenshots. else remove screenshotImagePath tag.
Step 4: Run the Project
- Execute the following Maven command in your terminal to initiate the build and test process:
Example:
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: