Hello community testproject
Please help me solve the problem. I need to test the application without connecting to bluetooth, and for this, before starting the test, check and disable (if necessary) the bluetooth setting of the device. I need to write a test for each tested device with disconnection steps in the settings, or is there some kind of universal way to disable / enable bluetooth in android.
Thanks, I hope for help
Hi @zeleznov.sergey,
You can use the action Execute Android shell command and run these commands
To turn on bluetooth :
adb shell am broadcast -a io.appium.settings.bluetooth --es setstatus enable
To turn off bluetooth :
adb shell am broadcast -a io.appium.settings.bluetooth --es setstatus disable
Please let me know if that solved your issue.
1 Like
thanks, this method solved the problem of on / off bluetooth on the device, and what is the command for on / off GPS?
Hi @zeleznov.sergey,
For GPS these are the commands
- Enable:
adb shell settings put secure location_mode 3
- Disable:
adb shell settings put secure location_mode 0
Kind regards
Tal
1 Like