This repository demonstrates how to run Appium tests in TestNG on BrowserStack App Automate using direct (non-SDK) integration.
-
Java 8+
-
Maven (Only required if using Maven as the build tool)
-
Gradle (Only required if using Gradle as the build tool)
To install the dependencies for Android tests, run :
cd android/testng-examples
mvn clean installOr,
To install the dependencies for iOS tests, run :
cd ios/testng-examples
mvn clean installGetting Started with Appium tests in TestNG on BrowserStack (Non-SDK Integration)
- Switch to one of the following directories: Android examples or iOS examples
- Set the following environment variables with your BrowserStack credentials and app URL:
BROWSERSTACK_USERNAME(your BrowserStack username)BROWSERSTACK_ACCESS_KEY(your BrowserStack access key)BROWSERSTACK_APP(your uploaded app URL, e.g.bs://<your-app-url>)
- For Maven: Run the following command to execute tests in the Maven environment:
mvn test -P sample-test - For Gradle: Run the following command to execute tests in the Gradle environment:
gradle clean sampleTest
-
Set the
browserstackLocalcapability totruein your test code if you want to enable local testing. -
You can use the
LocalSampleapp provided in both folders (Android examples or iOS examples) to run your test. Set theappcapability to the correct app URL. -
For Maven:
mvn test -P sample-local-test -
For Gradle:
gradle clean sampleLocalTest
Note: If you are facing any issues, refer Getting Help section
For other Java frameworks samples, refer to following repositories :
Note: For other test frameworks supported by App Automate, refer to our Developer documentation
If you are running into any issues or have any queries, please check Browserstack Support page or get in touch with us.
