Delete a Scan

This page is not available in the language you requested. You have been redirected to the English version of the page.
Link to this page copied to clipboard
Not for use with personal data

Scans can accumulate pretty quickly while testing for accessibility. After sending a scan to the axe DevTools Mobile Dashboard and determining it's no longer needed, use deleteResult to remove the scan from the dashboard. The ability to remove results no longer necessary helps highlight the scans in the dashboard that require attention.

Deleting a scan is only supported within automated testing.

Delete a Scan from the Result Key

When pushing a scan to the dashboard, a result key object is returned. Use the deleteResult API on the initialized axe DevTools object, with this key as a parameter, to remove the scan from the dashboard.

    var axe: axeDevTools?

    try axe.deleteResult(resultKey)

Full Example

In this snippet, the scan is removed from the dashboard if zero failures are found.

    var axe: axeDevTools?

    func testAccessibility() throws {
        guard let result = try axe?.run(onElement: app), let resultKey = try axe?.postResult(result) else
        {
            XCTFail("Result Unavailable")
            return
        }
            
        if result.failures.count == 0 {
            try axe?.deleteResult(resultKey)
        } 
    }