3 - User guide

Before using this guide, please be sure your Squash TM project is properly configured. For more information, refer to the Squash TM configuration guide (2.2 - Configuring TM)

This guide will explain :

- how to create an automated test in Squash TM (link a Squash TA script to a Squash TM test case).

- how to run automated test from Squash TM

- how to acces the result from the automated tests

  • Create an automated test

  1. Click on the Test Cases Workspace (on the left side).

  2. Select a project.

    1. Select a test case.

  1. Click on Click to edit...

    1. Associate the TA script to the test case. You can type the name of the script (/TM_JOB_NAME/Path_to_the_script) or use the [Pick...] button.

      1. The TM_JOB_NAME will be checked, but the path_to_the_script won't. To be safe use the Pick...button.

  1. Click [Confirm].

  • Run automated test

  1. Click on the Campaign Workspace (on the left side).

    1. Run the test using one of the button on the screen below :

    1. If your server configuration allow you to choose on which server your test are run you'll have to chose a server for each Squash TM job. And [Confirm]. If you can't choose your server, go to next step.

    1. A Overview of automated test executions popup will show up. Wait untill all your job are finished.

    1. Once all jobs are finished, all the status will be updated and the progress bar will be full. You can [Close] the popup.

    1. Click on the test case name to show all executions of your test.

    2. Click on your Execution to have details.

    1. You can also acces the Job with the job URL link

    1. You can see the status (Squash TM status), Automated test status (Squash TA status) and acces to the Squash TA report via the result URL.

  • Variable transmission between Squash-TM and Squash-TA

A new feature is available since Squash TA framework version 1.8.0 and Squash TM version 1.10.0 : variable transmission between TM and TA. The custom fields created in TM are sent to TA (when you create a custom field, choose « Plain text » for input type).

The variables transmitted to TM are test case custom field(s), test campaign custom field(s) and iteration custom field(s) and the test case reference.

Transmitted variables :

Example for variable transmission in test case :

    • First, you should create the test case custom fields in Squash TM, and link them to your TM project :

          • Detail of custom field test case on TM :

                • Name : yourCustomFieldName

                  • Label : yourCustomFieldLabel

                • Code : property1

                  • Input type : « Plain text »

                  • Default value : value1

    • During a TM campaign, when TM asks to TA Server to execute an automated test, TM sends data to TA server through json format :

json data send to TA

{

'test' : [{

'id' : '1', // Test execution identifier

'script' : 'pathTomyScript', // Path to the test script to execute

'param' : { // Script parameters

'TC_REFENCE' : 'REF1', //Test case reference

'TC_CUF_property1' : 'value1' //custom field for test case

}

}

]

}

  • On TA side, the retrieved variables (param part of the json file) are saved in a TA properties file. This file is a simple list of key / value, available from any TA script under the name : context_script_params. The file to file using param converter may be used to replace placeholders in other TA resources. (Note that if you create in your TA script a TA resource which context name is also context_script_params, this one will override the TA resource containing TM data). Below is a sample of TA script where TA will replace the ${TC_CUF_property1} in the xmlDataset.xml by the value given by TM:

TA script exemple

LOAD params/xmlDataset.xml AS placeHolderDataset.file

CONVERT placeHolderDataset.file TO file(param) USING context_script_params AS processedPlaceHolderDataset.file

VERIFY processedPlaceHolderDataset.file DOES contain WITH $(value1="success")

  • Below the xml file ( TA resource ) in whick the key will be search and replace by its value :

xmlDataset script

<?xml version="1.0" encoding="UTF-8"?>

<dataset>

<test ${TC_CUF_property1}="success"/>

</dataset>