Wednesday, February 3, 2016

Reports generation with Selenium, JUNIT and ANT

 


Step1: Create two classes with first class having two test cases, second having one test case.  Create ”MyTestSuite”.


 

Step2: Go to Windows>Preferences and add the "JUNIT" jar through external jars as shown below.





Step3: On TestCases package, right click and select Export option
 
 

Step4: Select “ANT Build Files” and click Next
 
 
Step5: Select the project name and click “Finish”, The Build.xml file will be generated.

 
 

Step6: Open the build.xml and remove the Target xml section created for the first two classes. Don’t remove the MyTestSuite related Target. Save the file.
Step7: Right click on build.xml, select “Run As” and “Ant Build” option
 
Step8: Select “build[default], MyTestSuite, juintreport” and click “Run”.
 
Step9: MyTestSuite executes and report will be available in “junit” folder.
 
Step10: Open “Index.html” in Web Browser.
 
Step11: Click on “MyTestSuite” for detailed results.
 

No comments:

Post a Comment