O'Reilly logo

TestNg Beginner's Guide by Varun Menon

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action – parameterization through testng.xml

  1. Open Eclipse and create simple Java project with the following package structure. Make sure that you have added TestNG library to the project build path.
    Time for action – parameterization through testng.xml
  2. Add a new Java class file with the name ParameterTest and copy the following code to it:
    package test.parameter; import org.testng.annotations.Parameters; import org.testng.annotations.Test; public class ParameterTest { /** * Following method takes one parameter as input. Value of the * said parameter is defined at suite level. */ @Parameters({ "suite-param" }) @Test public void prameterTestOne(String param) { System.out.println("Test one suite ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required