Friday 15 March 2013

testing - Passing different parameter und value in TestNG without xml file -



testing - Passing different parameter und value in TestNG without xml file -

i have test methods should started after testdata set up. method set same wanted pass parameters run different sql scripts.

@test @parameters("sqlscript") (groups = "insert_data") public void testinsertdata(string sqlscript) throws exception { final string methodname = "testinsertdata"; scriptservice.runsql( sqlscript +".sql"); }

how can without using testng.xml . know there alternative called @optional("create table t1 ....") , can utilize 1 parameter. if want pass method sql create table t2, t3,....

you can utilize @dataprovider instead of @parameters. read more @ dataproviders

testing junit testng

No comments:

Post a Comment