Run accessibility checks on a TestNG sample repo
Try out App Accessibility Automation with BrowserStack’s sample repository.
BrowserStack App Automate supports running TestNG tests on a wide range of real Android and iOS devices. You can integrate your existing TestNG test suites with App Automate to run accessibility checks on your mobile apps.
This guide helps you run your first TestNG test build on a real Android or iOS device on BrowserStack.
Prerequisites
- Ensure you have a BrowserStack Username and Access Key. Obtain your
userName
andaccessKey
from the Account & Profile section on the dashboard.
If you have not yet created an account, sign up for a free trial. - Ensure Maven or Gradle is installed, with environment variables configured and their
bin
directories added to the system$PATH
. - Ensure the following are installed on your system:
- TestNG v6.8 or higher
- Java 8 or higher. For Gradle, Java 9 or higher.
Run a sample build
Get the sample project
Get the BrowserStack sample TestNG project using one of the following options:
Option 1: Download repository
Download the sample TestNG repository to your system.
Option 2: Clone repository
Clone the sample Git repository using the following command:
git clone -b master https://github.com/browserstack/testng-appium-app-browserstack.git
Navigate to the sample project directory
Based on your test platform, navigate to the appropriate platform directory.
cd testng-appium-app-browserstack/android/testng-examples
cd testng-appium-app-browserstack/ios/testng-examples
Install the latest SDK
The minimum supported BrowserStack SDK version is 1.29.0
.
To install the latest SDK version, run the following command in your terminal:
mvn clean install
Modify the configuration file
The browserstack.yml
file defines the required capabilities to run tests on BrowserStack. It is platform-specific and located in the corresponding platform folder (android/
or ios/
). Make sure you modify the file that corresponds to your testing platform.
- Open the
browserstack.yml
file. - Set your BrowserStack
userName
andaccessKey
. - Set the
accessibility
flag totrue
. The default value isfalse
. - Set the
framework
totestng
. - Save the file.
Run the sample test
From your platform folder (Android or iOS), run the following command:
mvn test -P sample-test
View the Accessibility test report
After the test completes, view the report in your project folder on the App Accessibility dashboard.
Next steps
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!