To pass the values into the parameters in TestNG, we use <parameter> tag in the TestNG XML file. Additionally, it contains two attributes:
name: the name of the parameter variable.
value: the value to insert in that variable.
Observe the following XML file denoting the same concept.
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="My Test-Suite" >
<test name="QA" >
<parameter name="val1" value="1" />
<parameter name="val2" value="2" />
<classes>
<class name="testNGPackage.Parameter" />
<class name="testNGPackage.Multiple_Parameters" />
</classes>
</test>
</suite>
<!DOCTYPE suite SYSTEM "https://testng.org/testng-1.0.dtd" >
<suite name="My Test-Suite" >
<test name="QA" >
<parameter name="val1" value="1" />
<parameter name="val2" value="2" />
<classes>
<class name="testNGPackage.Parameter" />
<class name="testNGPackage.Multiple_Parameters" />
</classes>
</test>
</suite>