Reputation: 620
I am using testNG in a java web project. When I run the test with gui eclipse on Linux machine it creates a .xml file in my /tmp/ folder. My concern is If I create a custom xml file then where to put that file in project and how we can run that test with eclipse gui.
Upvotes: 1
Views: 407
Reputation: 620
I tried so many things to figure out the solution of the problem and finally got with the help of @XuQing Tan.
You can put your .xml suite file anywhere in the project.
There are two things "Run as -> TestNG Test" and "Run as -> TestNG Suite"
"Run as -> TestNG Test" requires a Class annotated with @Test and it will create a temporary .xml suite file.
"Run as -> TestNG Suite" requires a .xml suite file which you want to ask in the question.
If you right click in the middle of editor of .xml file, It may not show the "Run as -> TestNG Suite" option. For that you need to right click on file in Project Explorer and it will give you option "Run as -> TestNG Suite".
You can also configure it by Run Configurations...
Upvotes: 1
Reputation: 372
you can put your testng xml file under your project on the workspace. and you can run it simply by right clicking on it, then select "Run as -> TestNG Test", please see more in the official doc: http://testng.org/doc/eclipse.html#eclipse-create-method
Upvotes: 1