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){      //... } 
  1. does know test_param? file name, method parameter in testng.xml file?

  2. i looked @ javadoc itestcontext , don't understand how getparameter work. single hash map xml file data coming from? or key value pairs xml file data coming from?

  3. all want have xml file stored in project , use data xml file. feed dataprovider , run tests. there way this?

  4. can getparameter values within testng.xml <test> node or <class> node?

  1. no idea, test_param doesn't appear in code snippet.
  2. the parameters exposed in itestcontext ones found in testng.xml.
  3. 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

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -