With mabl's Xray-compatible export option, you can add test run artifacts from a mabl browser test run to an Xray test execution. The imported mabl test results include the step descriptions, expected result, actual result, and screenshots, if available.
By tracking mabl results in Xray, you can ensure compliance with industry standards, respond to audits, and provide better visibility into the testing process.
This article explains the process of exporting mabl test results into Xray:
Viewing mabl execution results in Xray
Initial setup
Before you start exporting test results, take the following preliminary steps to ensure that your mabl test results are compatible for Xray:
In Xray
Ask an admin of your Xray project to create a new test type option for mabl test runs. In the Options field, give the test type a name, such as "mabl". Set the Kind to "Steps".
In mabl
In mabl, set up an Xray integration on the Integrations page: Settings > Integrations.
- In the Project key field, enter the Xray project key where you want to import your mabl tests.
- In the Test type field, enter the test type option that you created in Xray and set up the Xray integration.
These settings ensure that the JSON export from mabl contains the necessary fields to import into the Xray project.
Export test run artifacts
Export mabl browser test output in an Xray-compatible format from the mabl app, mabl CLI, or mabl API.
From the app
To export Xray-compatible test results from the mabl app, take the following steps:
- Click on More actions (…) > Export test run artifacts.
- Check the Xray JSON box
- Click Export to download the file.
Exporting test run artifacts on the test output page
From the CLI
To export Xray-compatible test results from the mabl CLI, run the mabl test-runs export
command. Replace {TEST-RUN-ID}
with the actual test run ID ending in -jr
and use the --type
flag to specify xray_json
:
mabl test-runs export {TEST-RUN-ID} --type xray_json
The CLI downloads the export as a zip file.
From the API
To export Xray-compatible results from the mabl API, use the "run artifacts" endpoints in the Reporting API.
- Send a POST request to the create test run artifact endpoint . Include
"xray_json"
in the array for the"artifact_types"
field within the request body parameters. The POST request returns an export ID ending in-ex
. - Send a GET request to the get test run artifact export endpoint with the export ID. The mabl API returns a URL where you can access a zip file containing the export.
Import execution results into Xray
After exporting the JSON file from mabl, add it to an Xray test execution as execution results.
The imported mabl test results include the step descriptions, expected result, actual result, and screenshots, if available.
Viewing screenshots from a mabl test run in Xray