Categories

Executions management - TestNG

It is possible to use a Java compiled execution mode outside the specific execution and editing mode of the Agilitest editor. This Java compiled execution mode is faster and intended to be used for a test or a group of tests in a project.

This construction mode can be found on the Executions management page.

Manage project executions

Access to executions management is via the project explorer.

Click on the menu then select "Executions management".

executions management

Agilitest will open a tab with different parts:

executions management page
  • Project Builder (1): Allows you to configure, generate, execute and optionally produce and open reports corresponding to executions.
  • Command lines (2): You can use the command line to launch ATS execution from a Windows command. This command must be exectued at the root of the ATS project. You can copy these elements into a .bat or .ps1 file to launch all the executions you have configured without going through Agilitest.
  • Executions (3): This is the menu for configuring TestNG runs, their variables and scripts.

What is a TestNG execution

All ATS executions designed by Agilitest are executed under Java. TestNG is a framework that has been created to enable these tests to be executed in Java.

TestNG executions, also known as "Suites ", are executions created in Agilitest from a set of scripts and parameters. These executions can be executed by Agilitest, but they are also exportable to TestNG-compatible environments that can replay the tests without requiring complex configurations, such as Jenkins and its Jobs.

How to create an execution

An execution corresponds to the definition of a sub-set of project tests, i.e. scripts, which you can replay in a single execution.

To define an execution, click on the "Add" button in the executions tab.

add button

As mentioned above, a Suite must be made up of several scripts.

To add scripts, select your Suite then click on "Import scripts" in the dedicated box.

import scripts button

You can also drag and drop scripts from the project explorer.

Select packages

The "Packages" tab shows all the directories in your project and lets you define, for each directory, whether the ATS files it contains should be included or excluded from the selection.

Indicate which directories are to be used to retrieve scripts, and which are not.

add packages page

Files do not need to have been added to the script tab.

Execution parameters

Once your execution has been created, you can assign it execution parameters which affect the level of detail of the reports generated.

To configure these parameters, click on the blue "Pencil" on your execution's line.

pencil button

A set of options lets you define the quality of the reports produced when the execution is launched:

Logs level

logs level

The different logs level are as follows:

  • Silent
  • Error
  • Info
  • Warning
  • All

They are sorted from less detailed to more detailed.

Generate reports

Tick the “Generate reports” to generate them at the end of the execution.

enable reports

  • Visual report

For the visual report, you'll need to specify the quality of the ATSV video reports you are going to generate.

The different options are:

visual report
  • Size: To optimize ATSV file size
  • Speed: To optimize the execution speed of the test
  • Quality: To optimize the quality of images
  • Max quality: To optimize the quality of images at the maximum

  • XML report

A report in XML format can be generated and worked with a BI solution (Jasper, Talend, etc…) .

Executions variables

Executions variables are variables that you define in the executions management menu and which will appear as environment variables in all tests belonging to the same project.

executions variables

You will find the environment variables in the special values menu.

envionment variable

Or with the command: $env(<Valeur_Variable>)

envionment variable in an action

Environment variables allow you to manage different execution environments, all of which use the same test base.

Environment variables can be overridden during the execution, either on the command line, or with the system used to launch the executions (Jenkins, GITLAB CI, AzurDevops).

Groups selection

Test groups allow you to filter the scripts you execute according to the groups they are associated with.

The groups management tab which is accessible from the project explorer lets you create, manage and delete groups.

groups management button

Each project has its own group management and each execution suite has its own filter configuration.

There are two ways of filtering with groups:

  • By including: All scripts belonging to this group are executed.
  • By Excluding: All scripts are executed except those belonging to a selected group.

Launch an execution with Agilitest

Once your execution has been created, make sure it's selected, as indicated by the tick on your Suite line.

suite selected

You can also select several Suites to be executed one after the other.

Multiple Suites can also be executed using Job Jenkins.

To launch the execution of your Suite, you need to follow the steps below, in order:

launching an execution
  1. Generate: This generates the java files corresponding to the selected ATS tests.
  2. Compile: This compiles the java files corresponding to the selected ATS tests.
  3. Run: Agilitest will open a console and replay all the tests selected in the run.

There are two optional options to add before launching your Suite execution (step 3):

executions parameter
  • Open failed scripts: At the end of your execution, this will open any scripts that were not successful.
  • Generate reports: At the end of your execution, your Suite report will be generated, and can also be opened if you check the following option. You can choose *Report level of detail once this option has been ticked.

💡 Tip

This console should only be used for "quick" script verification in Agilitest. For longer script launches, it's better to use a Windows terminal or the "CMD" shortcut you can create in the executions management tab.

shortcut button

Still require support?
Contact support