- Clone this script directly from our GitHub repo:
mkdir kobiton-samples
cd kobiton-samples
git clone https://github.com/kobiton/samples.git
cd samples/uiautomator-espresso/java/
- Open Java project in IntelliJ IDEA.
- Go to Kobiton Devices page.
- Hover over the device you want to test, click on the More icon then select Automation Settings.
- Select Framework = UIAutomator/ Espresso.
- Select Language = Java.
- Input the value for
username
&apiKey
& in the sample script.
String username = "";
String apiKey = "";
- Update the value for
deviceName
(you also can useplatformVersion
orudid
) to indicate your exptected testing device.
Run separate files by right-click on each file and select Run UIAutomator.main()
or Run Espresso.main()
.
- When you see your test has the response message that
Session is started.
, you can access Session Page to get your test status.
Response body: { kobitonSessionId: 98363, message: 'Session is started.' }
If you want to run the test scripts with your application, please:
- Input the value for
app
with your application under test. Theapp
value can be a direct link or you can upload your app to the Kobiton Stores and get the appId.
- At
Automation Settings
, scroll down to upload the test runner to Kobiton repository and get the downloadable link, then input the value fortestRunner
.
- Put your tests you want to run at
tests.add()
- Run your test scripts and enjoy the results.