Automated tests on xUnit
Quick start guide to integrate Automated tests in BrowserStack Accessibility Testing with xUnit.
Prerequisites
- 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 pre-existing xUnit test suite integrated with BrowserStack Automate.
- You are using xUnit version 2.0 or above.
Integrate with Automated tests
Follow these steps to get started with adding Automated tests to your test suite:
The minimum version of BrowserStack SDK that supports Automated tests is 1.12.2
. To install a version of BrowserStack SDK that supports Automated tests, the minimum version of BrowserStack.TestAdapter
to be installed is 0.9.2
.
Install or update to the latest version of BrowserStack.TestAdapter
Go to your xUnit project’s root directory and run the following commands to install the BrowserStack.TestAdapter
from nuget.
The BrowserStack SDK for C# is currently not available on Mac computers with the M1 and M2 chip architecture.
Create the browserstack.yml file
Run the following command to create the browserstack.yml
file:
Set up the browserstack.yml file
Set up the browserstack.yml
file as in the following sample.
Especially, ensure to add the accessibility
flag at the end of the browserstack.yml
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 Automate since Automated tests will automatically identify different build runs.
-
Accessibility testing runs only on Desktops (Mac & Windows) with Chrome 100 & above on Automate.
-
Window handle commands might cause instability to Automated Tests. If you face issues, consider removing window handle commands or contact support.
Run your suite with Automated tests
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:
You can check the Accessibility report for your build through the Automated tests page.
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!