Getting text of clicked element with click triggers in monitor events

Hello, I’m trying to monitor user input on a target application, which has buttons with text inside. I would like to capture the text of the buttons clicked by the user. Is it possible?

The problem so far is that all activities I see in UiPath to get text require to specify at implementation time the UI element selector, and so they do not get the element at runtime (i.e. the clicked one).

Hi @danielegts

You could look into the Monitor Events activity? It might help you achieve what you want:
image

Hi @loginerror, thanks for the response. Actually that is exactly what I’m using, but I can’t understand from the docs if and how I can monitor more buttons and then get the UI object (or at least the text) only of the clicked one…

This should give you a clue:

Basically, you can use the Trigger activities to monitor certain events. Then, you can use the Get Source Element activity to return a variable of type UiPath.Core.UiElement that will allow you to take actions on it :slight_smile:

4 Likes

Hey loginerror,

I am attempting to get the source element from a Mouse Trigger event. Is this possible? I save the element as a variable in the get source element activity, but my click element activity fails later in the sequence when I attempt to specify the sourceElement variable as the element to click.

Hi @EO_CPA

Welcome to our UiPath Forum :slight_smile:

What is the error that you are getting? It would seem to me that the selector for the element could be changing between the moment you capture it into the variable and when you reuse it later on.

Thanks for the welcome. I probably broke forum protocol, but started a new thread in the link below for my specific issue.

Get Source Element from Mouse Trigger Event

The error I get is “Click generic error”
The error I get when I check the “Simulate Click” box is “Action is not supported by this type of element. Please use another type of click.”

1 Like