How to use TestNG class jar file to run Functional scenario in Appvance IQ

[@DataProvider: Marks a method as supplying data for a test method. The annotated method must return an Object[ ][ ], where each Object[ ] can be assigned the parameter list of the test method.The @Test method that wants to receive data from this DataProvider needs to use a dataProvider name equals to the name of this annotation.]

Sample code to read data

Note: The TestNGParams annotation, is part of Appvance UTP, and it helps for binding TestNG with DPL. It will ask to create a interface to support in eclipse("import com.appvance.enterprise.tool.testng.TestNGParams;")


To use Data Provider in TestNG

Note: Above is a just setup in eclipse to enable the user to run the CSV based scenario in Appvance IQ, but we cannot execute the above setup in eclipse as it is for the csv file.(If User want read the data from csv file in eclipse, they need a separate code).IQ.-Now create a Jar file for above TestNG class file to run script in Appvance.(Eclipse-->Project-->RightClick-->Export→Java→Jar).

How to use TestNG class jar file to run Functional scenario in Appvance IQ:

Prerequisite: Create a CSV file which should be similar name as Data provider name(Ex; Detail) and also column name should be similar to the Parameter passed to the class file.

  1. Launch Appvance IQ and click Appvance Scenario Builder from start screen.
  2. Select a Functional Test Test Type in Appvance Scenario Builder.
  3. Navigate to resources panel, click Data resources and Provide the similar name as Data provider Name
  4. Create a Scenario for TestNG by selecting TestNG test type under Test case panel.
  5. Browse and add Jar file that contains TestNG code
  6. Enter the TestNG class name as "packagename.classname".
  7. Click Add DPL and Select the DPL from Dropdown and Provide the Name as similar to Dataprovider Name
  8. Save the Scenario and click Play button.

Output:


For Example, refer the attached TestNG_DPL_Working file that contains:
1) Jar file(Used to create scenario in Appvance).
2) Scenario which is already created by using above Jar file.
3) CSV file.