Maven project does not generate testng results wit

2019-08-17 08:54发布

问题:

I have created maven project with selenium and TestNG. When I run the project using pom file it does not generate TestNG results (test-output folder). But when I run the project as testng.xml->(right click) run as -> TestNG suite, it generates the results

回答1:

In Run from testNg.xml directly -By default in maven project html reports get created into test-output folder

In case we run from pom.xml using surefire plugin - Reports will get created into target\surefire-reports.



回答2:

While working with multiple frameworks e.g. TestNG, Maven, Gradle due to synchronization issues within your IDE sometimes the test-output folder doesn't gets populated with the intended test results/output and the output tends to remain buffered. In these cases once the Test Execution gets completed Refresh the Maven Project and your test-output folder would get populated with the intended results/output.



回答3:

As you are running testng tests from Maven (Surefire), your output folder will be target instead of test-output as defined by the surefire plugin, so if you are looking for file testng-results.xml or any other testng files then check at \target\surefire-reports\testng-results.xml