Configuring test scripts in Micro Focus ALM

You must configure the test script that you created in Micro Focus Application Lifecycle Management (ALM) to run the performance test assets.

Before you begin

You must have performed the following tasks:

About this task

You can navigate to alm directory to copy the content of the template file. The alm directory resides within the installation directory of Test Performance. The name of the template file is PT_ALM_Windows.txt and you can access the file from the following location:

Installation_dir\HCL\DevOpsTest\alm

For example, C:\Program Files\HCL\DevOpsTest\alm

You must provide the values for certain parameters in the test script to run tests from Micro Focus ALM. The minimum parameters that you need to configure are, Workspace, Project, and TestsuiteName or ConfigFile. The remaining parameters are optional.

For example, if you provide a complete path of a configuration file that contains the parameters for a test or schedule run in the Config File parameter, then you need not be required to provide values for the Workspace, Project, and TestsuiteName parameters.
Note: If Test Performance is not installed in default location, then you must provide the value for the IMSharedLocation parameter along with other mandatory parameters.
Remember: You must enter the parameter values within the double quotation marks.

Procedure

  1. Log in to the Micro Focus ALM portal, if you are not already logged in.
    The Micro Focus ALM dashboard is displayed.
  2. Expand Testing from the left pane, and then click Test Plan.
  3. Select a test script from the folder that you want to configure.
  4. Click the Test Script tab.
  5. Paste the content of the PT_ALM_Windows.txt file that you copied in the space provided in the Test Script tab.
  6. Enter the parameter values that are required for your test run in the script by referring to the following table:

    The following table lists the required parameters that you must provide to run the test from Micro Focus ALM:

    Parameters Description
    ConfigFile

    Enter the complete path to a configuration file that contains the parameters for a test or schedule run.

    For example,
    ConfigFile = "C:\Users\HCL\devopstest\workspace\Project1\config.txt"

    For more information about creating a command line config file from Test Performance, see the Related information section.

    Project

    Enter the name of the project that has performance test assets.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    TestsuiteName

    Enter the name of the test asset that you want to run.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    Workspace

    Enter the complete path of the Eclipse workspace.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"

    The following table lists the optional parameters that you can provide to run the test from Micro Focus ALM:

    Parameters Descriptions
    DatasetOverride

    Use this parameter to replace the dataset values during a test or schedule run.

    You must ensure that both original and new datasets are in the same workspace and have the same column names. When you enter a value for the Dataset Override field, you must also include the path to the dataset. You must provide the values for the Dataset Override field in the following format:

    /project_name/ds_path/original_ds.csv:/project_name/ds_path/new_ds.csv

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    DatasetOverride = "/project_name/ds_path/ds_filename.csv:/project_name/ds_path/new_ds_filename.csv"

    You can override multiple datasets that are saved in a different project by adding multiple paths to the dataset separated by a semicolon. For a test or schedule, the default value is the dataset specified in the test editor or schedule editor.

    Duration

    Use this parameter to change the duration of the stages in the rate schedule.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Schedule/ratesch.testsuite"
    Duration = "Stage1=10s, Stage2=3m"

    The stage number specified must exist in the rate schedule.

    Note: The Duration parameter creates a new copy of the rate schedule that contains the specified number of duration.
    Exportlog

    Use this parameter to specify the path of the file directory to store the exported HTTP test log in a .txt format.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    Exportlog = "C:\Users\Documents\1023\ALM\LogExp.txt"
    ExportStatReportlist

    Use this parameter to specify IDs of reports that you want to export in place of the default reports.

    You can provide multiple report IDs separated by a comma. You can navigate to Preferences of Test Performance (Window > Preferences > Test > Performance Test Reports > Export Reports), and then select Show Report IDs checkbox to view the report IDs.

    You must use the ExportStatReportlist parameter along with the ExportStatsFile or ExportStatsHtml parameter.

    For example, to export a Performance Report, you can provide the value for the ExportStatReportlist parameter as follows:
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    ExportStatsFile = "C:\Users\Documents\ALM"
    ExportStatReportlist = "http"
    ExportStatsFile

    Use this parameter to provide the complete path to a directory that you can use to store the exported report in a comma-separated values (CSV) format.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    ExportStatsFile = "C:\Users\Documents\ALM"
    Note: If you do not specify a value for the ExportStatReportlist parameter, then the reports that you selected in Preferences of Test Performance (Window > Preferences > Test > Performance Test Reports > Export Reports) are exported.
    Exportstatsformat

    Use this parameter to specify a format for the result that you want to export along with the ExportStatsFile parameter.

    You must use at least one of the following options with the Exportstatsformat parameter:
    • simple.csv
    • full.csv
    • simple.json
    • full.json
    • csv
    • json
    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    ExportStatsFile = "C:\Users\Documents\ALM"
    Exportstatsformat = "simple.json"

    You can add multiple options separated by a comma.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    ExportStatsFile = "C:\Users\Documents\ALM"
    Exportstatsformat = "simple.json,full.csv"

    When you want to export both simple and full type of test results in a json or csv format, you can specify either json or csv as options.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    ExportStatsFile = "C:\Users\Documents\ALM"
    Exportstatsformat = "json"
    When the test run completes, the test result exports to simple.json and full.json files.
    Note: The values provided in the test script always take precedence over the Export Reports options set in the Preferences of Test Performance (Window > Preferences > Test > Performance Test Reports > Export Reports).
    ExportStatsHtml

    Use this parameter to provide the complete path to a directory that you can use to export web analytic results.

    The results are exported to the specified directory. You can analyze the results on a web browser without using Test Performance.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    ExportStatsHtml = "C:/Users/Documents/Reports"
    IMSharedLocation

    Use this parameter to enter the complete path to the HCLIMShared location, if it is not in the default location.

    The default location of IBMIMShared is C:\Program Files\HCL\HCLIMShared.

    For example,
    Workspace = "C:\Users\HCL\hclonetest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    IMSharedLocation = "D:\Testtool\HCL\DevOpsTest"
    Labels

    Use this parameter to add labels to test results when the test run is complete.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    Labels = "label1, label2"

    You can add multiple labels to a test result separated by a comma. When you run test assets, then the labels that you added are displayed on the Performance Report in Test Performance.

    The Results page of Test Hub displays the label that you added in the Labels field for the specific test asset in the following conditions:
    • When you set Publish result after execution as Always or Prompt in the Preferences of Test Performance (Windows > Preferences > Test > DevOps Test Hub).

    • When you use the Labels field along with the Publish field.

    Note: When you run tests by using the double quotation marks ("") for the Labels parameter, then the labels in the test result do not include double quotation marks.

    For example, if you provide the value for the Labels parameter as "100" users, then the labels display 100 users in the test result.

    To work around this problem, you must create a command-line config file, and then run the test by using the ConfigFile parameter.

    OverwriteResultsFile Set this parameter value to true or false to determine whether a result file with the same name must be overwritten or not.

    The default value is true.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    OverwriteResultsFile ="false"
    Publish

    Use this parameter to publish test results to Test Hub from Micro Focus ALM.

    You must provide the offline user token in the Preferences of Test Performance (Window > Preferences > Test > HCL DevOps Test Hub) before you use the Publish parameter in the test script.

    You must use one of the following values in the Publish parameter:
    • serverURL#project.name=name_of_the_project&teamspace.name=name_of_the _teamspace

    • serverURL#project.name=name_of_the_project&teamspace.alias=name_of_the _teamspace_alias

    • no

      The no option is useful if the product preferences are set to publish the results, but you do not want to publish them.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    Publish = "URL_OF_DevOpsTest_Hub#project.name=test&teamspace.name=ts1"
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    Publish = "no"
    Where:
    • URL_OF_Test Hub is the URL of Test Hub.

    • test is the name of the project in Test Hub.

    • ts1 is the name of the team space.

    Notes:
    • If you have a project with the same name in different team spaces, then you must append either the &teamspace.name=name_of_the _teamspace or &teamspace.alias=name_of_the_teamspace_alias options.

    • If the name of the project or team space contains a special character, then you must replace it with %<Hexvalue_of_special_character>.

      For example, if the name of the team space is Initial Team Space, then you must provide it as Intial%20Team%20Space.

      Where %20 is the Hex value of Space character.

    • The values provided in the Publish field always take precedence over the Results options set in the product preferences (Window > Preferences > Test > DevOps Test Hub > Results).

    The Reports information section on the Output window displays the names of the report along with its corresponding URLs in the following conditions:
    • When you configured the URL of Test Hub in Preferences of Test Performance (Window > Preferences > Test > DevOps Test Hub).
    • When you set Publish result after execution as Always or Prompt in the Preferences of Test Performance (Window > Preferences > Test > DevOps Test Hub > Results).
    • When you used Publish parameter or Publishreports parameter.
    Publish_for

    Use this parameter to publish test results to Test Hub from Micro Focus ALM based on the completion status of the tests.

    You must use the Publish_for parameter along with the Publish parameter. You must add multiple parameters separated by a comma. The available options that you can use for the Publish_for parameter are as follows:

    • ALL: You can use this option irrespective of status of the test.

    • PASS: You can use this option to publish test results for the tests that have passed.

    • FAIL: You can use this option to publish test results for the tests that have failed.

    • ERROR: You can use this option to publish test results for the tests that included errors.

    • INCONCLUSIVE: You can use this option to publish test results for the inconclusive tests.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    Publish = "URL_OF_DevOpsTest_Hub#project.nam=test&teamspace.name=ts1"
    Publish_for = "FAIL,ERROR"
    Publishreports

    Use this parameter to publish specific test results to Test Hub.

    You must use the Publishreports parameter along with the Publish parameter. The options that you can use with Publishreports are as follows:

    • STATS

    • TESTLOG

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    Publish = "URL_OF_DevOpsTest_Hub#project.nam=test&teamspace.name=ts1"
    Publishreports = "STATS"

    You can prefix the Publishreports value with ! to publish the reports except for the specified one in the test script.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    Publish = "URL_OF_DevOpsTest_Hub#project.nam=test&teamspace.name=ts1"
    Publishreports = "!TESTLOG"
    Rate

    Use this parameter to change the rate of the rate runner group.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Schedule/ratesch.testsuite"
    Rate = "Rate Runner Group1=1/s, 3/m"

    Where, Rate Runner Group1 is the name of the rate runner group that has two stages. The desired rate for the first stage is one iteration per second and the rate for the second stage is three iterations per minute.

    Notes:
    • The name of the Rate Runner group must match with the name in the rate schedule.
    • The Rate parameter creates a new copy of the rate schedule that contains the specified number of rate.
    Reporthistory

    Use this parameter when you want to view a record of all events that occurred during a test or schedule run.

    You must use any of the following options:
    • jaeger: To send test logs to the Jaeger UI during the test or schedule run.
      Note: You must set the JAEGER_AGENT_HOST property as System environment variable before you use the jaeger option to send test logs to the Jaeger UI.
    • testlog: To send test logs as traditional test logs in Test Performance during the test or schedule run.
    • null: To send no test logs either to the Jaeger UI or Test Performance during the test or schedule run.
    For example,
    Workspace = "C:\Users\HCL\hclonetest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    Reporthistory = "jaeger"

    You can add multiple options separated by a comma to send test logs during the test or schedule run to Test Performance and the Jaeger UI.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    Reporthistory = "jaeger,testlog"

    For more information about how to view test logs in the Jaeger UI and Test Performance, see the Related information section.

    ResourceMonitoringLabelsOverride
    Use this parameter to perform any of the following actions:
    • Enable the Resource Monitoring from Service option for a performance schedule if the Resource Monitoring from Service option is not enabled from the schedule editor in Test Performance.

    • Ignore Resource Monitoring sources that were set in the performance schedule and change for a label matching mode.

    • Replace an existing set of Resource Monitoring labels that were set in the performance schedule and run the schedule with a new set of Resource Monitoring labels.

    If you have added a label in Test Hub for a Resource Monitoring source as rm1, then you can provide value as shown in the following example to collect data from the source:

    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    ResourceMonitoringLabelsOverride = "rm1"

    If your label for resource monitoring contains a comma (,) then you must replace the single comma with the double comma while providing the value. For example, if you added a label to a Resource Monitoring source as rm1,test, then you must provide the value as shown in the following example to collect data from source:

    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    TestSuiteName = "Tests/testHttp.testsuite"
    ResourceMonitoringLabelsOverride = "rm1,,test"
    Notes:
    • You can use this field only when you want to run a Rate schedule or VU schedule.

    • You can add multiple Resource Monitoring labels separated by a comma.

    • You must add the Resource Monitoring labels to the Resource Monitoring sources on the Resource Monitoring page in the Test Hub project.

    ResultsFile

    Use this parameter to provide a different name to the result file.

    The default name of the result file is the name of the test or schedule with a timestamp appended.

    UserComments

    Use this parameter to add text that you want to display in the user comments row of the report.

    For example,
    Workspace = "C:\Users\HCL\devopstest\workspace1"
    Project = "proj1"
    UserComments = "test run with dataset"
    Note: When you run tests by using the double quotation marks ("") for the UserComments parameter, then the user comments row of a report does not contain double quotation marks.

    For example, if you provide the value for the UserComments parameter as test run with "dataset", then the user comments row of a report displays the value as test run with dataset.

    To work around this problem, you must create a command-line config file, and then run the test by using the ConfigFile parameter.

    Users

    Use this parameter to overrides the default number of users, if required.

    For a schedule, the default is the number of users specified in the schedule editor and for a test, the default is one user.

    Note: The Users parameter creates a new copy of the schedule that contains the specified number of users.
    VarFile Use this parameter to provide a complete path to an XML file that contains the variable name and value pairs.
    VMArgs

    Use this parameter to specify the maximum heap size for the Java process.

    You can add multiple VM Arguments separated by a comma.

  7. Click the Save icon.

Results

You have configured the test script by adding the required parameter values for the test run.

What to do next

You can run test assets from Micro Focus ALM. See Running tests from Micro Focus ALM.