Skip to main content

Working with TestNG scripts

UseIn this articlelesson, whenyou will learn how to use TestNG scripts to load test a web application.

About TestNG

TestNG is a testing framework used most often in Unit Testing. For more information about TestNG, visit >http://testng.org/.

TestNG Exercise

    Open Appvance IQ. Click Build. Click Scenario Editor. Select File > New. The Scenario Test Type is Unit Test.

    Select Test Management.

    The scenario test cases are specified to repeat 1 time.

    Select Test Cases.

      From theTest Casestab, clickAdd a Test Case Execution.
      Enter a name for the test case in theTest Case Namebox.
      Enter a name for the script needsin theScript Namebox. Click theScript Typebox and selectTestNG.

      5. Click Browse(to the right of the Resource box)
      The Open window appears

      The Script Type is set to be prepared, packaged,TestNG, and executed from AIQ.

      Validation workflow

      1. Build the TestNGtest projectcase and confirm testng.xmlResource points to the intendedJAR classesfile andlocated parameters.
      2. Package dependencies soin the AIQrespective TestNG directory.
         A class from within the jar file (packagename.classname) is specified.
         As the test is data enabled, a data connection, described later in this exercise in more detail, is specified, as well as how to use the data (Get Next Row of Data).
        1. Click Cancel.
        Select Resources.

        All resources related to the Scenario are summarized, including the test case specified in Test Cases. Most notably, the Data Sources contains a connection to data, used in the TestNG test case, using a query to a SQL database.

          Click Play Scenario to execute the scenario. The Scenario loads in a new browser tab. As the scenario executes, details pertaining to the execution nodedisplay canin resolveLive them.Reports. RunOnce the execution completes, indicating a smallstatus AIQof executionExecution andDone, compareselect failuresTest withcase Executions. Select individual executions listed to view additional detail pertaining to the localsuccess TestNGor output.failure of the execution.

          Last updated: SeptemberAugust 29,02, 20262023

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