How do I make a bot click a button on a website when it reads specific numbers?

I made a bot that can read numbers on a website with the"GetOcrText" activity. I want to make the bot click a button on a website when it reads specific numbers, like 34, 55, 26, How do I do this? Thanks.

Hi @Uri22

You can use a ‘Click’ activity in order to perform the clicking action. You can pass the Get OCR Text variable into the selector to make it dynamic.

The selector might look something like this:

<wnd app='your_application_name' cls='your_application_class' title='your_application_title' />
<ctrl name='{variable_name}' role='push button' />

As you are passing the variable, the selector will dynamically select the text button.

Hope this helps,
Best Regards.


Once you placed the GetOCRText activity declare a Output variable

Now you can use IF Condition like GetOCRTextVariable.Equals(“34”) OR GetOCRTextVariable.Equals(“55”) OR GetOCRTextVariable.Equals(“26”)

In then part you can place a click activity and click the button

As @arjunshenoy said check if it is dynamic

Also you can use Switch activitiy as well

Use the GetOCRText activity outputVariable in Switch

And you can keep 34, 55, 26 in Cases Now place your click activity

Hope this may help you



If the button itself has the number then we can try with CLICK OCR TEXT activity directly on this

If the button is adjacent to the number in the website, in the same row of other elements then use a ANCHOR BASE Activity where in the left side of that activity use a FIND TEXT where pass the text found with GET OCR TEXT and in the right side use a normal CLICK activity

Cheers @Uri22

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.