The curious case of Control UI vanishing data

Post your questions and help other users.

Moderator: Martin

Post Reply
User avatar
husky
Posts: 132
Joined: 29 Oct 2016 13:41
Location: Omaha, Nebraska, USA
Contact:

The curious case of Control UI vanishing data

Post by husky » 02 Sep 2017 00:52

Hello,

Here's something that is driving me nuts.

Let app GPS-Yes-No be the app the flow works on.

Let a partial flow be:

ControlUI= --> text=getText(X,Y), sleep(3000)
Notification on screen: {text}

Let "Off" be one of the expected values in text.

First execution of the flow: text returns "Off" as expected, Hurrah!

For the all excutions => close the input data (com.android.settings==>com.android.settings.Settings$LocationSettingsActivity)

that is being used to retrieve the "Off". A new copy will be loaded by the flow or so I think(?)

Let n be the number of successive runs of my flow.

The issue I'm running into:

After the first run of the flow and obtaining the "Off", further runs return NOTHING.

Litmus Test: (after all I was chemist some 45 years ago)

I intercepted the text returned after (n+1...n+m) executions.

1. All of them return NULL (text == "").
2. The problem does not go away by just restarting the Tablet (Samsung Galaxy Tab S3).
(Android 7.0)
3. From the Log: Object 'GPS-Yes-No' showing toast text ' '.
4. From Debug Dialog, text = blank
5. Notification on Screen: null( from the Log)

Question: Does this behavior have some explanation? What am I possibly doing wrong? or perhaps I could use some hints on how to further debug this. A lot of flows I have would be using this approach.

Thank You

Husky
"Basic research is what I'm doing when I don't know what I'm doing"

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: The curious case of Control UI vanishing data

Post by Desmanto » 02 Sep 2017 06:07

getText(x,y) usually not reliable. You should use getTextbyId(), more reliable. Control UI is quite difficult to help, as it is different from device to device. Sharing the screenshot may help to see the problem.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
husky
Posts: 132
Joined: 29 Oct 2016 13:41
Location: Omaha, Nebraska, USA
Contact:

Re: The curious case of Control UI vanishing data

Post by husky » 02 Sep 2017 13:06

Hi Desmanto,

Thanks for the reply.

First I'll try your suggestion and touch bases later on.

In the meantime, how do I share screenshot since .jpg cannot be sent to the forum. Also could you be more specific abou the screenshot.


Regards


Husky
"Basic research is what I'm doing when I don't know what I'm doing"

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: The curious case of Control UI vanishing data

Post by Desmanto » 02 Sep 2017 13:32

When you post, there is option to upload attachment. If you can't find it, you need to switch to full style (desktop view). Select your jpg, upload the file and add inline attahment.

Showing the screenshot of the screen you want to get that "off" text. Please edit it first to cover sensitive info (if there is). It would be better also if we can see the flow.

Just to make sure, to get that "off" text, the screen must be at that window that contains the "off" while the action getText() is executing. If the windows not appear, Control UI will just ignore that line and execute the next line without showing any error.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

User avatar
husky
Posts: 132
Joined: 29 Oct 2016 13:41
Location: Omaha, Nebraska, USA
Contact:

Re: The curious case of Control UI vanishing data

Post by husky » 02 Sep 2017 17:40

Desmanto,

I solved the problem. Aimed at the duck, shot my foot!

I tried the GetById. It didn't work.

So I switched to "Basic Research". That's what I do when I don't know what I'm doing.

Added a checkById in front of the getTextById. It worked.

I have no clue what the checkById does but solved the problem.

If you kow how it woks or what the checkById do certainly would be helpfull.


Regards


Husky
"Basic research is what I'm doing when I don't know what I'm doing"

User avatar
Desmanto
Posts: 2709
Joined: 21 Jul 2017 17:50

Re: The curious case of Control UI vanishing data

Post by Desmanto » 02 Sep 2017 17:57

Glad you solved it.

CheckById() is used to check the checkbox option. It is available when you tap checkbox element or slide on/off element. Example when you want to toggle wifi, bluetooth, GPS etc
Don't know why it works at your phone. Maybe it depends on the layout.
Index of Automagic useful thread List of my other useful posts (and others')
Xiaomi Redmi Note 5 (whyred), AOSP Extended v6.7 build 20200310 Official, Android Pie 9.0, Rooted.

Post Reply