How to click a button at a same place but different name

I’m new to UiPath and uncertain if I’m utilizing the right tools. My objective is to click a button consistently positioned on the screen, but the button’s label changes with each instance.

This particular challenge is part of my workflow. When searching for an individual in Teams, I intend to click the ‘Top hits’ button, which always corresponds to the first person displayed. However, I should refrain from clicking it for subsequent searches with different names. Could you kindly guide me on how to resolve this?

Hello @nien_shan_thai

  1. Capture the changing label (e.g., person’s name).
  2. Create a dynamic selector with a variable for the changing text.
  3. Use the dynamic selector in a “Click” activity to click the button.
  4. Repeat for subsequent searches.

Thanks & Cheers!!!

Hi,
You can inspect the selector for the button and use wild cards(*) to replace the name which keeps changing. Refer below link to understand using wildcards:
https://docs.uipath.com/studio/standalone/2023.10/user-guide/selectors-with-wildcards

Thank you for your guidance.

However, when I attempted to ‘Indicate on Screen’ within Notepad, I received the following prompt: “The indicated element does not belong to the target application/browser.” Should I make any Studio configurations before attempting ‘Indicate on Screen’?

Your assistance is greatly appreciated.

Thank you for providing your solution.

May I know how to create a dynamic selector in Studio? Is it following this link: https://docs.uipath.com/studio/standalone/2023.10/user-guide/selectors-with-wildcards

Thank you in advance for your help.

Hi @nien_shan_thai ,
This error occurs because you are trying to indicate the selector in another application which you haven’t used in the ‘Use application/browser’ activity.
You need to indicate the application first.

1 Like

@nien_shan_thai

  1. In use application/browser indicate the same application where you want to indicate the elmenet
  2. For clicking first always…find a selector which does not contain innertect and contains tag and use idx …also if there is class which is same across can use that also…to find selector…use ui explorer and use the tight top panel to select and deselect the items that you need …Below is a sample selector which the actual selector should look like

<webctrl tag='BUTTON' class='xyz' idx='1' />

Hope this helps

Cheers

Thank you for your guidance. I apologize for the delayed response as I completed it during my free time. I have successfully managed to accomplish the task using keyboard shortcuts. Thank you very much for your helpful guidance.

Thank you for providing your guidance. Apologies for the delay in my response, as I managed to complete the task during my free moments. I successfully achieved the task utilizing keyboard shortcuts, all thanks to your valuable advice.

Much appreciated.

1 Like