Page 1 of 1

UI Event Trigger: Source_Class_Name

Posted: 17 Aug 2020 01:48
by JC.INTERNET.STUFF
Hi,

I have some code here that doesn't seem to work. Does anyone have an idea why and how to correct it?

The source_class_name variable becomes available after the UI Event trigger. The value is "android_widget_Button" (text).

Examples Inside Script Trigger:
If source_class_name == "android_widget_Button"
{
true
}
else
{
false
}


Example 2 - Inside Expression Condition:
source_class_name == "android_widget_Button"

Thanks.

Julian

Re: UI Event Trigger: Source_Class_Name

Posted: 17 Aug 2020 07:19
by Desmanto
UI Event is the trigger. After trigger add condition as your second example

Code: Select all

source_class_name == "android_widget_Button"
True continue to your main branch of the flow. False do nothing (or something else if you need to).

If that still doesn't work, you need to explain first what you need achieve. Maybe there is another way to do it.

Re: UI Event Trigger: Source_Class_Name

Posted: 20 Aug 2020 08:02
by JC.INTERNET.STUFF
Hi,

The provided if and expression exampled oes not work. The result is always false.

I don't know what else I can tell you.

Julian

Re: UI Event Trigger: Source_Class_Name

Posted: 20 Aug 2020 08:10
by Desmanto
Which mean the event triggered the flow doesn't have "android_widget_Button". Add a condition debug dialog in the false branch and check the variable source_class_name value. Maybe there is different value at every trigger. In that case, you might want to use variable logger to log all the possible value : viewtopic.php?f=3&t=7285

Re: UI Event Trigger: Source_Class_Name

Posted: 20 Aug 2020 08:24
by JC.INTERNET.STUFF
The ....Button does exist.

This is why I have contacted support because the result is always false.

Is the syntax correct?

Julian.

Re: UI Event Trigger: Source_Class_Name

Posted: 20 Aug 2020 08:46
by Desmanto
The syntax is correct already, with double equal sign

Code: Select all

source_class_name == "android_widget_Button"
Use the debug dialog when the false is returned, scroll to find the source_class_name and copy the value from there, paste it back to the expression. You might have upper/lower case problem here.

BTW, what is the button/UI that trigger this flow?

Re: UI Event Trigger: Source_Class_Name

Posted: 20 Aug 2020 09:04
by JC.INTERNET.STUFF
Hi, fixed. There was a space at the end of the ....Button which I couldn't see.

There is now no issue.

Thanks for your help.

Julian