Skip to main content
🎉 A11y Issue Detection Agent is now live! Detect accessibility issues like a WCAG expert with AI. Try now!
No Result Found
Get your setup working faster. Join our Discord for optimisation tips from elite testers. Join our DiscordJoin our Discord

Integrate Reqnroll test suite with App Accessibility testing

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

Reqnroll is a behavior-driven development framework for .NET. BrowserStack App Accessibility supports Reqnroll test suites on a wide range of real Android and iOS devices. You can add accessibility checks to your existing functional test suite and review the generated accessibility violation reports on the App Accessibility dashboard.

Automated App Accessibility testing supports Reqnroll only with the MSTest runner. If your suite uses the NUnit or xUnit runner, your tests run as usual, but accessibility scans don’t run and the report isn’t generated.

For Android devices, automated App Accessibility testing is supported on version 11 and above.

Prerequisites

  • Ensure you have a BrowserStack Username and Access Key. Obtain your userName and accessKey from the Account & Profile section on the dashboard.
    If you have not yet created an account, sign up for a free trial.
  • An existing Reqnroll test suite that uses the MSTest runner.
  • Your project references the Reqnroll.MsTest, MSTest.TestFramework, MSTest.TestAdapter, and Appium.WebDriver packages.
  • .NET version 5.0 or later, up to .NET 9. Version 10 and above isn’t supported.
  • Appium installed on your system. You need Appium only to run or debug your suite locally, not to run your tests on BrowserStack.
  • Access to an Android app, in .apk or .aab format, or an iOS app in .ipa format.

If you switch an existing suite from the NUnit runner to MSTest, delete the obj and bin folders before you build. Also delete the Reqnroll generated code files, such as <feature-name>.feature.cs. The dotnet clean command leaves these files in place, and the build fails with a CS0246: The type or namespace name 'NUnit' could not be found error.

Integrate App Accessibility Automate to run accessibility checks

Set your BrowserStack credentials

Save your BrowserStack credentials as environment variables 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

Install the BrowserStack SDK

From the root directory of your project, run the following commands to add the BrowserStack SDK and create a browserstack.yml file:

Copy icon Copy
  • Run the commands in the displayed order. The dotnet build command installs the browserstack-sdk command line tool that the next command needs.
  • When you run dotnet build for the first time, the build succeeds with a warning MSB3073 message. The warning appears because the browserstack.yml file doesn’t exist yet.

Modify the configuration file

The browserstack.yml file defines the capabilities used to run your tests on BrowserStack. The setup command creates this file for desktop browser testing, so replace its contents to test an app on real devices.

  1. Open the browserstack.yml file.
  2. Set your BrowserStack userName and accessKey.
  3. Set your projectName and buildName.
  4. Set the framework to reqnroll.
  5. Set the accessibility flag to true. The default value is false.
  6. Configure the accessibilityOptions property to set the 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: ./BStackSampleApp.apk. The SDK uploads the app and reuses that app in later runs.
  8. Specify all the device, OS, and OS version combinations that you want to test in the platforms section.
  9. Save the file.

To auto-generate screen reader testing reports for your app’s workflow, set the screenReaderAutomationReport flag to true under accessibilityOptions.

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.

browserstack.yml
Copy icon Copy

Run the automated test

From the root directory of your project, run the following command:

Copy icon Copy

To run a subset of your scenarios, add the --filter argument to the command.

A test run can pass without accessibility checks running. To confirm that the checks ran, open the App Accessibility dashboard. If no report appears on the dashboard, open the log/adapter.log file in your project folder and look for an accessibility warning. To see the response from BrowserStack, set logLevel to debug in browserstack.yml and run the test again.

View the accessibility test report

After the test run completes, open the App Accessibility dashboard to review the violations found in each scan.


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