Attach custom operational metadata to your scan sessions when running automated accessibility tests with Level Access testing software development kits (SDKs). This guide explains how to bundle name and value pairs in the openScanSession call across supported programming languages.
On this page:
- Metadata specifications and constraints
- Add metadata by programming language
- Retrieve metadata downstream
- Related articles
Starting in Access Continuum 7.14, you can pass structured name and value pairs directly into openScanSession using the optional metadata attribute. This separates human-readable scan titles from machine-readable operational details.
Note: Scan-level metadata is currently accessible only to clients retrieving scan results programmatically through platform application programming interfaces (APIs). These values do not appear in the Level Access Platform web interface yet.
Metadata specifications and constraints
Ensure your metadata entries follow these platform rules:
| Property | Rule and constraint |
|---|---|
| Entry limit | Maximum of 20 key and value pairs per scan session. |
| Key format | Keys can contain only letters, numbers, underscores, and hyphens (matching ^[A-Za-z0-9_-]+), up to 50 characters. |
| Value format | String values up to 1,000 characters per entry. |
| Backward compatibility | Metadata is completely optional. Existing calls to openScanSession that only pass a title continue to work without changes. |
Add metadata by programming language
Review the following examples to add metadata in your preferred testing framework. Java and JavaScript are the most common languages used with Level Access testing SDKs.
Java
Java is commonly used with our Mobile SDK and Appium test suites. In your step definition or test runner (such as WebPageSteps.java), import java.util.Map and pass the metadata map as the second parameter to openScanSession:
import java.util.Map;
// Construct metadata key and value pairs (up to 20 entries)
Map<String, String> metadata = Map.of(
"stage", "qa",
"appVersion", "2.14.0",
"buildId", "123adslfjsadlkfj",
"pipeline", "mobile-nightly-regression",
"commitSha", "9f8e7d6"
);
// Open scan session with session title and metadata
lapReportingService.openScanSession("Checkout Flow - iOS", metadata);
Method signature:
public void openScanSession(String sessionName, Map<String, String> metadata)
JavaScript
In your JavaScript or TypeScript step definitions (such as Playwright, Cypress, or WebdriverIO), pass metadata inside the options object:
const metadata = {
stage: 'qa',
appVersion: '2.14.0',
buildId: '123adslfjsadlkfj',
pipeline: 'mobile-nightly-regression',
commitSha: '9f8e7d6'
};
await lapReportingService.openScanSession({
sessionName: 'Checkout Flow - iOS',
metadata
});
Method signature:
async openScanSession({ sessionName, workspaceId = null, digitalPropertyId = null, scanTagId = null, baseUrl = null, metadata = null })
Python
In your Python test runner (such as pytest or Behave), provide a dictionary using the metadata keyword argument:
metadata = {
'stage': 'qa',
'appVersion': '2.14.0',
'buildId': '123adslfjsadlkfj',
'pipeline': 'mobile-nightly-regression',
'commitSha': '9f8e7d6'
}
lap_reporting_service.open_scan_session('Checkout Flow - iOS', metadata=metadata)
Method signature:
def open_scan_session(self, session_name, workspace_id=None, digital_property_id=None, scan_tag_id=None, base_url=None, metadata=None) -> None
C# (.NET)
In your C# test class, construct a Dictionary<string, string> and pass it as a named argument:
using System.Collections.Generic;
var metadata = new Dictionary<string, string>
{
{ "stage", "qa" },
{ "appVersion", "2.14.0" },
{ "buildId", "123adslfjsadlkfj" },
{ "pipeline", "mobile-nightly-regression" },
{ "commitSha", "9f8e7d6" }
};
await lapReportingService.OpenScanSession("Checkout Flow - iOS", metadata: metadata);
Ruby
In your Ruby step definition, supply a hash as the sixth positional argument. Pass nil for intermediate optional parameters:
metadata = {
'stage' => 'qa',
'appVersion' => '2.14.0',
'buildId' => '123adslfjsadlkfj',
'pipeline' => 'mobile-nightly-regression',
'commitSha' => '9f8e7d6'
}
# Pass nil for workspace_id, digital_property_id, scan_tag_id, and base_url
@lap_reporting_service.open_scan_session('Checkout Flow - iOS', nil, nil, nil, nil, metadata)
Method signature:
def open_scan_session(session_name, workspace_id = nil, digital_property_id = nil, scan_tag_id = nil, base_url = nil, metadata = nil)
Retrieve metadata downstream
When tests complete, the reporting service sends your metadata alongside the scan results to the Level Access Platform. Downstream automated systems can query the scan via Level Access Platform APIs to retrieve the attached metadata object, ensuring reliable correlation with build numbers, deployment stages, and pull requests.
Comments
0 comments
Article is closed for comments.