Integrate Leapwork Go with CI/CD Pipelines | Leapwork Docs
This guide shows how to run Leapwork Go tests from a CI/CD pipeline, wait for the result, and collect reports for later review.
What You Can Automate
A typical pipeline integration follows this sequence:
- Submit a performance test run to Leapwork Go.
- Capture the
runIdand polling URL from the API response. - Poll the run status until the run is complete.
- Download the generated reports.
- Mark the pipeline as passed or failed based on the result.
Integration Flow
Prerequisites
Before you build the integration, make sure you have:
- Access to a Leapwork Go environment.
- An API key with permission to start and read integration runs.
- The asset IDs or names required for the test you want to execute.
- A CI/CD agent that can make outbound HTTPS calls to the Leapwork Go API.
- Permission in your pipeline environment to store secrets securely.
Authentication
Use an API key when calling Leapwork Go from your pipeline. Store the key in your CI/CD secret store and inject it into the job at runtime.
Example header:
Step 1: Start a Test Run
Submit a request to the run endpoint.
Example request body:
A successful response returns identifiers and a URL you can use for polling.
Example response fields:
Step 2: Poll for Completion
Poll the status endpoint until the run reaches a terminal state.
During execution you may see statuses such as:
AuthenticatingPreparingRunning
Terminal states are:
FinishedFailedStopped
Your pipeline should keep polling while the run is still active, then stop when it reaches a terminal state.
Step 3: Download Reports
When the run is complete, download the report URLs returned by the API response.
Typical outputs include:
- Excel report
- AI analysis report
These can be published as pipeline artifacts so teams can review them after the build.
Optional: Stop a Run Early
If your pipeline times out or you need to cancel the execution, call the stop endpoint with the runId.
Azure DevOps Example
The Azure DevOps pattern is usually:
- Store the API key as a secret pipeline variable.
- Run a script step to submit the test run.
- Parse the response and save the
runIdandpollResultUrl. - Run a second script step to poll until completion.
- Publish the downloaded reports as build artifacts.
Example pipeline shape:
Jenkins Example
The Jenkins pattern is similar:
- Store the API key in Jenkins credentials.
- Load the credential into the pipeline environment.
- Run a script to start the test.
- Poll until completion.
- Archive the downloaded reports.
Example pipeline shape:
Attachments
Please open each link, copy the full file content, paste it into a local file, and save it with the original filename. Included attachments:
azure-pipelines.yml- azure-pipelines.ymlrun-integration.ps1- run-integration.ps1poll-integration-status.ps1- poll-integration-status.ps1Jenkinsfile- JenkinsfileREADME.txt- README.txt
Validation Checklist
After setup, confirm that your pipeline can:
- Authenticate successfully with the API key.
- Start a new performance run.
- Poll until the run reaches a terminal state.
- Download the expected reports.
- Fail the build when the run result is unsuccessful.
Troubleshooting
If the integration does not work as expected, check the following first:
- The base URL points to the correct Leapwork Go environment.
- The API key is valid and passed in the required header.
- Required IDs in the request payload belong to assets that exist in your environment.
- The build agent can reach the API endpoints over the network.
- The polling logic stops only on terminal statuses.