Get your setup working faster. Join our Discord for optimisation tips from elite testers.Join our Discord
Appium with JUnit 5
Test your native and hybrid apps on a real device cloud. This guide helps you run your first test build on a real Android or iOS device on BrowserStack.
In this document, you’ll learn how to set up your JUnit 5 Appium testing environment, configure your test settings, and execute your first automated test on BrowserStack’s real device cloud. We’ll walk you through each step, from initial setup to viewing your test results on the dashboard.
Onboard faster with Test Companion
Launch in your IDE. Chat with the AI assistant to configure and run your first build instantly.
Launch in IDE
Opening Test Companion in your IDE
Prerequisites
You need to have BrowserStack Username and Access key, which you can find in your account profile. If you have not created an account yet, you can sign up for a Free Trial.
Environment & Build Tools:
For Maven: Java 8+ and JUnit 5. Ensure you have installed Maven by following the Maven installation guide and added it to your system PATH.
For Gradle: Java 9+. Ensure you have installed Gradle by following the Gradle installation guide and added it to your system PATH.
Required Plugin (Gradle + JUnit 5 only):
If you are using Kotlin with Gradle, you must configure the com.browserstack.gradle-sdk plugin in your build files to support parallel execution across multiple devices.
Run a sample build
Run a sample Junit 5 test build using your preferred method on BrowserStack:
The browserstack.yml file holds all the required capabilities to run your tests on BrowserStack. It is found in your project’s (android/ios) root folder and is part of downloaded sample.
Set access credentials
Set userName and accessKey parameters in the browserstack.yml file to authenticate your tests on BrowserStack.
Select Android or iOS devices from a list of 150+ available combinations:
Use one of our sample apps to run your first Appium test on BrowserStack App Automate. Choose from the options below:
Platform
Select an OS to choose the devices from below
Android
Android
iOS
Parallel thread
#1
Windows 10
Chrome 120
Parallel thread
#2
OS X Monterey
Safari 15.6
Parallel thread
#3
iOS 15
iPhone 13
Update the browserstack.yml config file
Copy and replace the platforms object in the browserstack.yml file.
After downloading the sample project, unzip it in the desired location.
Import the downloaded project
Click File>Import. Expand General, select Projects from Folder or Archive, and click Next. Then, navigate to the earlier unzipped downloaded project and open the junit-5 directory.
Configure your browserstack.yml config file
The browserstack.yml file holds all the required capabilities to run your tests on BrowserStack. It is found in your project’s (android/ios) root folder and is part of downloaded sample.
Set access credentials
Set userName and accessKey properties in the browserstack.yml file to authenticate your tests on BrowserStack.
Select Android or iOS devices from a list of 150+ available combinations:
Use one of our sample apps to run your first Appium test on BrowserStack App Automate. Choose from the options below:
Platform
Select an OS to choose the devices from below
Android
Android
iOS
Parallel thread
#1
Windows 10
Chrome 120
Parallel thread
#2
OS X Monterey
Safari 15.6
Parallel thread
#3
iOS 15
iPhone 13
Update the browserstack.yml config file
Copy and replace the platforms object in the browserstack.yml file.
After downloading the sample project, unzip it in the desired location.
Import the downloaded project
Click File > Open. Navigate to the earlier unzipped downloaded project and open the junit-5 directory.
Configure your browserstack.yml config file
The browserstack.yml file holds all the required capabilities to run your tests on BrowserStack. It is found in your project’s (android/ios) root folder and is part of downloaded sample.
Set access credentials
Set userName and accessKey properties in the browserstack.yml file to authenticate your tests on BrowserStack.
Select Android or iOS devices from a list of 150+ available combinations:
Use one of our sample apps to run your first Appium test on BrowserStack App Automate. Choose from the options below:
Platform
Select an OS to choose the devices from below
Android
Android
iOS
Parallel thread
#1
Windows 10
Chrome 120
Parallel thread
#2
OS X Monterey
Safari 15.6
Parallel thread
#3
iOS 15
iPhone 13
Update the browserstack.yml config file
Copy and replace the platforms object in the browserstack.yml file.