Passing parameter from Xml




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

Software Testing Automation Guide

  get methods in Selenium Webdriver Below are the list of get methods that can be use with driver. Get()- This com...