Web & API integration
Overview
The "Web & API Integration" feature in our automated testing framework bridges the gap between web-based testing and API interactions. This integration allows for the seamless execution of API calls during web tests, enhancing the ability to test complex scenarios that involve both front-end and back-end components.
How It Works
When the testing framework encounters the API_EXECUTOR
action in the CSV configuration, it triggers an API call. The framework searches for the specified API file in the test data directory and executes the API request. The data retrieved from this API call can be stored in global variables or processed further using "API Tailor-Made Coding".
CSV File Configuration for Web & API Integration
To incorporate an API call into your test, use the following format in the CSV configuration:
Example Entry:
Key Columns:
ACTIONS
: Set toAPI_EXECUTOR
to indicate an API call.SEND_KEYS
: Specifies the name of the API file to be executed.
Utilizing API Data in Tests
The data obtained from the API call can be leveraged in several ways:
Stored in Global Variables:
Data from the API response can be automatically stored as global variables.
Use Case: This is useful for scenarios where API response data is needed in subsequent web test steps.
API Tailor-Made Coding:
Custom code can process the API response data as per specific test requirements.
Use Case: When the standard processing of API data is not sufficient, custom methods can manipulate or utilize this data in a tailored manner.
Benefits
Comprehensive Testing: Allows for testing scenarios that involve both the user interface and API interactions, providing a more thorough test coverage.
Efficiency: Reduces the need for separate tests or manual integration of API and web testing.
Flexibility: Offers the ability to customize how API data is used and processed within the testing process.
Conclusion
The "Web & API Integration" feature significantly enhances the capabilities of our automated testing framework. By enabling the execution of API calls within web tests and providing mechanisms for the efficient handling of API data, it allows testers to create more sophisticated and comprehensive test scenarios, ensuring a thorough validation of both front-end and back-end functionalities.
Last updated
Was this helpful?