Validation Using APIs | Bondar Academy
Course: AI-based testing with testRigor
Module: Working with APIs
Instructor: Artem Bondar
Lesson Summary
In this lesson, we explore a practical use case of utilizing APIs in Test Trigger for validating test data when a UI is not available. This approach is particularly useful when you need to confirm the existence of data after test execution without a graphical interface. Key Concepts Scenario Overview: We previously created and published an article, validating its presence on the UI. However, in cases where the UI lacks validation pages, we can rely on API calls. API Validation: Instead of checking the UI, we will use API calls to confirm that the article was created in the backend. Steps to Validate Article Creation Using API Log in to your application and create a new article. Publish the article. Perform an API call to retrieve the list of all articles. Use $.title with double dot notation to extract titles from the response. Store the titles in a variable, e.g., list of titles . Assert that the created article's title is included in the list of titles . Clean up by deleting the article using its slug ID . Validation Example To validate, you can use the assertion: check that stored value list of titles itself contains "Test title article" This process demonstrates how to effectively perform API testing and validation by leveraging JSON paths to extract necessary data and making assertions based on that data. In summary, when UI validation is not possible, API calls can be a robust alternative for confirming the integrity of test data.