I am trying to pass variable in strict/fuzzy selector to make click button dynamic. Each time i am getting error “Variable and argument is not defined in the current scope”. I am using this click activity inside the same scope in which i have used “Assign” activity to create the variable.
Can anyone help me to know why i am getting this error. Thanks in advance.
The error is just because you’re in the selector editor, not running the automation - so the variable has no value. Just click OK and then test your automation.
@postwick Thanks for you response. I am not getting any error but still bot is not able to click on required button. I am trying to pass variable in Fuzzy selector for Anchor and also Fuzzy selector for target element but its not working. I am pasting Fuzzy selector for Anchor here.
Below Fuzzy selector is working fine.
"<webctrl name='frame2' tag='FRAME' /><webctrl name='OrderDetail' tag='FRAME' /><webctrl aaname=' Cluster Id Stack Id Managed Flag Entity Type [Entity Name] Soc *' parentid='contentWindowWithInfoPanel' tag='TABLE' /><webctrl type='' class='' tag='TD' aaname=' [Entity e007]' check:innerText='Router [Entity e007]' />"
Now I am passing variable to the selector as below which is not working as expected neither giving any error.
"<webctrl name='frame2' tag='FRAME' /><webctrl name='OrderDetail' tag='FRAME' /><webctrl aaname=' Cluster Id Stack Id Managed Flag Entity Type [Entity Name] Soc *' parentid='contentWindowWithInfoPanel' tag='TABLE' /><webctrl type='' class='' tag='TD' aaname=' {{New_Entity_Name}}' check:innerText='{{Entity_Name}}' />"
Here output for variable New_Entity_Name is “[Entity e007]” & Entity_Name is “Router [Entity e007]”.
Can you please suggest what I am missing here? Thanks
Your original screenshot shows spaces before and after New_Entity_Name in the aaname. You need to account for these in your dynamic selector - best thing would be to put an * before and after {{New_Entity_Name}} (do the same for innerText if it also has the spaces)
Issue has been resolved by using Strict selector as targeting method in Anchor selector and passing required variable into it and using Fuzzy selector as targeting method in Normal selector.