Running tests with the command-line adapter using local resources

With the command-line adapter, you can use a target test machine for running command-line jobs. After the adapter is registered, you can run scripts by using the command-line execution adapter on the target test machine. Use a command-line adapter if an adapter for your target tests is not available.

Before you begin

  1. Start the command-line adapter on the test target machine and have at least one test machine application on the target test machine.
  2. Make sure that the Quality Management application is running on the server.

About this task

On the tester machine, a test case with a command-line test script is created and run. The test produces a Test Execution Result, which contains the standard out and standard error of the executed command.

Tip: You can consolidate the log information for out and error files into a single output file by using the -redirectError true option. You can view the output file in the Result Details section of a test case.
Command-Line Execution use
Note: You can write a shell script to be your test on the adapter. More information can be found in Creating a job that uses the command-line adapter to test an application-under-test.

You can provide values for custom attributes of test case results from the command line. For example, if Voltage is a custom attribute for test case result, you can provide a value of 5 volts for that attribute by adding the following line to the command-line test script:

echo Voltage=5 V>> %qm_CustomAttributesFile%

If a custom attribute with the specified name does not exist in the Quality Management application, a new custom attribute is not created.

For Date type custom attributes, supported formats are:


	"yyyy-MM-dd'T'HH:mm:ss.SSS'Z'", 
		"yyyy-MM-dd'T'HH:mm:ss.SSSZ", 
		"yyyy-MM-dd'T'HH:mm:ss.SSSz",
		"yyyy-MM-dd'T'HH:mm:ss'Z'", 
		"yyyy-MM-dd'T'HH:mm:ssz",		
		"yyyy-MM-dd", 
		"yyyy-MM", 
		"yyyy"

The supported date format is XML dateTime. For details, see W3C recommendations.

Procedure

  1. In the main menu, click Construction > Create > Test Script.
    1. Enter a name for this script.
    2. Select the Command Line script type.
    3. Select Use test resources that are local to a test machine.
    4. Click Select adapter and select the adapter name that was used when the adapter was started on the target test machine (for example, myAdapter).
    5. Click Next.
    6. In the Project Path field, enter the path to the directory that contains the application-under-test job on the test target machine.
      For example, enter. c:\cmd-line-scripts.
    7. Click Go.
    8. Select the executable file or script from the list and click Finish.
    9. Click Save to save this test script.
  2. In the main menu, click Construction > Create > Test Case.
    1. Enter a name for this test case.
    2. Click the Test Scripts section of the test case.
    3. Click the Add existing test scripts icon.
    4. Select the application-under-test job to run on the adapter, and click OK.
    5. Click Save to save the test case.
  3. Run the test case by clicking Execution > Browse > Test Cases.
    1. Select the test case and click the Run Test Case icon.
    2. Use the default settings, and click OK.
    3. Run a test script.
    4. Click Show result.
    5. Review the execution results.
    6. Repeat these steps for each test script.
    Tip: The status messages that the command-line adapter sends during test execution are displayed on the "Execution progress" page of the Quality Management application, in the Status section.