Run Command - adb
Description
This command allows you to run adb commands or other device shell commands.
You can use the run command to execute adb and shell commands in runtime while executing your test. You can open the settings or wifi settings menu, push a file to SD card, and even call a number.
Parameters
Name | Value | Description |
---|---|---|
Command | string | Command to run |
This is supported on Android only.
Usage
info
Replace <server> with the appropriate URL.
- Public Continuous Testing Cloud - https://cloud.seetest.io/wd/hub/.
- Dedicated Continuous Testing Cloud environment - Your own domain. For example: https://company.experitest.com/wd/hub/
- On-premises Continuous Testing Cloud environment - Your designated URL. For example: https://company.com/wd/hub
Example
Using Run Command
driver = new AndroidDriver(new URL("<server>"), dc);
seetest = new SeeTestClient(driver);
...
...
// open android settings
seetest.run("adb shell am start -a android.settings._SETTINGS");
// open wifi settings
seetest.run("adb shell am start -a android.settings.WIFI_SETTINGS");
// push a file to SD storage
seetest.run("adb push C:\\Users\\myuser\\Pictures\\myPicture.png /sdcard/Pictures/myPicture.png");
// call a number
seetest.run("adb shell am start -a android.intent.action.CALL -d tel:+6512345678");