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 testing to run accessibility checks on mobile apps. You can access the generated accessibility violation reports on the App Accessibility dashboard.
For Android devices, automated App Accessibility testing is supported on version 11 and above.
Prerequisites
- Ensure you have a BrowserStack Username and Access Key. You can obtain your
userName
andaccessKey
from the Account & Profile section on the dashboard.
If you have not yet created an account, sign up for a free trial. - Ensure you have a functional Robot test suite. To set one up, see Run accessibility checks on a sample repo.
- Python3 and Pip3 are installed on your machine.
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 configuration file.
export BROWSERSTACK_USERNAME=YOUR_USERNAME
export BROWSERSTACK_ACCESS_KEY=YOUR_ACCESS_KEY
In your terminal or command line prompt, enter the following command:
setx BROWSERSTACK_USERNAME "YOUR_USERNAME"
setx BROWSERSTACK_ACCESS_KEY "YOUR_ACCESS_KEY"
set BROWSERSTACK_USERNAME=YOUR_USERNAME
set BROWSERSTACK_ACCESS_KEY=YOUR_ACCESS_KEY
Navigate to the platform folder
Based on your testing platform, navigate to the android
or ios
directory.
cd robot-appium-app-browserstack/Tests/android
cd robot-appium-app-browserstack/Tests/ios
Modify the configuration file
The browserstack.yml
file defines the required capabilities to run tests on BrowserStack. It is platform-specific and located in the corresponding platform folder (android/
or ios/
). Make sure you modify the file that corresponds to your testing platform.
- Open the
browserstack.yml
file in an editor. - Set your BrowserStack
userName
andaccessKey
. - Add the
projectName
andbuildName
. - Set the
framework
asrobot
. - Set the
accessibility
flag totrue
. The default value isfalse
. - Configure the
accessibilityOptions
property to set various accessibility testing options. For details, see Configuration options. - 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. - Specify all the device, OS, and OS version combinations that you want to test in the
platforms
section. - Save the file.
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 (Android or iOS) 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
browserstack-sdk robot SingleTestAndroid.robot
source env/bin/activate
browserstack-sdk robot SingleTestiOS.robot
View the Accessibility test report
After the test completes, access the report in your project folder on the 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
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!