Checkout our demo site to practice selenium https://magento.softwaretestingboard.com/

0 like 0 dislike
1.1k views
in Selenium by
recategorized by
We are widely using JUnit for our selenium tests. Now we have plans to migrate to TestNG. Is there any effective way of doing the same?

1 Answer

0 like 0 dislike
by
selected by
 
Best answer

Using Eclipse:

You can easily convert JUnit 3 and JUnit 4 tests to TestNG.

Your first option is to use the Quick Fix function:

 

image 
Convert from JUnit 3

image 
Convert from JUnit 4

You can also convert packages or entire source folders with the conversion refactoring:

image

The refactoring wizard contains several pages:

image

This page lets you generate a testng.xml automatically. You can configure whether to include your test classes individually or by package, the suite and test name and also whether these tests should run in parallel.

image

This page gives you an overview of the changes that are about to be performed. You can also decide to exclude certain files from the refactoring.

When you are done, press the "Finish" button. Like all Eclipse refactorings, you can undo all these changes in one click:

image

 


This site is for software testing professionals, where you can ask all your questions and get answers from 1300+ masters of the profession. Click here to submit yours now!

...