Java 如何使用 Junit+selenium+Eclipse 生成测试报告?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/18401167/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to generate test reports using Junit+selenium+Eclipse?
提问by htc
I would like to know how to generate the test reports using junit+eclipse+selenium. I m using java as the language.I tried something but i didn't do anything: 1) First generate an Ant build file for my project. In the Export page select "Ant Buildfiles" it is under General. Then select a project that contains your JUnit tests. The default JUnit output directory is appropriately named "junit". 2) Next resolve dependencies by making sure that the junit.jar is added to Ant's "Global Entries." Window->Preferences->Ant->Runtime->Global Entries and Add External JARs... Navigate to my "eclipse" directory (where eclipse is installed). It is under *"plugins" directory and presently the junit.jar is in a directory named "org.junit_3.8.1".*<-I couldn't find this folder.
我想知道如何使用junit+eclipse+selenium生成测试报告。我使用 java 作为语言。我尝试了一些东西,但我什么也没做:1) 首先为我的项目生成一个 Ant 构建文件。在“导出”页面中,选择“Ant Buildfiles”,它位于“常规”下。然后选择一个包含 JUnit 测试的项目。默认的 JUnit 输出目录被恰当地命名为“junit”。2) 接下来通过确保将 junit.jar 添加到 Ant 的“全局条目”来解决依赖关系。Window->Preferences->Ant->Runtime->Global Entries and Add External JARs... 导航到我的“eclipse”目录(安装 eclipse 的地方)。它位于 *“plugins”目录下,目前 junit.jar 位于名为“org.junit_3.8.1”的目录中。
It would be great if some one could have given me the steps to generate test reports in eclipse +junit.
如果有人能给我在 eclipse +junit 中生成测试报告的步骤,那就太好了。
回答by Chetan
Go through following link.click herecontains step by step process. this works for me.
通过以下链接。单击此处包含分步过程。这对我有用。
回答by Schroet
You can use extent report http://extentreports.com/. It's not hard to implement it in your project, the necessary code you can find in their examples.
您可以使用范围报告http://extentreports.com/。在您的项目中实现它并不难,您可以在他们的示例中找到必要的代码。