Understanding Runtime Parameters
Runtime Parameters are dynamic inputs that can be passed to test cases during execution. These parameters provide flexibility, allowing you to reuse test cases with varying values and conditions, without having to modify the test steps or scripts. They are essential for automating tests in different environments, with different data, and in various scenarios.
What are Runtime Parameters?
Runtime Parameters are variables that you can set and use within your test cases during execution. They help in customising test runs based on specific inputs that are defined at runtime, rather than hardcoding values into the test scripts.
Key Features of Runtime Parameters
Dynamic Inputs: They can be provided at runtime and vary between executions.
Test Reusability: Test cases can be reused with different sets of data.
Environment Flexibility: You can run tests in different environments (e.g., UAT, Production) by passing different parameter values.
Seamless Integration: Allows integration with data-driven testing approaches by dynamically feeding data into tests.
Scalability: Easily scale your tests by running them with different parameter values without changing the core test logic.
Creating Runtime Parameters in SimplifyQA
To use runtime parameters effectively, follow these steps:
1. Create a Runtime Parameter
Navigate to Test Management >Parameters.
Click on '+ Parameter', then enter a name and select a parameter type (both mandatory fields)
When selecting the parameter type select 'Runtime'.
If you want the parameter keys to be unique, enable the "Make Unique" field and click 'Save'.
Understanding the 'Make Unique' Field
When creating a runtime parameter, selecting 'Make Unique' will open a dropdown with the following options:
This option is used to make the runtime parameter keys unique by appending below options:
OPTION
DESCRIPTION
EXAMPLE OUTPUT
_TestcaseID
Appends the Test Case ID to the key.
testUser_12345
_UserID
Appends the User ID to the key.
testUser_56789
_UserID_TestcaseID
Combines User ID and Test Case ID.
testUser_56789_12345
_TestcaseID_UserID
Combines Test Case ID and User ID.
testUser_12345_56789
Use case: If multiple test cases run in parallel, enabling this feature ensures that each parameter remains unique, preventing duplicate runtime values.
Using Runtime Parameters in a Test Case (For example)
Navigate to a Test Case: Go to Test Management > Test Cases and open a test case.
Use "Get Text and Store " action which fetches the text from UI and stores to runtime parameter.
Add a step to your test case where you need to capture a value dynamically.
Select the action: "Get Text and Store".
Provide a Runtime Parameter Name (e.g., CapturedOrderID).
Use the Stored Parameter in another Step:
In a subsequent step, reference the runtime parameter as “CapturedOrderID”
Example Use Case – Capturing Order ID Dynamically
STEP
ACTION
INPUT
OUTPUT
1
Navigate to Order Page
URL
-
2
Get Order ID from UI
XPath: //span[@id='orderID']
Store in ${CapturedOrderID}
3
Use Order ID in Next Action
Input: ${CapturedOrderID}
-
This ensures that every order ID is dynamically captured and reused throughout the test.
Last updated