ContextQA
  • What is ContextQA?
  • Getting Started with ContextQA
    • Setup
      • Sign-Up / Login
      • Installing ContextQA Extension
    • Test Automation
      • Automation with Recorder
      • Automation with AI Agent
    • Advance Testing
      • Cross Browser Testing
      • API Testing
      • Visual Testing
      • Performance Testing
      • Accessibility Testing
      • Mobile Testing
        • Automate Test
          • Integrating VCS
          • Integrating Device Farm
          • Linking A Repository
          • Scanning Repositories
          • Test Execution Process
          • Configuring Tests
        • Mobile Testing Report
    • Manage Test Cases
      • Test Suite
      • Test Plan
    • Quality Insights
    • Integration
      • Slack Integration
      • Jira Integration
  • Advance Features
    • Self-Healing Test Cases
    • Parallel Test Execution
    • Parameterization
    • Environment Management
    • Visual Regression Testing
    • Performance Testing
    • Accessibility Testing
    • Generate Code
    • Root Cause Analysis
  • ContextQA Extension
    • Installing ContextQA Extension
    • Logging in to ContextQA from the Extension
    • Creating a Test Case in the ContextQA Extension
    • Edit Test case in Extension
    • Editing Test Steps in the ContextQA Extension
    • Deleting a Test Case from the ContextQA Extension
    • How to Re-record Test Steps in ContextQA
  • ContextQA Portal
    • Sign-Up / Login
    • ContextQA Dashboard
    • Test Development Section
      • Create
        • Create Test Case
        • Create Manual Testcase
        • Create Test Case with the help of AI
        • Create Test Suite
        • Create Cross-Browser Test Plan
        • Creating an Element Manually
        • Creating a Step Group
        • Creating Test Data Profiles
        • Create Cross-Device Test Plan
        • Creating an Environment
      • Edit
        • Edit Test Case
        • Editing Test Steps
        • Edit Test Suite
        • Editing Test Data Profile
        • Editing Test Plan
        • Edit Step Group
        • Edit Element
        • Edit Environment
      • Delete
        • Deleting a Testcase
        • Delete Test Step
        • Delete Test Suite
        • Delete Step Group
        • Delete Elements
        • Delete Test Data Profile
        • Delete Test Plan
        • Delete Machine/Device within Test Plan
      • Call Function
        • Call/Use Step Group in Testcase
        • Call Test Data Profile in Testcase
        • Call Environment
      • Run
        • Run Testcase
        • Run Details section
        • Run History
        • Executed Test Steps with visual regression
      • Elements/Conditions/Parameters
        • Add If Condition
        • Add While Condition
        • Add Element in Test Steps
        • Add Parameter in Test Case
    • API Testing
    • Creating Workspace
    • Enable Jira & Link issues
    • Bug report
  • ContextQA Insights
  • FAQ/Others
    • Assertion
    • AI Result/ Quick Fix
    • How to add Network idle Template
    • How to upload file and how to use File upload Template
    • How to add Page Display Templates
    • How to add Test Step to Visit a Page
    • How to Switch Tabs using Template
    • How to add Wait Template
    • Test Case Screenshot
    • Timeout Template
    • Element Directory in Extension
    • Find Locater of an Element
    • TestSteps Reorder
    • Test Plan Scheduler
    • Restore Deleted Test Case
    • Search Test case
    • Clone Test Step
  • Integration
    • Slack Integration
    • Jira Integration
Powered by GitBook
On this page
  • Setting Up API Test Cases
  • Using ContextQA for API Automation
  1. Getting Started with ContextQA

API Test Automation with ContextQA

Last updated 8 months ago

ContextQA offers powerful tools for automating API tests, allowing you to validate API responses, status codes, and data integrity efficiently. This guide provides a step-by-step approach to setting up and executing API test cases in ContextQA.

Setting Up API Test Cases

1. Navigate to the Test Development Section

  • Log in to your ContextQA account.

  • Click on the pencil icon in the sidebar to access the Test Development section.

2. Click on Testcase

  • From the dropdown menu, select 'Testcase'.

3. Type API and Select API Template

  • In the template options, type 'API' in the search bar.

  • Select the API Template from the list.

4. Click on the Edit Icon

  • Click on the edit icon to start configuring your API test case.

5. Add Title

  • Enter a descriptive title for your API test case.

6. Select the Required HTTP Method

  • Choose the appropriate HTTP method (e.g., GET, POST, PUT, DELETE) based on the API you are testing.

7. Add the URL

  • Enter the URL of the API endpoint you want to test.

8. Click on Send

  • Click the 'Send' button to execute the API request.

9. View the Response Preview

  • After clicking 'Send', review the response preview to verify the API response.

  • This includes response body, headers, and status code.

10. Click on Next

  • Proceed to the next step by clicking 'Next'.

11. Add a Variable Name to Store Response

  • Define a variable name to store the API response for further use in verification.

12. Click on Next

  • Click 'Next' to move to the verification configuration.

13. Add JSON Path to Verify

  • Specify the JSON path for the data you want to verify in the API response.

14. Select the Required Verification Method

  • Choose the verification method (e.g., equals, contains) to check the data against the expected results.

15. Select the Data Type to Verify

  • Indicate the data type (e.g., string, number) of the expected value.

16. Enter the Expected Value in String Field

  • Input the expected value that the API should return.

17. Click on Status

  • Configure the status verification settings to ensure the response meets expectations.

18. Add Expected Status Value

  • Enter the expected status value (e.g., HTTP 200 for a successful request).

19. Click on Create

  • Click 'Create' to finalize and save your API test case.

  • Your API test case is now created successfully!

20. Click on Run

  • To execute the test case, click 'Run'.

21. Test Case Executing

  • The test case will begin executing. You can track its progress in real-time.

22. Executed Successfully

  • Once the test completes, you'll receive a notification indicating whether the test passed or failed based on your criteria.


Using ContextQA for API Automation

We'll now walk you through a step-by-step guide on how to create and execute an API test case using ContextQA.

Step 1: Navigate to the Test Development Section

  • Log in to ContextQA and navigate to the Test Development section by clicking the pencil icon in the sidebar.

Step 2: Create a New Test Case

  • In the Test Development section, click 'Testcase'.

Step 3: Select the API Template

  • Type 'API' in the search bar and select the API Template designed to streamline API tests.

Step 4: Configure Your Test Case

  • Click the edit icon to start customizing your API test case.

Step 5: Add Details

  • Enter a descriptive title for your test case.

  • Select the appropriate HTTP method (GET, POST, PUT, DELETE).

  • Enter the URL of the API endpoint.

Step 6: Execute and Review

  • Click 'Send' to initiate the API request.

  • Review the response preview to check the response body, headers, and status code.

Step 7: Proceed with Verification

  • Click 'Next' to proceed to the verification steps.

  • Add a variable name to store the response.

  • Specify the JSON path and verification method (equals, contains).

  • Select the data type and input the expected value.

Step 8: Verify Status

  • Configure the status verification settings.

  • Enter the expected status value.

Step 9: Save and Run

  • Click 'Create' to save the test case.

  • Click 'Run' to execute the test case.

Step 10: Monitor Execution

  • Track the test execution progress in real-time.

Step 11: Check Results

  • After completion, review the test results to see if it passed or failed based on your criteria.

By following these steps, you can effectively set up and execute API test cases in ContextQA, ensuring that your APIs function as expected.

42MB
Setting Up API Test Cases in ContextQA (1).mp4
85MB
Using ContextQA for API Automation (1).mp4