Quick start guide


This is a work in progress. For full documentation, please see the distribution zip file contents.

Introduction

This tool was developed specifically for testing products running across a wide variety of hardware and software platforms. Since it is completely written in Java, any machine capable of supporting a Java Virtual Machine (JVM) can be used.
The QAT tool can be divided into two main sections, the Agent, responsible for actually running each test or group of tests, and the Harness, which is responsible for test selection, management, result and agent co-ordination. All that is required to run a test on a given machine, is an Agent running in a compatible JVM.

This document covers the following areas
 

System Requirements

The Agent portion of the QAT tool will run on any JVM supporting Java Specification 1.1.x or later. If you cannot run this version of the JVM, you may compile a binary version of the agent from the sources, for your particular platform. It is currently written as a POSIX compliant bundle of C++ classes, and has been validated on Chorus and Solaris.
Since the result reporting functions of the Agent are file based, a file system is mandatory.
The Harness requires at least Java 2, and is currently maintained on JDK1.3 FCS.

Since the harness is a GUI application, some X-window or Window server is required, unless you choose to use only the command line interface to the harness.
Whether the harness runs on NT or Solaris or any other platform (or all of them) depends on how portably the tests are written.
 

Environment settings

Ensure the jar file qat.jar is visible via the CLASSPATH environment variable (setenv CLASSPATH ./qat.jar ), or directly upon invoking the JVM via the "-classpath" option.
 
e.g.
java -classpath ./qat.jar ClassName
or
setenv CLASSPATH /home/user/qat.jar
java <ClassName>
If you are using Windows and have installed Java 1.2, you can double click the qat.jar file to directly launch the QAT GUI interface, or via commandline using
the form : java -jar qat.jar

Starting an Agent

You can start an agent by typing
java Agent port number> [debug level]

where

port number = the port which will be used for communicating / transferring files to and from the harness
debug level = the debug level (0..10) to control which, if any, messages are sent to the stdout and stderr streams of the Agent (default value is 0)
Any temporary or other such files created by the agent will be placed in the directory {user.home}/.qat/agent.
Repeat this process for as many machines and agents as you require. An example of a started agent is shown here:

images/figure5.png

To kill the agent, simply type Control-C in the terminal window to send a KILL signal to the JVM.

Note: Each agent requires a unique port number, but one or all of the agents may be run on the same machine as the harness.
Each agent, however, has to be run in a separate JVM.
Furthermore, one agent may be used by as many harnesses as required, so instead of two separate agents, you may configure your test to use the same agent.
In this case, be sure to ensure each agent uses a unique temporary directory to store it's files, by making use of the RANDOM script command when you call  SETAGENT to prevent agents messing with each others files.
No windowing system is required by the agent.

Starting the QAT Harness

You can start the GUI harness by typing
java QAT [language]
The language option currently only supports French (-FR) and Afrikaans (-AF), and if omitted, defaults to English.
If this is the first time you are running the tool, you will get some warnings that previous settings file have not been found, but you may ignore them, they will be created for you. (default.prj and default.ser). Each time you exit and restart the Harness, your previous project settings will be restored from these files.
In addition, screen size and placement of the QAT gui will be saved in the session.properties file.
These settings are stored in the {user.home}/.qat/harness directory.

You will now see the screen displayed in Figure 1.
 
 
images/figure1.png
Figure 1


 
 

Let's use the example tests provided with this tool in the examples directory, and set up some tests to run on Solaris and NT.
There are three steps to set up the harness to run the examples.
 

1)Define our agents.

From the system menu, select Edit -> Agent Settings.
This will display the window displayed in Figure 2, with which you can graphically configure your agents.
Initially there are obviously none, so select the "Add agent" option, and fill in the machine name and port number. The port number is the same value you used when starting the agent as outlined in the above section Starting an Agent.
If the agent is currently running, you can click on the "Detect" button to automatically fill in the "Architecture" and "Operating System" fields.
The "Agent number" is used within your test scripts to differentiate between the different agents.
Any agents defined  here are accessible in the .qash files as agent1.name,agent2.port etc. This will be covered in more detail later.
 
images/figure2.png
Figure 2

2)Define project settings

Now we have our agents defined, we need to set up our project for the first time.
From the system menu, select Edit -> Edit Project to bring up the Project settings window.
You will see a blank text area - this is where you define specific properties for your test suite.
 

Ensure the following two properties are defined and correct for your particular system :

JAVAHOME_SOLARIS=/usr/java1.2
JAVAHOME_NT=c:\jdk1.2.1

So your project properties should look something like Figure 3 :
 
images/figure3.png
Figure 3

3)Select test directory

Next, we tell the harness where to look for the .qash files which constitute our test suite.
Click on the tab "Project Settings" (see Figure 3), and you will see an entry for selecting the test directory path. Ensure this points to the {qat_home}/examples directory, and then click the OK button to start loading the tests. You can also tweak various other settings here, such as Look and Feel, custom plugins and parsers, but for the moment we just need to point to the examples.

Once selected, choose OK to load all the tests in the selected examples directory :

images/figure3a.png

You should now see a tree structure similar to Figure 4 :
 
images/figure4.png
Figure 4

Running the tests

Your harness should now be ready to run the example tests, so you may now either right click on the test you wish to run, or use the system menu to start a test run.
The test(s) should run without any problems. If for some reason there are errors, consult the console traces (by clicking on the "ParserOutput Viewer" tab of the main window) to see what went wrong. For this reason it is recommended you start your agents with a debug level of 9 until you are sure your settings are all correct.
Exiting the Harness will save all you current settings, and they will be resumed on your next setting.

To change which agents to use, simply edit the relevant agents from the system menu "Edit"->"Edit agents" until you have the configuration you want.
In this way you can build up different test scenarios using the project Save As option.

For more details on how to use the GUI interface, you should now be ready for the QAT Harness Manual.
If you are ready to write your own tests, you can go directly to the QASH Syntax page.
 
 

Connecting to a running instance of QAT via a web browser

It is possible to use a standard web browser to connect to a running instance of the QAT harness, by pointing your browser to
http://localhost:9080 . You may change the port used by the Http server by editing the project properties.
This interface gives a limited access to functions of the QAT tool, such as starting/stopping tests, as well as viewing live test results.
 

Configuring GUI project properties

You can configure project properties to appears as GUI components in the Edit Project Properties window by assigning them with special name prefixes. Currently you can make use of TextField, ComboBox and CheckBox components.
The following conventions are used :
This will produce a CheckBox called Example1 with default value of unchecked. The tooltip text will be set to the complete variable name.
qat.project.guiproperty.checkbox.Example1=false  images/guip1.png

 
 

This will produce a TextField called Example2 with text containing "Hello World". The tooltip text will be set to the complete variable name.

qat.project.guiproperty.textfield.Example2=Hello World images/guip3.png

 
 
 

This will produce a ComboBox called Example3 with selected item "a", and possible values of "a" through "g". The tooltip text will be set to the complete variable name.

qat.project.guiproperty.combobox.Example3=a
qat.project.guiproperty.combobox.Example3.values=a,b,c,d,e,f,g images/guip2.png
If any GUI properties are detected in the project properties, or added by editing the project properties, the next time the project properties window is displayed, a new tab will appear displaying by default these properties as GUI components.
If the OK button is selected, the value of the GUI components is accepted as the required value, however if the text version tab is currently being displayed, the text version of the properties (which are still displayed) will be taken and will override any GUI properties.

Running tests via the command line interface

There are two ways to launch tests via the command line interface.
The first way uses the QAT gui, but doesn't actually display it, and drives the test run according the parameters specified on the commandline. This method allows more detailed control over test selection, and allows the test run to be archived into html reoprts.
The second method is to launch each test by invoking the QASHParser directly.

Method 1(Recommended) :

java -classpath {qat.jar} QAT -cmdline -project {projectFileName} [-reportdir {reportDirectory}] [-rescan] [+keyword keyword1] [-keyword keyword2]

-cmdline - indicates we want to launch the harness in commandline mode only
-project {projectFileName} - mandatory parameter specifying the full path to a QAT project file for the specified test run
-reportdir {reportDirectory} - optional parameter which is the full path to the directory in which to store the generated html report of the test run. The directory must already exist. If this parameter is omitted, no report will be generated.
-rescan - optional parameter, if specified, the QAT will perform a complete rescan off disk in case new tests have been added since the project was last parsed.
+keyword {keyword} - all tests containing this keyword will be selected for the test run
-keyword {keyword} - all tests containing this keyword will be excluded for the test run
The [(+/-)keyword] parameter may be repeated several times. If no +keyword or -keyword is found, all tests in the project will be run.

Method 2:

java QASHParser sessionName propertiesFile test1Path test2Path .... testNPath
sessionName - the number of this run, which will be used to store the results retrieved from the agents under the correct offset in the QAT home directory
propertiesFile - a properties file containing all the variables required to parse the tests to be run. You may pass the name of a previously saved project file if you don't want to reconfigure one by hand.
testXPath - this is the full path to each QASH file to be run.
The exit code will be zero if no errors occurred, or non-zero if one or more errors occurred.
SourceForge.net Logo