Page 1 of 1

The curious case of Control UI vanishing data

Posted: 02 Sep 2017 00:52
by husky
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

Re: The curious case of Control UI vanishing data

Posted: 02 Sep 2017 06:07
by Desmanto
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.

Re: The curious case of Control UI vanishing data

Posted: 02 Sep 2017 13:06
by husky
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

Re: The curious case of Control UI vanishing data

Posted: 02 Sep 2017 13:32
by Desmanto
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.

Re: The curious case of Control UI vanishing data

Posted: 02 Sep 2017 17:40
by husky
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

Re: The curious case of Control UI vanishing data

Posted: 02 Sep 2017 17:57
by Desmanto
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.