ReportNG does not provide any report

♀尐吖头ヾ 提交于 2019-12-01 07:33:55

I am the author of ReportNG. You don't need to write any Java code to get it to work. You just need to be able to register listeners with TestNG from whichever tool you use.

I've only used ReportNG from Ant but other people have got it working with other build systems such as Maven and Gradle. I don't know if there is anything Selenium-specific that would prevent it from working. Are you getting any error messages? The first thing I would check is to make sure that the ReportNG JAR is on the classpath.

I didn't even realise that you could specify TestNG listeners in the testng.xml file. However, I have just modified my sample reports to specify the listeners in this way rather than in the Ant build file and it works fine, so the problem is probably in the way you are configuring TestNG from Selenium.

How are you launching from Eclipse? You should be right-clicking on that XML file and select "Run as... TestNG suite". I'm assuming that's what you're doing.

Using default listeners should not have any impact on the problem you are seeing, I am guessing that some people use this because if they use ReportNG, they don't care about any of the other listeners that TestNG generates. Having said that, if you ever want to do this from Eclipse, you can simply edit the launch configuration that was created when you launched your suite as indicated above and add "-usedefaultlisteners false" to the parameters box.

Unni

To disable defaultlisteners ,

Goto Eclipse Project-> Properties -> TestNG -> Disable deafult listeners.

After running you will end up with following error:

java.lang.NoClassDefFoundError: com/google/inject/Module 
        at java.lang.Class.getDeclaredMethods0(Native Method) 
        at java.lang.Class.privateGetDeclaredMethods(Unknown Source) 
        at java.lang.Class.privateGetPublicMethods(Unknown Source) 
        at java.lang.Class.getMethods(Unknown Source) 

to solve this, download google-guice-3.0.zip and paste guice-3.0.jar into your classpath.

Now run and check the report in workspace/test-output/html.

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