Dynamic Selector : Appear Message "variable is not defined in the current scope" even if it's defined

Hi Team,

When we set dynamic selector in selector editor, “variable is not defined in the current scope” appears even if it’s defined. This occurs when default value of the variable is empty.
I think it’s bug and hope it will be fixed.

Environment : Studio 22.4.4 + UiAutomation 22.4.7

If default value is empty, the message is shown.

img20220908-1

If default value is set something, no problem.

Sample20220908-2.zip (7.9 KB)

Regards,

Hi @Yoichi

can you check if the same variable name is present in a different scope or with different lower/upper case

Hi,

This is bug report. Can you check the above attached sample (Sample20220908-2.zip)? Probably you can reproduce this matter.

Regards,

Hi @Yoichi

Could you please explain your use case?

On the first look, it is working as expected. The design time needs something to use when validating the selectors, and it uses the default value of the used variable.

Thus, having the default of the variable be empty throws an according message.

Is your use case requiring you to validate a selector with nothing for your value?

Hi @loginerror ,

Thank you for your reply.

I don’t think it’s proper message in this situation.
Most users think this means not default value isn’t set but variable isn’t defined, as the above linked topic.
In addition, this message is same as case that variable isn’t defined as the following.

Default value of the variable is empty.

The variable is not defined.

So, I hope the message will be reviewed. (For example, “Default value is not set” etc.)

Regards,

Hello - Has anyone found a solution to this issue? I am also facing this exact same problem.

I’ve just faced the same issue. Turns out as soon as I give it the default value, the message disappeared. Looks like the one of the guys above ( sorry for not knowing how to mention) said correctly. The error message should relate to the default value not the scope.