ScriptlessAutomation
  • 👋Welcome to Scriptless Automation
  • Discover More About Automation
    • ⚙️Automation platform intro
    • 💡Advantages of Scriptless Automation
    • 🚀Release Notes
      • 📖Open Code
      • 📕License Code
  • Product tools
    • 📪Pre-request Tools
    • 🔧Project Dependencies
  • Automation Architecture
    • 🎨Flow diagram
  • Get Started
    • 🛠️Start with Automation
    • 📖Open Code Automation
      • 🌏Web Automation
      • ↔️API Automation
    • 🏢Maven Configuration
    • 🗜️Setting Up Maven Project in IntelliJ IDEA
    • 🎛️Scriptless Config
      • 🕸️BrowserConfiguration
        • chrome.properties
      • 👥CommunicationConfiguration
        • SlackConfiguration.properties
      • 📧MailConfiguration
        • gmailCredentials.properties
      • 🛂ReportConfiguration
        • extentReportConfiguration.properties
      • 🕵️TestManagementConfiguration
        • testRail.properties
        • zephyrscale.properties
        • testiny.properties
      • ⚙️testNgConfiguration.properties
    • 🍱TestData Configuration
    • 👨‍💼Gherkin Language and Scriptless Automation Framework
  • Automation Import Notes
    • 🎨Points to Remember
  • Automation Platforms
    • 👾ScriptlessApi Automation
      • 🖊️Introduction
      • 🗜️Api Automation Setup
      • 🔃Supported API Request Types
      • 🪧API Automation Template
      • 📚Example of API Requests
        • ⬇️GET
        • ↕️POST
        • ⤵️PUT
        • ❌DELETE
      • 🎯API Response Validation
      • 👨‍👦API Dependent TestCase
      • 📝Store API Variables
      • 📔API with JSON body
      • 🙋‍♂️Api Wait
      • 🗜️API Schema Validation
      • 🏗️API Tailor-Made coding
      • 👨‍🦯API Support Generator
      • ↘️Api Response Store Objects
      • ✍️API Test Report
      • 🚃Api Response Type Validation
    • 🌐ScriptlessWeb Automation
      • 🖊️Introduction
      • 🗜️Web Automation Setup
      • 🪧Web Automation Template
      • 🧮page_object_locators
      • 📜Web Automation Key Phrases
        • 📃PAGE_NAME
        • ⌛WAIT_TYPE
        • 📜SCROLL_TYPE
        • 👨‍💼ELEMENT_NAME
        • 🏎️ACTIONS
        • ⌨️SEND_KEYS
        • ✔️VALIDATION
        • ✅VALIDATION_TYPE
      • 👨‍👦Web Dependent Test Case
      • 🐒MOCK
      • 🛂AutomationAsserts
      • 🏗️Web Tailor-Made coding
      • 📝Store Web Variables
      • 🤼‍♀️Web & API integration
      • 🖇️Dynamic Strings
      • 🗣️ReadFile Annotation for Custom Code
      • 🖼️Page_Comparison
      • 👨‍💼Gherkin Template for Web Automation
    • 📱Mobile Automation
  • 🪶Automation features
    • 🌲Environment and System Variables
    • 🗝️KeyInitializers
      • Types of KeyInitializers
    • ✍️Reporting
      • Dashboard
      • Category
      • Tests
        • Screenshot Section
    • 👯Parallel Testing
    • 🏗️Tailor-Made Coding
  • ⏩Automation Demo
Powered by GitBook
On this page
  • Introduction
  • How to Use API Wait
  • API Wait Feature Benefits
  • Conclusion

Was this helpful?

  1. Automation Platforms
  2. ScriptlessApi Automation

Api Wait

Introduction

The API Wait feature in scriptless automation is designed to synchronize the automation flow with the readiness of the API response. It allows the automation to pause execution until the API response contains a specific expected value, or until a specified timeout is reached.

How to Use API Wait

Setting Up API Wait

The API Wait feature is only applicable for the combination of RESPONSE:EXPECTED_VALUE and RESPONSE:JSON_PATH at column index 1. This specific pairing ensures the automation framework knows precisely which value to await and where to find it in the API response.

In the CSV template, you can specify the expected value within the RESPONSE:EXPECTED_VALUE column, along with an optional timeout value. The automation framework will wait for the response from the API to match this expected value before proceeding.

CSV Template Syntax

RESPONSE:JSON_PATH,'Column Name',additionalField
RESPONSE:EXPECTED_VALUE,ExpectedValue:Timeout,NONE
  • RESPONSE:JSON_PATH: Indicates the JSON path where the expected value is to be found in the API response.

  • RESPONSE:EXPECTED_VALUE: Specifies the expected value and an optional timeout in seconds.

Example Without Custom Timeout

DEPENDANT_TEST_CASE,NONE,
...
BODY:KEY,JsonRepository,name
BODY:VALUE,test,PrecisionTestAutomation
RESPONSE:CODE,201,
RESPONSE:JSON_PATH,'Column 1',id
RESPONSE:EXPECTED_VALUE,PrecisionTestAutomation,NONE
RESPONSE:STORE_VALUE,NONE,ID

In this example, the automation framework will wait for the value PrecisionTestAutomation to appear in the response under Column 1. The default timeout is 30 seconds.

Example With Custom Timeout

...
RESPONSE:JSON_PATH,'Column 1',id
RESPONSE:EXPECTED_VALUE,PrecisionTestAutomation:10,NONE
...

Here, :10 appended to the PrecisionTestAutomation indicates that the automation should wait for up to 10 seconds for the expected value.

API Wait Feature Benefits

  • Synchronization: Ensures that the automation flow is in sync with the processing time of the API, preventing failures due to premature assertions.

  • Customizable Wait: Allows setting a custom timeout to accommodate APIs with variable response times.

  • Fail-fast Mechanism: Provides an early exit if the expected value does not appear in the API response within the timeout, enhancing test efficiency.

Conclusion

The API Wait feature adds an intelligent waiting mechanism to scriptless automation, enhancing the accuracy and reliability of API testing. By focusing on the first column index for expected values and JSON paths, it introduces a standardized method to manage asynchronous API responses effectively. This feature is critical for ensuring that automation processes remain stable and consistent, particularly in complex, data-dependent testing scenarios.

PreviousAPI with JSON bodyNextAPI Schema Validation

Last updated 8 months ago

Was this helpful?

👾
🙋‍♂️