Accessibility Automation on NUnit
Quick start guide to integrate Accessibility Automation with NUnit
Pre-requisites
- You have an account with BrowserStack (even a free trial works) and can get your Username and Access Key from Account & Profile.
- You have a NUnit test suite which runs on BrowserStack Automate.
- You are using .NET version 5.0 or above and NUnit version 3.0.0 or above.
Integrate with Accessibility Automation
Follow the steps below to get started with adding Accessibility Automation to your test suite:
Install or update to the latest version of BrowserStack.TestAdapter
Go to your NUnit project’s root directory and run the following commands to install the BrowserStack.TestAdapter from nuget. The NUnit 3 Test Adapter allows you to run NUnit 3 tests inside Visual Studio or with dotnet on the command line.
dotnet add package BrowserStack.TestAdapter
dotnet build
Please ensure that you have at least BrowserStack.TestAdapter v0.2.1
before proceeding.
The BrowserStack SDK for C# is currently not available on Mac computers with the M1 and M2 chip architecture.
Create the browserstack.yml file
If you don’t already have a browserstack.yml file, run the following command to create one:
dotnet browserstack-sdk setup --username 'YOUR_USERNAME' --accessKey 'YOUR_ACCESS_KEY'
Set up the browserstack.yml file
Set up the browserstack.yml file as follows:
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 Automate since Accessibility Automation will automatically identify different build runs.
userName: YOUR_USERNAME
accessKey: YOUR_ACCESS_KEY
projectName: "Your static project name goes here"
buildName: "Your static build/job name goes here"
...
accessibility: true
Accessibility testing will only run on Desktops (Mac & Windows) with Chrome 95 & above on Automate.
Run your suite with BrowserStack Accessibility Automation
Continue running your tests as you have been running previously. The command to run your tests using the BrowserStack SDK remains unchanged. For your reference, here’s a sample command:
dotnet test --filter <EXPRESSION> [other_args]
Once the build has completed and the Accessibility report is ready, it will automatically get sent to the Accessibility Automation 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!