Not recognizing IDX='n'

I have 1 through 25 occurrences of an element that I need to Click on. I can dynamically build the selector string using a counter. I have identified the string that I need to identify the element with UI Explorer and it looks like this:

where of course the ‘1’ varies from 1 through 25
I can ‘Highlight’ with UIExplorer and the first occurrence is highlighted; change idx=‘2’; validate and highlight again and the second occurr
ence is highlighted but when I run the automation to ‘Click’ with the target selector set as above it fails telling me that
Click FullName: Multiple similar matches found.

Could not uniquely identify the user-interface element for this action.
Edit the element, run Validation, and add anchors in order to ensure the element is uniquely identified.




here is the complete exception that gets thrown:
RemoteException wrapping UiPath.UIAutomationNext.Exceptions.NodeAmbiguousException: Multiple similar matches found.

Could not uniquely identify the user-interface element for this action.
Edit the element,
run Validation,
and add anchors in order to ensure the element is uniquely identified.
at UiPath.UIAutomationNext.Activities.TargetCommonLogic.d__13.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.UIAutomationNext.Activities.NClick.d__30.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at UiPath.UIAutomationNext.Activities.Services.VerifyExecutionService.d__4`1.MoveNext()
— End of stack trace from previous location where exception was thrown —
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.ValidateEnd(Task task)
at UiPath.UIAutomationNext.Activities.NClick.d__29.MoveNext()
— End of stack trace from previous location where exception was thrown —
at UiPath.Shared.Activities.AsyncTaskCodeActivityImplementation.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at UiPath.Shared.Activities.AsyncTaskCodeActivity.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at UiPath.Shared.Activities.ContinuableAsyncCodeActivity.EndExecute(AsyncCodeActivityContext context,
IAsyncResult result)
at System.Activities.AsyncCodeActivity.System.Activities.IAsyncCodeActivity.FinishExecution(AsyncCodeActivityContext context,
IAsyncResult result)
at System.Activities.AsyncCodeActivity.CompleteAsyncCodeActivityData.CompleteAsyncCodeActivityWorkItem.Execute(ActivityExecutor executor,
BookmarkManager bookmarkManager)

Hi,

I understood correctly you want to place an int variable in idx attribute, right?
If so, it should rather look like <some selector values idx=‘{{intNumber}}’
Could you please send the whole selector?

Regards,
Kamil

Hello, I just looked at this project idea of yours and I remembered a great function present in UiPath that can help you a lot, it’s called: table extraction, being possible to perform these extractions dynamically and returning in a data table where you can apply cycles (loop).
image

Unfortunately Data Table Extraction does just that: extracts text from fields. I need to interact with the fields. I don’t really care what the text is.

That looks promising. I will give that a try. Thanks.
Here is what I had in an assign statement and then use the object of that in the ''Click" target:
“”

1 Like

Let me know how it goes. Also, I think you have pasted empty “Target” in the response :wink:

Unfortunately same result. It’s not recognizing the IDX=‘1’

The fourth screen shot shows the full selector

Are you sure you do not have another tab opened with similar items?
Also, good troubleshooting is to log/write line the selector so that we will see what selector was used.
I think it would be easier to make a quick call and see what the issue is.
Is it premium linkedin page or the standard one?

There is no other tab open. I would very much appreciate a call. It is with LinkedIn Recruiter which most people wouldn’t have access to.

You should be using For Each Ui Element, then you don’t have to manage all this incrementing and stuff.

1 Like

That is much cleaner and I will give it a try. But within the Do of the For Each… I want to click on the element. Aren’t I still going to be faced with the dilemma of configuring a unique selector for that element for the Click activity?

No. It identifies all the matching elements for you and loops through them. Inside the For Each Ui Element you will reference the current Ui Element in the loop by using the variable:

Awesome. Thanks

Question though. If I identify multiple elements/columns much like in the Extract Data Table, how do I identify the corresponding column x for CurrentElement in a selector?

You don’t. That’s not what the activity is doing. It loops one-by-one through the UI Elements. There are no columns. And you don’t need selectors. CurrentElement IS the UI element, the object. You use that in other activities like I did in the Click example. That Click activity has no selector, it doesn’t need one. CurrentElement tells it what to click.

Turns out this doesn’t work either. On the first test it seemed to work but when I reloaded the page and tried again, the For Each Element fails stating that no elements can be found. When I check the selector, sure enough it had used values that will change every time the page is created. So I edit the selector to get back to something generic enough that it won’t change and it verifies just fine with UI Explorer even to be able to highlight the first occurrence but when I run the project in debug it fails, still telling me that no elements can be found on the page.

Show us what you’re working with, the selector(s) etc.

“”



You can see in the screen shots that UIExplorer has no trouble highlighting the first occurrence. But this selector would be the same for all 25 occurrences on the page. It is the IDX value and only the IDX value that differentiates them with terms that don’t change from one access to the next

You don’t want to differentiate with For Each UI Element. You want it to identify all the duplicate items. IDX is irrelevant with For Each UI Element, and you should never use it otherwise anyway.

All you should have to do is add the For Each UI Element activity, click the Indicate button, click Add UI Element, and then click the first name. It should identify all the other names on the page, looking like this:

Then just click the Save (disk) icon.