How to have UiPath find text and click next to that text

Hello! So I am pretty new to UiPath and am having trouble finding the right activity to perform this task.

I am looking to have the bot search a page for a certain character, *, and then click directly to the right of wherever that star is found. The star will just show up once on this page and will be in one of the rows of data that get populated from a query. I have seen some similar solutions but couldn’t really follow how to find the proper activity(ies) to solve this issue. Please let me know if there is any confusion on my problem!

Appreciate any and all help on this!

Can you provide an screenshot indicating the element you want to click?

Hey @justin.frank !

Here’s a few ideas to point you in the right direction.
What it sounds like you’re describing is a static, reliable element (the “certain character”) which you can use as the anchor and there’s a few ways you could leverage that activity’s output to get the element/thing you want.

You have a few options for actually getting the “anchor” and it widely depends on your use case and the environment you’re in.
If you’re in an environment that you don’t have access to selectors (RDC, Citrix, …) you’ll be limited to Find OCR Text Position, Find Image -like activities. But they both will return a UiElement which is what you need.


Now, let’s use your example we have a page and I’m looking for a certain character: *.
I’ll use Find OCR Text Position as an example to read the entire screen using a selector, maybe mstsc if I’m in Remote Desktop and it looks for my character. I assign the output UiElement to a variable: uie_Character.

I can do two things:

I can use an ANCHOR BASE activity, if the character is always to the LEFT of what I want then I would set the anchor direction to the LEFT and then my action on the right because my CLICK will always be to the right of my anchor, a reliable, static element I can reasonably and easily find.

Alternatively, you could employ a Set Clipping Region activity. Set the property Element to the uie_Character and then direction set to RIGHT, increase it by the typical/average/expected amount of pixel differences to the right. There are lots of other cool ways to manipulate the region using this, play with it!

Then you could configure the click activity to click the bottom right/top right of the region or however you manipulate the region so you can easily click what you want.

1 Like

Hi

Did we try with simple CLICK TEXT activity

Cheers @justin.frank

Thanks so much for this detailed response. Really appreciate that you were able to walk through it all at a high level that was easy to understand, this solution worked perfectly!

After implementing the solution given above, I found out that a simple Click Text activity using OffsetX would have done the trick. Appreciate the suggestion!

1 Like

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