Skip to main content
No Result Found

Run accessibility checks on a Robot sample repo

Prerequisites

  • Ensure you have a BrowserStack Username and Access Key. You can obtain your username and access key from the Account & Profile section on the dashboard.
    If you have not yet created an account, sign up for a Free Trial.
  • Python3 and Pip3 are installed on your machine.

Run a sample build

Download or clone the sample test repository

Get our sample project using one of the following options:

  • Option 1:
    Download the sample test repository.
  • Option 2:
    Clone the sample Git repository using the following commands.
    git clone -b sdk https://github.com/browserstack/robot-appium-app-browserstack
    cd robot-appium-app-browserstack
    

Set up the Python virtual environment

Run the following command in your terminal or command-line:

python3 -m venv env
source env/bin/activate
pip3 install -r requirements.txt

Set up the dependencies

  1. Install BrowserStack Robot SDK.
    python3 -m pip install browserstack-sdk
    browserstack-sdk setup --framework "robot" --username "YOUR_USERNAME" --key "YOUR_ACCESS_KEY"
    
  2. Update Browserstack SDK to the latest version.
    pip install --upgrade browserstack-sdk
    
  3. Install robot framework, pabot, selenium library, and appium library.
    pip install robotframework robotframework-pabot robotframework-seleniumlibrary robotframework-appiumlibrary
    

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

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

Configure the browserstack.yml 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. Set the accessibility flag to true. By default, the flag is set to false.
  4. Set the framework as robot.

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 sample test

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

You must run the command in the Python virtual environment. For information on setting it up, see Step 2.

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

Next steps

Integrate Accessibility testing into App Automate.

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