Global Parameters
The lifeblood of your tests. URLs, credentials, dynamic data - manage everything from one place, use it everywhere.
What are Global Parameters?
Global Parameters allow you to centrally define variables for use in your tests. Define once, use everywhere with the {{param_name}} syntax.
Single Point of Change
URL changed? Update in one place
Environment Support
Separate config for Dev, Staging, Prod
Share Between Steps
One step's output is another's input
Use Cases
URLs & Endpoints
Base URL, API endpoints, CDN addresses
{{base_url}}, {{api_url}}, {{cdn_url}}
Credentials
Test user credentials, API keys
{{test_email}}, {{test_password}}, {{api_key}}
Test Data
Product IDs, category codes, constant values
{{product_id}}, {{category_code}}, {{country}}
Dynamic Values
Timestamp, random string, unique ID
{{$timestamp}}, {{$randomEmail}}, {{$uuid}}
Step Outputs
API response, JS result, extracted values
{{order_id}}, {{auth_token}}, {{user_name}}
Config & Flags
Feature flags, timeout values
{{timeout}}, {{retry_count}}, {{is_premium}}
Syntax & Usage
Basic Syntax
{{parameter_name}}
Where Can You Use It?
In Actions
Type: {{username}}
In URLs
{{base_url}}/products/{{product_id}}
In API Body
{"token": "{{auth_token}}"}
In Assertions
Text Equals: {{expected_title}}
In Selectors
#product-{{product_id}}
In Scripts
const id = "{{user_id}}";
Note!
Parameter names are case-sensitive. {{UserName}} and {{username}} are different variables.
Real-World Scenario Examples
Scenario 1: Multi-Environment Test
Run the same test in different environments
Use Case: You want to run a login test on both staging and production. The URL and credentials are different.
Global Parameters (Environment: Staging)
base_url = https://staging.myapp.com
api_url = https://api-staging.myapp.com
test_email = test@staging.myapp.com
test_password = Staging123!
Global Parameters (Environment: Production)
base_url = https://www.myapp.com
api_url = https://api.myapp.com
test_email = smoketest@myapp.com
test_password = Prod456!
Use {{base_url}} in your tests, select the environment when running. No code changes needed!
Scenario 2: Order Flow (Data Chain)
One step's output becomes another's input
Use Case: Place order -> Get order ID -> Go to detail page -> Cancel order. Each step uses data from the previous step.
API: Create Order
Save $.data.orderId from response -> order_id
Navigate
{{base_url}}/orders/{{order_id}}
Assertion
Order ID visible: {{order_id}}
API: Cancel Order
DELETE /api/orders/{{order_id}}
Scenario 3: Unique Data for Each Run
Avoid email conflicts in registration tests
Use Case: User registration test. You need a different email each run, otherwise you get "Email already exists" error.
Global Parameters
// Using built-in functions
unique_email = test_{{$timestamp}}@myapp.com
unique_username = user_{{$randomString(8)}}
// Example outputs:
// test_1704825600000@myapp.com
// user_xK9mPq2w
Unique values are generated for each test run. No conflicts even in parallel tests!
Scenario 4: Shared Credentials Management
Password changed, update 100 tests
Use Case: The test user's password changed. You have hardcoded passwords in 100 tests. Are you going to update them one by one?
WRONG
// Hardcoded in every test
Type: admin@test.com
Type: OldPassword123
100 tests FAIL when password changes!
CORRECT
// Use Global Parameter
Type: {{admin_email}}
Type: {{admin_password}}
Update in one place, done!
Scenario 5: Dynamic Selector
Same test for different products
Use Case: You want to run the "Add to Cart" test for different products. Make the product ID a parameter.
Global Parameters
product_id = 12345
product_name = iPhone 15 Pro
Test Steps
1. Navigate: {{base_url}}/products/{{product_id}}
2. Click: #add-to-cart-{{product_id}}
3. Assertion: Cart contains "{{product_name}}"
Data-Driven Testing: Run the same test with different product_ids from CSV/Excel!
Built-in Functions
| Function | Description | Example Output |
|---|---|---|
{{$timestamp}} |
Unix timestamp (ms) | 1704825600000 |
{{$isoDate}} |
ISO 8601 date | 2025-01-09T14:30:00Z |
{{$uuid}} |
UUID v4 | a1b2c3d4-e5f6-... |
{{$randomString(n)}} |
Random string of n characters | xK9mPq2w |
{{$randomInt(min,max)}} |
Random number between min-max | 42 |
{{$randomEmail}} |
Random email address | user_x9k2@test.com |
{{$randomPhone}} |
Random phone number | +905551234567 |
{{$today(format)}} |
Today's date (formatted) | 2025-01-09 |
Scope & Priority
If a parameter with the same name is defined in multiple places, the priority order is:
Step Level (Highest)
Value set within the step
Testcase Level
Parameters specific to the testcase
Environment Level
Parameters of the selected environment
Project Level (Lowest)
Project-wide default values
Example: If timeout=30 is defined at Project level and timeout=60 at Environment level, the test uses the value 60.
Frequently Asked Questions
Can I use special characters in parameter values?
Yes! You can store complex values like JSON, URL, HTML content. However, avoid {{ and }} characters.
How do I store passwords securely?
Create a "Secret" type parameter for sensitive data. These values are masked (*****) in logs and reports.
What happens if a parameter is not defined?
Validation is performed before the test runs. If there's an undefined parameter, the test won't start and an error message will be displayed.
Can I change a parameter value at runtime?
Yes! You can assign values at runtime using the "Set Global Parameter" step or the "Save to Parameter" feature in API/Python/JS steps.