My Application under test has policy to disable the bluetooth. Is there any way with appium to check whether bluetooth if on or off.
I see networkconnection settings API that gives wifi, data and airplanemode off or on.
Similarly is there an API to check blueooth?
String text = button.getText(); //giving Bluetooth
boolean status = button.isEnabled(); //true but this is not toggle value
if (button != null){
TouchAction ta = new TouchAction(driver);
TouchAction y = ta.moveTo(button).tap(button).perform(); //taking to next screen related to bluetooth, to show any devices to scan etc.
}
From the screenshot, The resourceid of all toggle values seems same. So how to exactly get the off/ on value of blueooth only?
Jonahss,
This is on HTC device. But Samsung we do not have “off” text below Bluetooth. We need to find a way unique to all devices.
So i was thinking how we can get the toggle value right side to the bluetooth button.
Is there a way to get the value of the element which is at the RIGHT-hand side of the bluetooth element?
FYI, the element at the right hand side has attributes (screenshot in above discussion) like checked. if blueooth is on, the checked value is true, otherwise false. How to get this value?
I am not seeing any get method to get all the attributes of the element. I see getAttribute(String) in JAVA client. But passing “checked” as parameter to the function always giving false.
Is there any way to get the attributes of the element?