Here we will see the Configuration Steps of P3selenium.
Java should be installed in the system
TestNG and Maven should be installed in eclipse
NOTE: We are using “Eclipse Juno” in this example
You can get P3selenium framework from Github, use the following URL to download the zip
Step 1: Extract the zip file and put it in your workspace
Step 2: Open Eclipse IDE.
Step 3: Go to File > Import
Step 4: Import window will open, select Existing Projects into Workspace under General category
Step 5: Now to run different tests you have to make an entry in testng.xml file. Below is the testng.xml file used in p3selenium framework
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite> is kind of root tag in testng.xml file. All test are defined in suite using <test> tag
<suite name="Suite" parallel="false">
We can define parameters under suite. Parameter defined here passes with every class defined in the test
<parameter name="browser" value="chrome" />
<parameter name="excel_name" value="none" />
We have given name to our test that is P3testing. There can be multiple <test> tags in a suite
These are our classes. Each class represent one testcase
<class name="com.p3selenium.scripts.pname.testcase.VerifyPageTitle" />
Step 6: To run the test, right click on the project go to “Run As” > Maven test.
NOTE: When you run the project first time it may take time because it will download some required jar files.
Step 7: Now, we have to see the reports.
Reports will get generated at the end of the test execution and to see the reports you have to open the index.html file which is under target>surefire-reports>html>index.html