java - How can i run a Test multiple times using testNG using XML file? -


i've 3 @test methods say, methoda, methodb , methodc. 3 methods used fill form 1 one takes input csv file. xml file looks below...

<?xml version="1.0" encoding="utf-8" ?> <!doctype suite system "http://testng.org/testng-1.0.dtd" > <suite name="fill forms">     <test name="fill multiple times">         <classes>             <class name="com.class"/>                 <methods>                     <include name='methoda'/>                     <include name='methodb'/>                     <include name='methodc'/>                 </methods>             </class>         </classes>     </test> </suite> 

i want run test 'fill multiple times' multiple times.

kindly suggest me idea...

if each method interacting same elements , passing different inputs, try parameterizing tests 1 of approaches available in testng.

http://testng.org/doc/documentation-main.html#parameters

xml parameters work well, result in more verbose suite xml file.

my recommendation, assuming above condition true, use dataprovider test. way, need write test method once , dataprovider iterate on test each data set define.

edit: since test isn't able parameterized... if you're looking repeat test methods number of times, either repeat <test> node on xml many times wish repeat execution. if wish keep xml getting verbose, creating test case factory.


Comments

Popular posts from this blog

angular - Is it possible to get native element for formControl? -

unity3d - Rotate an object to face an opposite direction -

javascript - Why jQuery Select box change event is now working? -