Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to generate test-output folder from testng tests?

How to generate the test-output folder for a testNG test?

I am trying to get the default testng report, index.html

Netbeans7/windows7

I made a simple testng test case, ran it in netbeans 7, and here is the result. I see no test-output. I am displaying the project and file structure.

If I need to do something with ant or maven, please describe VERY detailed steps as to how to proceed on Windows 7 -- I am new to both of those tools.

If I need to do something with build.xml, please give explicit, detailed steps

netbeans testng output and project file structure

EDIT:

here is a screenshot of my final netbeans layout, including the TestSuite.xml file that got the results folder to generate: enter image description here

like image 274
stuart Avatar asked Jul 02 '15 00:07

stuart


Video Answer


2 Answers

I had the same problem using IntelliJ and that's how I fixed it:

Select Use default reporters under the Listeners tab on the Run/Debug Configurations

enter image description here

enter image description here

PS: Remember to add the path for the testng xml file under the Suite field

like image 193
Francislainy Campos Avatar answered Nov 15 '22 09:11

Francislainy Campos


By default the report files (HTML & XML) are written to a folder named test-output under your workspace.

Netbeans however overrides this location. It places output to build/test/results folder. Please re-run the TestNG test suite and watch results folder. All required files will be generated there.

If you want to tinker with the output location open file nbproject/project.properties under your project folder. In that file there is a property called build.test.results.dir which gets passed as an argument to ant task for TestNG run. I do not think you need to edit netbeans generated build files for this purpose.

Also, when you run the tests, have a look at the console(netbeans) output, there it may print messages such as :

[-d output-directory]
default output directory to : test-output
like image 38
ring bearer Avatar answered Nov 15 '22 07:11

ring bearer