Skip to main content

Run Functional Scenarios from a TestNG JAR in AIQ

[@DataProvider:

Run MarksFunctional Scenarios from a methodTestNG asJAR supplyingin dataAIQ

Use this guidance for aexisting testTestNG method.class TheJARs annotatedthat methodare muststill returnrequired by an Object[AIQ ][workflow. ],For wherenew eachfunctional Object[automation, ]use cancurrent beScenario assignedEditor patterns unless a Java/TestNG integration is specifically required.

Pre-run checklist

  • Confirm the parameterJAR listwas ofbuilt from the testintended method.Thesource @Testrevision.
  • Verify methodall thatrequired wantsdependencies toare receivepackaged dataor from this DataProvider needs to use a dataProvider name equalsavailable to the nameexecution ofhost.
  • Confirm thisbrowser, annotation.]driver,

    Sample code to read data

    Note: The TestNGParams annotation, is part of Appvance UTP,Java, and itenvironment helpscompatibility.

  • Use approved credentials and test data stored outside the JAR.

Validation steps

  1. Run the JAR in the CI or local maintenance environment.
  2. Execute a small AIQ validation run.
  3. Review output for bindingclasspath, TestNGdriver, withlocator, DPL.and Itdata willerrors.
  4. Document ask to create a interface to support in eclipse("import com.appvance.enterprise.tool.testng.TestNGParams;")

    SQH3AHLoEuIRmAKs-f07dd0cd8012.png
    To use Data Provider in TestNG

    XV1HdlvkpSIAB1Ff-5d225d70e385.png

    Note: Above is a just setup in eclipse to enablewhether the userasset toremains runmaintained 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 whichor should be similar name as Data provider name(Ex; Detail) and also column name should be similarmigrated to the Parameter passed to the class file.

    4yDW4Ty4uW3vhYLw-1301381201f8.png

    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.Editor.

    z9HzodvpSBbV7GVE-ab702e64aa20.png

    Output:


    eEfksrgknsXZt3pe-f9ec5e5dcb37.png

    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.



    Last updated: JuneSeptember 26,8, 20232026

    If you have any feedback on this topic, please contact us at documentation@appvance.ai