Need to click on dynamic button in browser

Hi All,

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.

image

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.

close selector editor
give a valid default value to the variable

and try again

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

  1. 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]' />"

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

@himanshu-s

First if try using strict without anchor as well

And then try using wild cards round the variables

Cheers

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.

Thank to all for you response.

In the aaname attribute you have to put * and after that you have to pass the variable.

ex :- aaname=‘variableName

Please try this.

If it will not worked then brief me details

Thanks.