Launchers / Automated tests

Agilitest Launcher (agilitest.jar)

The Agilitest launcher allows running Keyword Driven Tests using the open Source ATS running engine (refer to GitHub.
This is done using TestNG as proposed by Agilitest in its starter guide
The launcher tasks:
  • Scan existing *.ats scripts and test suite file *.xml files created by the Agilitest tool
  • Automatically generate the corresponding test cases in XStudio
  • Manage this as tests, hence include it into a test campaign
  • Recompile all ATS scripts before executing the test - just once at the initialization of a test session
  • Attache the log and resulting TestNG files to the test case results

Configuration

The agilitest.xml file is just a template and must NOT be edited.
It's used by the system to dynamically build the form that the user will be able to fill in from the GUI when creating a custom execution configuration.

Parameter Description
General
Test root path This sets the location where the Agilitest *.ats scripts reside.

Default value is: C:/myatsproject
Additional classpath This sets the location of additional librairies that can be needed for some test

There's no default value
ATS
ATS path This sets the location of ATS components.

Default value is: C:/ATS
Notes:
ATS runner must be installed on you target test execution environment before executing the test
Java install path This must indicate the path to the java install.
Default value is: C:/Program Files/Java/jdk1.10.0_1

These values can be changed while creating the campaign session from XStudio.
Note about file path parameters:
Any parameter referring to a file or folder path (for instance Test root path) can be provided either using \ separator (if the tests are going to be executed on a Windows agent) or / separator (if the tests are going to be executed on a linux or MacOSX agent).

On windows, if you provide a path containing an OS-localizable folder such as C:\Program Files, always prefer the English version (i.e. NOT C:\Programmes if you're using a french-localized Windows) or the corresponding native environment variable (i.e. %PROGRAMFILES%).


Specific test attributes

It is possible to associate attributes to individual test.
This launcher does not make use of any test attributes.

Specific test case parameters (params)

It is possible to associate params to individual test case.
This launcher does not make use of any test case params.

Process

1) The launcher will first recompile all .ats Scripts using the ATS compiler
The launcher uses the following syntax:
<javaInstallPath>/bin/java -classpath "<atsLibrary>;libs/*;target/classes;<additionalClasspath>"
com.ats.generator.Generator -comp

2) The launcher will then run the TestNg interpreter with the following templates:
<javaInstallPath>/bin/java -classpath
"<atsLibrary>;libs/*;target/classes;<additionalClasspath>org.testng.TestNG"


Then XStudio adds:
  • for a test suite: src/exec/<test path><test name>.xml
  • for a test class: -testclass <test path><test name>.class
  • for a test method: -methods <test path><test name>.<test case name>

3) The launcher then parses the specific testng_<a random number> trace file and use it to provide summarized information back to the testers
4) The following files are attached to the results:
  • testng-results.xml
  • emailable-report.html
  • index.html
  • testng_<a random number>



Permissions

WARNING: if you're running your tests on Windows, it may be required to run the tests as administrator.
Having an account with Administrators permissions may even not be enough in some cases (especially if you're using Windows 10) and you may need to disable completely the UAC (User Access Control) on your computer.
To do so:
  • Press the Windows + R key combination
  • Type in regedit
  • Go to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
  • In the right-side pane, look for EnableLUA and set the value 0
  • Close the registry editor
  • Restart your computer

Debug

If your tests are not executed correctly or are reporting only failures, this is very likely because your configuration is incorrect or because you used a wrong naming convention for your tests and test cases.

The best way to quickly find out what's wrong is to look at the traces generated by XStudio (or XAgent).
The traces always include the detailed description of what the launcher performs (command line execution, script execution, API calling etc.) to run a test case. So, if you experiment some problems, the first thing to do is to activate the traces and look at what's happening when you run your tests.

Then, try to execute manually in a cmd box the exact same commands.
This will normally fail the same way.
At this point, you needs to figure out what has to be changed in these commands in order to have them run properly.

When you have something working, compare these commands to what's described in the Process chapter above. This will tell you exactly what you need to change.

Most of the time, this is related to:
  • some incorrect values in some parameters of your configuration,
  • the name of your tests,
  • the name of your test cases,
  • the canonical path of your tests