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
userNameandaccessKeyfrom 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, andAppium.WebDriverpackages. - .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
.apkor.aabformat, or an iOS app in.ipaformat.
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:
- Run the commands in the displayed order. The
dotnet buildcommand installs thebrowserstack-sdkcommand line tool that the next command needs. - When you run
dotnet buildfor the first time, the build succeeds with awarning MSB3073message. The warning appears because thebrowserstack.ymlfile 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.
- Open the
browserstack.ymlfile. - Set your BrowserStack
userNameandaccessKey. - Set your
projectNameandbuildName. - Set the
frameworktoreqnroll. - Set the
accessibilityflag totrue. The default value isfalse. - Configure the
accessibilityOptionsproperty to set the accessibility testing options. For details, see Configuration options. - Add the relative or absolute path of the app you want to test in the
appproperty. For example,app: ./BStackSampleApp.apk. The SDK uploads the app and reuses that app in later runs. - Specify all the device, OS, and OS version combinations that you want to test in the
platformssection. - 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.
Run the automated test
From the root directory of your project, run the following command:
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.
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!