Create test reports programmatically (not using ANT) in Selenium using Junit / Test NG

你说的曾经没有我的故事 提交于 2019-12-11 04:26:36

问题


I want to create test reports (reports generated after the execution of each test case). I can generate JUnit test reports using ANT. But, my requirement is such that I would have to generate these reports through Java.

Which is the best way to create test reports using Java ?

The test reports need not only be created in JUnit. It can be created in any test framework. Any suggestions / advice related to it might prove helpful. So, request you to share you experience in generating test reports using Java.


回答1:


TestNG reports get generate automaticlly if you run a suite(xml). Standard folder is test-output in your project. Have a look at the testNG doc at chapter 6.2.2 and following http://testng.org/doc/documentation-main.html how to customize those.




回答2:


TestNG provides a programmatic way to run the tests without using any build file. TestNG suite and other parameters that are being used in build XML have corresponding JAVA classes. Check this link. http://testng.org/doc/documentation-main.html#running-testng-programmatically

You can get the report as mentioned by Tarken.



来源:https://stackoverflow.com/questions/9060154/create-test-reports-programmatically-not-using-ant-in-selenium-using-junit-t

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!