Page 1 of 1

Cannot reliably change a setting in Control UI

Posted: 17 Sep 2016 19:51
by Econdoc
I am trying to change the slidebar setting for Airplane Mode. Suppose that Airplane Mode is OFF and I want to toggle in ON. I can use Control UI to get to the Airplane Mode toggle… Settings> More
The Show Overlay screen now indicates a variety of things for that toggle button:
Check(“ON”)
Check(692,320)
CheckByld(“android:id/switchWidget”)
Click(“ON”)
Click(692,320)
ClickByld(“android:id/switchWidget”)
Uncheck(“ON”)
Uncheck(692,320)
unCheckByld(“android:id/switchWidget”)


Questions:
Do these commands show the current state of the control or are they possible actions to take on the control? This is very confusing! Are Check (692,320) and Click(692,320) actions? Are they interchangeable? Are they toggles?
Does check(“ON”) telling that the toggle IS on or does executing it does it TURN the toggle on?
What are Check/Click/UncheckByld? What does the name “Byld” stand for? States or actions?


I can get this work…sometimes, but not consistently. CheckByld(“android:id/switchWidget”)
works most of the time, but not consistently. What I am doing wrong? What is the best way to accomplish what I want to do?

Re: Cannot reliably change a setting in Control UI

Posted: 18 Sep 2016 17:22
by Martin
Hi,

The function click is a feature that most buttons provide (a switch and a checkbox is also considered to be a button in Android). Executing the click function in your case should change the state of the switch/slidebar to the opposite value (from checked to unchecked or from unchecked to checked).
The function check is only supported by switches/slidebars/check boxes/toggle buttons. Executing the function should leave the control in a checked state (activated/on), no matter what the state of the control was before. Uncheck is the opposite and should leave the control in an unchecked state (deactivated/off).

The "ON" in click("ON") comes from the fact that Automagic provides a way to find a control by the text of the control. For regular buttons this often makes sense since it will read like click("SHOW OVERLAY CONTROL"). For slidebars/switches, this text is set to ON/OFF by Android so it's quite confusing to read since click("ON") will actually turn the switch off. Additionally, "ON" is not a very good text to find the desired control since there could be another switch on screen that also reads as "ON". Using functions with coordinates like check(692,320) on screens that have many of the same controls is often the best way to execute operations on a control element.

Reliability issues of Control UI are mostly caused by timing problems when the action is executed before the desired screen with the control/button is displaying on screen. You can mitigate such problems by adding an action Sleep: 2s to the flow, before the action Control UI is executed to ensure that the screen is showing and Android had enough time to finish all transitions and animations.

Regards,
Martin

Re: Cannot reliably change a setting in Control UI

Posted: 18 Sep 2016 19:57
by Econdoc
Thanks for the reply, Martin.
In your lengthy answer, you did not address the actions
CheckByld(“android:id/switchWidget”)
ClickByld(“android:id/switchWidget”)
unCheckByld(“android:id/switchWidget”)

What does "Byld" stand for? This action appeared to work fairly well. I will try the Click(x,y) and see if it is more reliable.

Thanks.

Re: Cannot reliably change a setting in Control UI

Posted: 19 Sep 2016 08:07
by MURTUMA
ById = by IDentification. It is like the name of the button but not quite. It only provides another method to find the right element to execute the click,etc action. You should just try which one works most reliably and use that.