Menu

Configure jUnit Agent

PREREQUISITES:

  1. Activate Automation Integration
  2. Install and Register the Automation Host
  3. Install the jUnit Plugin

The Agent Configuration pop-up includes 3 steps:

  1. General Information
  2. Test Scripts
  3. Execution

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.

 

Test Scripts

  • Directory: Specify the home directory of your coding project.
    • Example: D:\qTestAutomation\TestingDemo\JUnit_Sample\JUnitHelloWord
  • Scripting libs: Provide the path(s) to the dependencies (files or folders). You can input more than one path, separated by a comma. If all of your jar libraries under a folder, you can simply put its path here.
    • Example: D:\qTestAutomation\TestingDemo\JUnit_Sample\JUnitHelloWord\libs
  • 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 select this checkbox, the agent will also scan files in jar files.

HINT: ANT Style Pattern Matcher uses the following rules:

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

test-script.png

  

Execution

The jUnit Agent supports 3 execution modes to build and run your test projects (Command, Ant, Maven). Based on your selected mode, you will need to provide different information.

Execution w/ 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 the JDK is installed.
    • Example: C:\Program Files\Java\jdk1.7.0_21
  • Command: the command to execute your scripts.
    • Example: In case you are using Java, input java.
  • Command arguments: Target directory where all built outputs are located. Provide any needed arguments.
    • Example: D:\qTestAutomation\TestingDemo\JUnit_Sample\JUnitHelloWord\target\* 

IMPORTANT:

  • While the agent is executing your tests, it is recommended that you do not modify your TestNG XML file. The change may be lost after the execution is done.
  • The agent will use the above information to generate a full command to execute your scripts.

execution.png 

Execution w/ Ant

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

  • Executable home: Input the path where Ant is installed.
    • Example: D:\apache-ant-1.9.2
  • Target: Specify which target will be executed. This is the name of the target which has been defined in your build file.
    • Example: all
  • Build file: Provide the path to your build file in which the above target is defined. ]This file is located under the home directory of your test source code. The above target is defined in this file as the image below.
    • Example: build.xml
  • Command arguments: Provide any additional arguments to execute the target.

IMPORTANT:

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

 

Execution w/ Maven

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

  • Executable home: Input the path to your Maven directory. This is where Maven is located.
    • Example: D:\apache-maven-3.1.0
  • Goal:
    • Example: test
  • POM file: Provide the path to your POM file, which is located under the home directory of your test source code. Please note that this is the relative path under your scripting directory.
    • Example: pom.xml
  • Command arguments: Provide any additional arguments to execute the target.
Subscribe To Our Blog
Powered by Zendesk