Store Web Variables
Overview
The "Store Web Variables" feature in our automated testing framework allows for the capturing and storing of data from web elements during tests. This data is then saved as global variables, which can be used later in the testing process. This feature is crucial for scenarios where the data from one part of the test needs to be reused in subsequent steps.
How It Works
Data is stored by specifying the SAVE
action in the CSV configuration file, which is used to define the test steps. The data from a specified web element is then captured and stored as a global variable.
CSV File Configuration for Storing Variables
To store data from a web element, the following columns in the CSV file are crucial:
Example Entry:
Key Columns:
ELEMENT_NAME
: Identifies the web element from which to capture data.ACTIONS
: Set toSAVE
to indicate data storage.SEND_KEYS
: Specifies the name under which the captured data will be stored as a global variable.
Using Stored Variables in Tests
Once the data is stored, it can be utilized in various ways:
In Custom Tailor-Made Code:
Custom methods can access these stored variables via global variables.
Example:
Direct Usage in Test Steps:
The stored data can be directly used in subsequent test steps.
Example:
In this example, the
userName
field will be filled with the text saved under the nametestFrameName
.
Benefits
Data Reusability: Enables the capture and reuse of data across different parts of the test.
Dynamic Testing: Facilitates testing scenarios where dynamic data or data dependent on previous steps is required.
Efficiency: Improves test efficiency by reducing the need for redundant steps to capture data.
Conclusion
The "Store Web Variables" feature is a vital part of our testing framework, providing an efficient way to capture and reuse data within the testing process. By enabling the storage of data as global variables, it allows for more complex and dynamic testing scenarios, enhancing both the flexibility and the depth of your automated tests.
Last updated
Was this helpful?