Create Reports using JUnit:
After running test scripts in eclipse it would be good if we generate reports. Junit is one the most popular unit testing framework around.
Below are the steps to generate reports:
1. Right click on project and click on "Export" option
2. Expand "General" node and select "Ant Buildfiles", click on "Next" button
3. Select the project (let all default options),
Junit output Directory ... F:\Automation\First\junit
click on "Finish" button
4. build.xml file should be created under project folder
5. Now we need to add junit jar and Tools.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. and add Tools.jar which is located under java/JDK/Lib
11. Now right click on build.xml file and select Run As -> Ant Build.."
12. In "Edit Configuration and launch" window, select "build", "tootltip (the script we want to run)" and "junitreprot" checkboxes and click on "Run" button
13. All your test scripts will run and finally report will be generated under the same project directory under "junit" folder. To view JUint folder please refresh.
14. Click on "index.html", you will see the report
Hope you all enjoy this post.
After running test scripts in eclipse it would be good if we generate reports. Junit is one the most popular unit testing framework around.
Below are the steps to generate reports:
1. Right click on project and click on "Export" option
2. Expand "General" node and select "Ant Buildfiles", click on "Next" button
3. Select the project (let all default options),
Junit output Directory ... F:\Automation\First\junit
click on "Finish" button
4. build.xml file should be created under project folder
5. Now we need to add junit jar and Tools.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. and add Tools.jar which is located under java/JDK/Lib
11. Now right click on build.xml file and select Run As -> Ant Build.."
12. In "Edit Configuration and launch" window, select "build", "tootltip (the script we want to run)" and "junitreprot" checkboxes and click on "Run" button
13. All your test scripts will run and finally report will be generated under the same project directory under "junit" folder. To view JUint folder please refresh.
14. Click on "index.html", you will see the report
Hope you all enjoy this post.








