Integration API PUT

Integration API PUT

Integration API PUT

Update a resource via API during your automated test

Many tests interact with backend services, not just the user interface. Whether you need to set up specific data, change configuration, or modify objects before later steps run, the Integration API PUT step lets your flow make an HTTP PUT request to a given API endpoint. This allows you to update an existing resource on a remote service as part of your automated sequence.

This capability gives you robust control over backend state without having to rely on setup outside of the test itself.

Why API updates matter in automation

Automated UI tests often depend on data already existing in a particular state. Rather than manually preparing that data before each run—or maintaining brittle UI setup flows—you can use API calls to shape your environment precisely.

Common reasons to use API PUT operations include:

  • Updating user profile details

  • Setting feature flags or config values

  • Adjusting test data before validation

  • Modifying backend flags to simulate special cases

  • Preparing a specific application state for the next steps

When your automation can update application state directly via API, you remove uncertainty and make tests faster, clearer, and more reliable.

How the step works

With Integration API PUT:

  1. Define the target API endpoint

  2. Specify headers (e.g., authentication tokens)

  3. Provide a JSON body representing the update

  4. Send the HTTP PUT request

  5. Optionally assert on the response

  6. Continue the flow once the update is complete

This gives you precise control over remote state without manual intervention.

Because PUT semantics are idempotent, you can repeatedly run the same update without unintended side effects, making your tests repeatable and deterministic.

Use dynamic values in requests

The real power of API integration comes when you combine it with DoesQA’s value system. For example:

  • Use values extracted earlier in the flow (like IDs or tokens)

  • Store dynamic output from previous API calls

  • Build the PUT body using stored or generated values

  • Pass authentication headers using stored tokens

This lets your update request adapt based on the context of each run, making your automation smart and reusable.

For example, after creating a resource earlier in the flow, you might:

  • Capture its ID

  • Update it with specific values

  • Confirm the update succeeded

  • Proceed to UI validation that depends on the update

This keeps your flow logically consistent from end to end.

Combine with UI and assertion steps

API updates are most useful when part of a broader test sequence. For example:

  • Use PUT to prepare data on the backend

  • Navigate to the UI page that reflects that data

  • Use Check Text to confirm UI reflects the updated state

  • Use Check Value to confirm fields are pre-populated

  • Use Touch to interact with updated elements

This approach ensures you test both the backend logic and the interaction that users experience.

Improve reliability and performance

Manual setup or UI-only flows for state preparation can be slow or brittle. Using API updates:

  • Reduces reliance on UI setup

  • Speeds up test execution

  • Reduces duplicate navigation steps

  • Makes test intent clearer

  • Keeps test data fresh and predictable

By controlling backend state where necessary, your automated tests become more efficient and easier to maintain.

Automating PUT operations as part of your test pack makes your coverage both deeper and more flexible, giving you confidence in both UI behaviour and backend logic.