The “Parameterized Test” means vary parameter value for unit test. XML file or “@DataProvider” is use to provide vary parameter for testNG unit testing
XML file for parameterized test.
Only “@Parameters” declares in method which needs parameter for testing, the parametric data will provide in TestNG’s XML configuration files. By doing this, we can reuse a single test case with different data sets and even get different results. In addition, even end user, QA or QE can provide their own data in XML file for testing.
1 2 3 4 5 6 | import org.testng.annotations.*; |
name="My test suite">
name="testing">
name="number" value="2"/>
>
name="TestNGTest6_1_0" />
>
>
>
Result
Parameterized Number is : 2
No comments:
Post a Comment