How to use a switch on the button?


I have a tactile application which contains only buttons, I wanted to switch on the button, for example, if
testFunction.xaml (8.8 KB)
test.xaml (7.5 KB)
the value entered is 1, then it will click on 1.

to do this, I retrieve the bonton selector, I created 2 variables. which can be changed on each button.
the problem is that I do not know how to use a switch on the selector. I show you an example of the calculator to understand me what I did


Use Click activity and indicate that switch button and then share screenshot of that selector. So that we can check and help you.

1 Like

maybe dynamic selectors will help:

create a dynamic selector, just make sure that has a variable in it for the aaname attribute that uniquely identifies that particular button on your target application

then take the input from the user and have the switch statement and in that assign the corresponding value of that entered value

then have the selector that will use the value assigned in switch case

Thanks for u’re answer.


As you can see in the selector, automationid attribute holds the name of the button. You need to create dynamic selector by passing variable into automationid attribute value.

Have a look below thread to know about passing variable into the selector.