Monday, March 7, 2011

Generating JUnit Report

1. Select File menu and click on "Export" option

Figure: Export window
2. Expand "General" node and select "Ant Buildfiles", click on "Next" button

3. Select the project (let all default options), click on "Finish" button
Figure: Ant Buildfiles
4. build.xml file should be created under project folder

5. Now we need to add junit jar file in Ant's "Global Entires"

6. Select "Window" menu, click on "Preferences"

7. In "Preferences" window, expand "Ant" root node, click on "Runtime"

8. Click on "Classpath" tab, expand "Global Entires" 

9. Click on "Add External JARs" button



10. Navigate to your "eclipse" directory (where eclipse is installed). Select "plugins ->org.junit_3.8.2.v3_8_2_v20100427-1100" directory. Select junit.jar file

11. Now right click on build.xml file and select Run As -> Ant Build.."

12. In "Edit Configuration and launch" window, select "build", "SmokeTestSuite" and "junitreprot" checkboxes and click on "Run" button
Figure: Edit Configuration



13. All your test scripts will run and finally report will be generated under the same project directory under "junit" folder

14. Click on "index.html", you will see the report 

1 comment:

  1. i have follow your step and in my project one junit folder created and some .xml file created in junit folder but HTML Report not created to what to do for that any other steps required for that?

    ReplyDelete