Configuring a run of a JMeter test
After you added the test resources that you created in JMeter to the server project, you can configure a JMeter test to be run on IBM® DevOps Test Hub (Test Hub) or a remote Kubernetes cluster.
- Read and completed the tasks mentioned in Test run considerations for JMeter tests.
- Read and completed the tasks mentioned in Considerations for using a remote Kubernetes cluster, if you want to use a remote Kubernetes cluster as a location to run the test.
- Completed the Xray integration, if you want to export the test results to a Jira issue in your Xray project in Jira. See Integration with Xray test management for Jira.
- Ensured that the JMeter extension on Test Hub is enabled before you configure a test run.
- Ensured that you are assigned a role as a Member or Project Creator in the team space. See Managing members and their roles in a team space.
- Ensured that you are assigned a role as a Project Owner or Tester in the project. See Managing access to the server projects.
- Created a project in your team space in Test Hub. See Creating a project.
- Added the remote Git repository that contains the test resources to the project. See Adding repositories to a server project.
-
Log in to Test Hub.
The Projects page of the initial team space is displayed.
- Open the project that contains the test assets, and then click Execution.
-
Select the branch of the repository that contains the test
assets.
The test assets that are contained in the selected branch of the repository are displayed in the following tabs on the Execution page:
Tab Description SUITES Lists all suites, Compound Tests, JMeter tests, JUnit tests, Postman tests, Rate Schedules, Selenium tests, or VU Schedules that are in the selected branch of the repository. TESTS Lists all API tests, functional tests, or performance tests that are in the selected branch of the repository. ADVANCED Lists all assets that are displayed when custom filters are applied for assets in the selected branch of the repository. -
Select the tab based on the type of test assets that you want to run as
indicated in the following table:
If... Then... You want to run AFT Suites, API Suites, Compound Tests, JMeter tests, JUnit tests, Postman tests, Rate Schedules, Selenium tests, or VU Schedules.
Click the SUITES tab.
You want to run an individual API test, functional test, or performance test.
Click the TESTS tab.
You want to find Suites and tests by using custom filters, and then run Suites and tests. Click the ADVANCED tab.
The test assets in the selected tab are displayed.
-
Identify the test asset that you want to run by performing any of the
following actions:
- Scroll through the list.Tip: You can hover over the icon in the Type column to know the type of the test asset.Note: You can also identify the type of the asset from the icon that represents the test type as shown in the following table:
Icon Represents Listed in the SUITES tab Listed in the TESTS tab Listed in the ADVANCED tab API test Functional test Performance test AFT Suite API Suite Compound Test HCL® AppScan CodeSweep JMeter Test JUnit Test Postman test Rate Schedule Selenium test VU Schedule - Search for the test asset by entering any text contained in the test asset name in the Search field.
- Click the Filter icon
in the SUITES or TESTS tab to filter the displayed assets based on the asset type.
For example, select API Suite in the SUITES tab to display all API Suites or select Functional Test in the TESTS tab to display all functional tests that are in the selected branch of the repository.
- Click the Filter icon
in the ADVANCED tab, and then create a filter query by using the New filter option by performing the following steps:
- Click New filter.
- Enter a name for the filter.
- Select an operator, and then add a rule or a group of rules.
- Add or enter the relevant parameters and either
select or enter the condition and the criteria for
the condition.You can select a parameter from the following list:
- Type
- Test Asset Name
- Test Asset Path
- Last Result
- Next Run
- Components
- Save the filter query to save and apply the filter
query to filter the assets based on the query.
The test assets that match the filter criteria are displayed.
- Retrieve and apply a saved filter query, if you have saved
filter queries previously by performing the following
steps:Note: The filter query applied previously is selected and the assets based on that filter query are displayed. To apply a different filter query, you must have created and saved the filter query.
- Click the Filter icon
in the ADVANCED tab.
The filter queries that you created and saved are displayed.
- Click the filter that you want to apply.
The test assets that match the filter criteria are displayed.
- Click the Filter icon
You have identified the test asset that you want to run.
Clicking the test name displays the Details panel. You can view the details of the test such as the description, the branch in the repository that contains the asset, the Git details, and the details of the commits to the repository. You can also view the history of the test runs for the specific test under the History tab of the Details panel.
- Scroll through the list.
-
Click the Execute icon
in the row of the identified test asset.
The Execute test asset dialog is displayed.Notes:-
If you have configured some or all of the settings for the current test run, and you do not want to continue with those settings, you can reset the settings by clicking Reset.
-
If you want to repeat a test run and do not want to use the saved settings from a previous run, you can reset all the saved settings to their default values by clicking Reset.
-
-
Select the version of the test resources
that you want to run by completing any of
the following actions:
- Expand the list in the Version field,
find the version of the test resources, and then select the
version.Use the following details about the version of the test resources that are displayed to identify the version that you want:
- Commit message.
- Tags labeled by the user for the version committed.
- The user who committed the version to the repository.
- Relative time of the commit. For example, 2 hours ago or 3 days ago.
The list displays the versions of the test resources committed by all users to the branch in the repository. The versions are arranged with the latest version that is committed, and then followed by the versions committed previously.
- Expand the list in the Version field,
and then search for the version that you want to select by
entering a partial or the complete commit message of that
version.
The version that matches the search criteria is displayed and it is selected for the test run.
- Expand the list in the Version field,
find the version of the test resources, and then select the
version.
-
Select the time for scheduling the test run from the following
options:
- No action is required if you want to
initiate the test run immediately after you click
Execute.Important: Click Execute only after you have configured the other settings in this dialog.Note: The default time for scheduling a run is Now.
- Select Schedule and perform the
following actions if you want to schedule a single test run
or configure recurring test runs:
Schedule Actions A single test run Perform the following steps:- Click the Calendar icon
in the row of the Start field.
- Select the date.
- Select the time at which the test run must start.
- Select the Never option in the Repeat every field.
- Click Save.
The test run is scheduled to run at the selected time on the scheduled date.
Recurring test runs Perform the following steps:- Click the Calendar icon
in the row of the Start field.
- Select the date.
- Select the time at which the test run must start.
- Set the frequency at which the test runs must
run by entering the number in the
Repeat every field, and
then select the period from the list. You can
select from the following options:
- Minute
- Hour
- Day
- Week
- Month
For example, if you want the test run to be run every day at the set time, enter 1 and, then select the Day(s) option.
You can also schedule the test to run at the set time on specific weekdays by selecting the Week(s) option. For example, the following image displays the days selected for the test runs as Monday, Wednesday, and Friday: - Set the option to end the recurring test runs
from the following options:
- Select the Never option, if you do not want the recurring test runs to end.
- Select the On option,
and then click the Calendar
icon
. You can select the date and time after which the scheduled test runs do not run.
- Click Save.
The recurring test runs are scheduled to start the first run at the selected time on the scheduled date, and to repeat the run at the frequency that you set.
- Click the Calendar icon
- No action is required if you want to
initiate the test run immediately after you click
Execute.
-
Enter a label for the test run
that helps you to identify the test on the
Results page.
After the test run completes, the label that you entered is displayed for the test under the Labels column on the Results page. After you have created a label, any member of the project can use that label.
The default value for the Label field is null or an empty field.
Important: The configuration that you set for the test run in the Execute test asset dialog is preserved when you run the same test again. Those changes are not visible when another user logs in to Test Hub. For example, if you created new variables on the server, those variables are available only for you when the same test is run again.If you want to run the test immediately or at the scheduled time, click Execute, or continue with the next step.
-
Click Advanced to make
the following advanced configurations:
-
Enter any JVM arguments that must be passed to the test run at
run time in the JVM Arguments field, if
applicable for the test.
For example, you can set a maximum Java heap size.
- Enter program arguments that must be passed to the test run at run time in the Program Arguments, if applicable for the test.
For example, enter -J to override any JMeter property that is defined in the properties file.
Note: You must separate the arguments or variables with a white space when you enter them in the same line or start each argument or variable on a new line.The default value for each of the fields for the advanced settings is null or an empty field.
If you want to run the test immediately or at the scheduled time, click Execute, or continue with the next step.
-
Enter any JVM arguments that must be passed to the test run at
run time in the JVM Arguments field, if
applicable for the test.
-
Follow the instructions if you want to export the test results to a
Jira issue in your Xray project in Jira:
- Click the RESULTS tab.
-
Perform the actions listed in
the following table to select an option to export the test
results:
Export options Results in... Actions Jira Xray
The test results of the test that you configure for a run are exported to the selected issue after the test run is completed. The results are exported to the selected issue that exists in your Xray project in Jira.
Perform the following steps:- Select the Jira Xray
option.
The Select issue field is displayed.
- Click the field to view the list of issues in the Xray project in Jira. Alternatively, you can enter the issue key in the Jira Xray project.
- Select the issue to which you want to export the test results.
- Continue with the next step.
New Jira item
The test results of the test that you configure for a run are exported to a new Jira issue. The issue is created in your project in Jira after the test run is completed.
Perform the following steps:- Select the New Jira item option.
- Continue with the next step.
None
The test results are not exported.Note: This export option is the default option.Perform the following steps when:- You do not want to export the test results.
- You selected a Jira issue in a previous run of the same test, and you do not want to export the results of the current run.
- Select the None option.
- Continue with the next step.
- Select the Jira Xray
option.
-
Follow the instructions if you want to change the location of a
Kubernetes cluster for running the test:
-
Click the LOCATION tab, if it is not
already open.
The Default Cluster is the default location where the test runs, and it is listed under the Host column. The information about the availability of the default location is displayed.Important: You must have added the registered remote Kubernetes clusters to your project that are then displayed under the Override column:Notes:
- If the remote clusters are not added to your project, the option No override options is displayed as the default value and the test runs in the Kubernetes cluster of Test Hub.
- If remote clusters are added to your project, the added clusters are displayed along with their availability status and ownership information.
-
Select the location where you want to run the test asset from
the following options:
- Select the Default Cluster when no remote clusters are available in your project.
- Select the remote cluster from the list when a remote cluster is available in your project.
- Select No override options, if you selected any remote cluster and want to revert to the Default Cluster to run the test asset.
-
Click Execute.
The test run is initiated.
-
Click the LOCATION tab, if it is not
already open.
- Stop the test run at any point after the test run is initiated from the Execution page. See Stopping test runs.
- Cancel a scheduled test run from the Execution page. See Canceling scheduled test runs.
- View all the states of the test asset by
clicking the Show in the Progress page icon
for the test asset for which you started or scheduled the run. See Viewing the state of test assets.
- View the progress of the test from the Progress page. See Viewing the progress of running test assets.
- View the results, reports, and logs of the test from the Results page after the test completes the run. See Test results.