Advanced AI Verification

Fetch and Reuse Dynamic Data in ContextQA Test Cases

Dealing with dynamic values like random IDs or reference numbers can make automated testing tricky. Instead of relying on hard-coded data that quickly becomes outdated, ContextQA lets you fetch these values, store them, and reuse them in later steps. This approach makes your test cases more robust, flexible, and maintainable.

Let’s walk through how to capture a dynamic ID generated by your application and use it in another test step—no hard coding required.

Trigger the random ID generation.

Image

Click the generate again button to create a new ID.

Image

Verify that the system generates a valid ID. Note that every test run creates a brand new ID.

Decide where you want to reuse the ID, such as a search field elsewhere on the page.

Open ContextQA and go to your test case. Use the Record button to add your actions.

Image

Click Start recording to capture the search action.

Image

Click the search button and enter any four letters to create a sample test step.

Image

After the test step where the random ID appears, click Add Step.

Image

Choose NLP AI. In the query, enter:

What is the 4 digit ID generated? Provide me the ID only.

In the test data field, enter a variable name like Generated ID.

Image

Copy the variable name and add it to the test step description. Click Create to save.

Image

Update the search step to use the Generated ID variable instead of a hard-coded ID. Remove the old value and insert the variable.

Image

Save your test. Now whenever the test runs, ContextQA will fetch the current random ID, store it in the variable, and reuse it automatically in the next relevant step.

Run the test case to watch your dynamic value flow.

Image

You’ll see that a new ID is generated, fetched by AI, stored in the Generated ID variable, and used in the search—without any manual updates or fragile hard coding.

By using AI-powered data extraction in ContextQA, you can handle dynamic data with ease. You'll eliminate brittle tests, minimize maintenance, and cover complex, real-world scenarios—making your automation truly reliable.

Supporting Videoarrow-up-right

Last updated