xml - Passing parameters to testNG provider -
i'm new this, information not covered in testng docs, , understand few things, if can me.
@dataprovider(name="test1") public object[][] providetestparam(itestcontext context){ string testparam = context.getcurrentxmltest().getparameter(test_param); return new object[][]{{ testparam }}; } @test(dataprovider="test1") public void testdata(string data){ //... } does know
test_param? file name, method parameter in testng.xml file?i looked @ javadoc
itestcontext, don't understand howgetparameterwork. single hash map xml file data coming from? or key value pairs xml file data coming from?all want have xml file stored in project , use data xml file. feed dataprovider , run tests. there way this?
can
getparametervalues within testng.xml<test>node or<class>node?
- no idea,
test_paramdoesn't appear in code snippet. - the parameters exposed in
itestcontextones found intestng.xml. - sure, want parse own xml file , return found
object[][].
all explained in details in various sections of the documentation, feel free ask again if have more questions.
Comments
Post a Comment