Category:
TestNG
Using @Parameter annotation and ‘parameter’ tag in testng.xml we can pass parameters to test scripts.
Sample testng.xml –
Sample test script
public class TestFile {
@Test
@Parameters(“sampleParamName”)
public void parameterTest(String paramValue) {
System.out.println(“Value of sampleParamName is – ” + sampleParamName); }