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.

If default value is set something, no problem.

Sample20220908-2.zip (7.9 KB)


Hi @Yoichi

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


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


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.)


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.

Has anyone found a solution to this issue? I am having the same issue.

Screenshot 2023-07-24 at 10.06.28 am


Delete that activity and place the activity again and then indicate the element and pass the variable in the attributes in selector options window.

Make sure to check the override default value option when passing variable to selector.

It’s working when doing like this, already tried this it worked.

Hope it works!!