Skip to main content
No Result Found

Integrate Robot test suite with app accessibility testing

Learn how to add accessibility checks to your existing functional tests and generate comprehensive reports of accessibility issues.

BrowserStack supports out of the box integration with Robot. You can integrate your existing functional test suites with App Accessibility Automate to run accessibility checks on your mobile apps. You can access the generated accessibility violation reports on the App Accessibility dashboard.

For Android devices, App Accessibility automated tests are supported on version 11 and above.

Prerequisites

Integrate App Accessibility Automate to run accessibility checks

Set your BrowserStack Credentials

Save your BrowserStack credentials as environment variables to make it easier to run your test suite from your local or CI environment.

Set the following values in either your Zsh (~/.zprofile) or Bash (~/.profile) shell conifguration file.

export BROWSERSTACK_USERNAME=YOUR_USERNAME
export BROWSERSTACK_ACCESS_KEY=YOUR_ACCESS_KEY

Based on your testing platform, navigate to the Android or iOS directory.

cd robot-appium-app-browserstack/Tests/android

Modify the configuration file

The browserstack.yml file contains the necessary capabilities to run your tests on BrowserStack. This file is platform-specific, ensure you make changes to the file corresponding to your testing platform (Android or iOS).

  1. Open the browserstack.yml file in an editor.
  2. Add your userName and accessKey.
  3. Add the projectName and buildName.
  4. Set the framework as robot.
  5. Set the accessibility flag to true. By default, the flag is set to false.
  6. Configure the accessibilityOptions property to set various accessibility testing options. For details, see Configuration options.
  7. Add the relative or absolute path of the app you want to test in the app property. For example, app: ./examples/BStackSampleApp.apk. You can upload an Android app (.apk or .aab file) or an iOS app (.ipa file) from your local filesystem.
  8. Specify all the device, OS, and OS version combinations that you want to test in the platforms section.

The projectName and buildName config must be static and not change across different runs of the same build. This is a deviation in approach as specified by BrowserStack App Automate since Automated tests will automatically identify different build runs.

userName: YOUR_USERNAME
accessKey: YOUR_ACCESS_KEY
projectName: BrowserStack Samples
buildName: browserstack build
buildIdentifier: '#${BUILD_NUMBER}'
app: ./BStackSampleApp.ipa
framework: robot
platforms:
  - deviceName: iPhone 14
    osVersion: 16
    platformName: ios
  - deviceName: iPhone 12
    osVersion: 17
    platformName: ios
parallelsPerPlatform: 2
accessibility: true
accessibilityOptions:
  wcagVersion: wcag21aa
  includeIssueType:
    bestPractice: false
  scannerProcessingTimeout: 10
browserstackLocal: false
debug: false
networkLogs: false
consoleLogs: errors

Run the automated test

In the Python virtual environment, navigate to the platform folder and run the following command:

You must run the command in the Python virtual environment. Setting up the virtual environment is a prerequisite. For more information, see Run accessibility checks on a sample repo.

source env/bin/activate
cd Tests/android
browserstack-sdk robot SingleTestAndroid.robot

View the Accessibility test report

After the test completes, access the report in your project folder on the App Accessibility dashboard.


Visit App Accessibility dashboard

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback

Is this page helping you?

Yes
No

We're sorry to hear that. Please share your feedback so we can do better

Contact our Support team for immediate help while we work on improving our docs.

We're continuously improving our docs. We'd love to know what you liked





Thank you for your valuable feedback!

Talk to an Expert
Download Copy Check Circle