Reading file from xml.
<!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
<suite name="paramerProgram">
<test name="newParamer">
<parameter name="name" value="Yogendrasingh"/>
<parameter name="Sirname" value="Thakur"/>
<parameter name="Age" value="35"/>
<classes>
<class name="NewProgram.ParaPass"/>
</classes>
</test>
</suite>
Java file
public class ParaPass {
@Test
@Parameters({"name","Sirname","Age"})
public void test(String name, String lastname, int age)
{
System.out.println(name);
System.out.println(lastname);
System.out.println(age);
}
}
Output-
No comments:
Post a Comment