Test execution using TestNG on BrowserStack.
- Clone the repo
- Install dependencies
mvn compile - Update the environment variables with your BrowserStack Username and Access Key
- To start a locally hosted website.
Website will open on
mvn -P start-server compile exec:javalocalhost:8000.
- Run a single test.
mvn -P desktop-single test - Run parallel tests.
mvn -P desktop-parallel test - Run a failed test.
mvn -P desktop-fail test - Run a local test.
mvn -P desktop-local test - Run parallel local tests.
mvn -P desktop-local-parallel test
- Run a single test.
mvn -P mobile-single test - Run parallel tests.
mvn -P mobile-parallel test - Run a failed test.
mvn -P mobile-fail test - Run a local test.
mvn -P mobile-local test - Run parallel local tests.
mvn -P mobile-local-parallel test
- Run a single test.
mvn -P android-single test - Run parallel tests.
mvn -P android-parallel test - Run a failed test.
mvn -P android-fail test - Run a local test.
mvn -P android-local test - Run parallel local tests.
mvn -P android-local-parallel test
- Run a single test.
mvn -P ios-single test - Run parallel tests.
mvn -P ios-parallel test - Run a failed test.
mvn -P ios-fail test - Run a local test.
mvn -P ios-local test - Run parallel local tests.
mvn -P ios-local-parallel test
- Run an Espresso test.
mvn -P espresso test
- Run a XCUI test.
mvn -P xcuitest test
- Clone the repo
- Install dependencies
./gradlew build - Update the environment variables with your BrowserStack Username and Access Key
- To start a locally hosted website.
Website will open on
./gradlew runlocalhost:8000.
- Run a single test
./gradlew clean desktop-single - Run parallel tests
./gradlew clean desktop-parallel - Run a failed test
./gradlew clean desktop-fail - Run a local test
./gradlew clean desktop-local - Run parallel local tests
./gradlew clean desktop-local-parallel
- Run a single test
./gradlew clean mobile-single - Run parallel tests
./gradlew clean mobile-parallel - Run a failed test
./gradlew clean mobile-fail - Run a local test
./gradlew clean mobile-local - Run parallel local tests
./gradlew clean mobile-local-parallel
- Run a single test
./gradlew clean android-single - Run parallel tests
./gradlew clean android-parallel - Run a failed test
./gradlew clean android-fail - Run a local test
./gradlew clean android-local - Run parallel local tests
./gradlew clean android-local-parallel
- Run a single test
./gradlew clean ios-single - Run parallel tests
./gradlew clean ios-parallel - Run a failed test
./gradlew clean ios-fail - Run a local test
./gradlew clean ios-local - Run parallel local tests
./gradlew clean ios-local-parallel
- Run an Espresso test
./gradlew clean espresso
- Run a XCUI test
./gradlew clean xcuitest
- You can view your Automate test results on the BrowserStack Automate dashboard.
- You can view your App-Automate test results on the BrowserStack App-Automate dashboard.
- To use specific number of threads:
- For Maven use
-Dthreads=<thread-count>. Example-Dthreads=3 - For Gradle use
-Pthreads=<thread-count>. Example-Pthreads=3
- For Maven use
- Apps used to test on Android:
- Demo App: WikipediaSample.apk
- Local App: LocalSample.apk
- Apps used to test on iOS:
- Demo App: BStackSampleApp.ipa
- Local App: LocalSample.ipa
- Resources used to test using Espresso:
- App: Calculator.apk
- Test-suite: CalculatorTest.apk
- Resources used to test using XCUITest:
- App: BrowserStack-SampleApp.ipa
- Test-suite: BrowserStack-SampleXCUITest.zip
- Export the environment variables for the Username and Access Key of your BrowserStack account.
export BROWSERSTACK_USERNAME=<browserstack-username> && export BROWSERSTACK_ACCESS_KEY=<browserstack-access-key>