6.3.2 Configuring an Agent with JUnit

The Agent Configuration pop-up inludes 3 blocks:

  1. General Information
  2. Test Scripts
  3. Execution

A. General Information

  • Agent name: Define the agent's name. It is also the displayed name of the agent in qTest.
  • qTest project: It lists out all qTest projects which are accessible using the agent's credentials. Select one of the projects in your qTest application. An agent can work with only one qTest project.
  • Automation framework: The frameworks whose plugins have been installed will be listed out. Select your desired framework.

 

B. Test Scripts

  • Directory: Specify the home directory of your coding project.
  • Scripting libs: Provide the paths to the dependencies (files or folders). You can input more than one paths, separated by a comma.
  • Include: You can use ANT Style Pattern Matcher to define the patterns of files which will be scan for tests. Use comma as separators between the patterns. It is the required information so that the agent can scan your coding directory for tests and automatically create Test Cases in qTest.
  • Exclude: You can optionally define patterns to excludes files from the scanning.
  • Scan jar files: If you stick on this checkbox, the agent will also scan files in jar files.

button-round-warning-icon.pngHINT: ANT Style Pattern Matcher uses the following rules

  • ? matches one character.
  • * matches zero or more characters.
  • ** matches zero or more 'directories' in a path.

 

Field Value Description
Directory D:\qTestAutomation\TestingDemo\JUnit_Sample\JUnitHelloWord This is the home directory of my TestNG source code.
Scripting libs D:\qTestAutomation\TestingDemo\JUnit_Sample\JUnitHelloWord\libs Since I put all my jar libraries under this folder, I simply put its path to this field.

C. Execution

Currently, the Automation Agents support 3 modes to build and run your test projects. Based on your selected mode, you will need to provide different information.

1. Command

  • Executable home: Specify the path to the home directory of your program development environment. For example, if you are using JDK, input the folder where you have installed it (eg: C:\Program Files\Java\jdk1.7.0_21)
  • Command: the command to execute your scripts. In case you are using Java, input java.
  • Command arguments: You will need to provide the target directory where all built output are located. Provide any needed arguments.

Important_icon.pngImportant:

  • While the agent is executing your tests, it is recommended that you do not modify your TestNG XML file. The change may lost after the execution is done.

The agent will use the above information to generate a full command to execute your scripts.

 

Field Value Description
Executable home C:\Program Files\Java\jdk1.7.0_21 This is where I installed my JDK.
Command java  
Command arguments D:\qTestAutomation\TestingDemo\JUnit_Sample\JUnitHelloWord\* This is the directory where all built output are located.

2. Ant

The automation agents support using Ant to build and run your coding projects.

  • Executable home: Input the path your Ant directory.
  • Target: Specify which target will be executed. This is the name of the target which has been define in your build file.
  • Build file: Provide the path to your build file in which the above target is defined. Please be noted that this is the relative path under your scripting directory.
  • Command arguments: Provide any additional arguments to execute the target.

Important_icon.pngImportant:

  • While the agent is executing your tests, it is recommended that you do not modify your TestNG XML file. The change may lost after the execution is done.

 

Field Value Description
Executable home D:\apache-ant-1.9.2 This is where my ant is located.
Target All  
Build file build.xml This file is located under the home directory of my test source code. The above target is defined in this file as the image below.

3. Maven

The automation agents support using Maven to build and run your coding projects.

  • Executable home: Input the path to your Maven directory.
  • Goal:
  • POM file: Provide the path to your POM file. Please be noted that this is the relative path under your scripting directory.
  • Command arguments: Provide any additional arguments to execute the target.

Field Value Description
Executable home D:\apache-maven-3.1.0 This is where my ant is located.
Goal test  
POM file pom.xml This file is located under the home directory of my test source code.