My target indicator identifies two similar items ( With buttons and Semantics) to click but doesn't click any of them

Hai,
This is my first post.
I am using Studio Web
So I have been trying to build an automation to download some Documents from a web page. I have created Automated login with given credentials etc. Its working fine.

I have a web page where there are a list of documents ( Say around 10 PDFs) in a window. My aim is to download a file which contains “POLICYSCHEDULE” and “RECEIPT” in the name of the file.

I have tried the following:
My Collection target editor is something like this
Selector :
Semantic: The button to download the document which contains “COLLECTIONRECEIPT”

My Policy Schedule editor is like this:
Selector :
Semantic: The button to download the document which contains “POLICYSCHEDULE”

So, My “Receipt” code is working absolutely Fine till now.
But my Policy schedule code is messed up because of one small reason.
There are two files which contains " PolicySchedule" in their file names. Hence robot is able to identify two files but not able to download one.

Semantics actually works wonderfully well. But it identifies two documents. How do I go about it. Please suggest a simpler method. I have been trying for a month now.

Thanks in advance.

PK.

@nia_35183

Try with this prompt The first button on the page to download the document which contains “POLICYSCHEDULE”

Hey,

Thanks for the swift reply.
Its not working. Its still unable to identify which one to click.

Hi @nia_35183
You can download both the file that contains policy schedule after downloading you can read the contents from the pdf of policy schedule and delete the one of the file which filecontent is not required for automation

@nia_35183

Are these two files duplicate? If yes you can update prompt to download both and the choose any from the downloaded path.

If no, then you may try different approach to download that is Ui automation click activity and there you can check particular attributes in the selector like id or idx or any other which would identity it uniquely.

If this is a enterprise solution then it is good idea to try normal ui automation first to avoid additional costs for LLM calls.

Hello @nia_35183,

Use the Extract Table activity to get the names and URLs of each file. Once you have both, check for the file name and use the HTTP request activity to download the required file for you.

Thanks,
Karthik

Hi @nia_35183,

You can try adding idx='1' in the selector for the download button that contains “POLICYSCHEDULE”. This can help uniquely identify the correct element when multiple similar elements are present on the page.

Thanks

Hai,
Thanks for the reply. But this would be a lengthy procedure.

Hai,
Yes. these are duplicate in terms of the contents of the file. But not in terms of Document name.

Actually “If there are multiple download buttons on the page where the document name contains ‘POLICYSCHEDULE’, click the first available download button.”

This worked for me.

Hi,

So, clicking the first occurrence working now?

Yes.
But I am encountering another problem
As you can see in my first picture… there are a couple of rows.
I have written the logic for Receipt first and Policy Schedule next. So if Receipt is in the first row and Policy Schedule is in the 2nd row, its downloading fine. But if its the other way round, like Receipt in the 2nd row and Policy Schedule in the first row, its unable to identify the policy because its not visible in the screen.

I have tried using keyboard short cut - CTRL + Home. And added a Click activity on some blank area on the page. Added a delay still its not working.

Hi @nia_35183

It seems the selector contains a tableRow attribute. You can try removing this attribute from the selector.

Also, check the Input Mode of the Click activity and set it to Simulate.

Thanks

I have put a very generic Button and Download attributes only. Nothing else.

How did you give if “RECEIPT” and “POLICY SCHEDULE” ?, In the selector?

check the Input Mode of the Click activity and set it to Simulate .

If it still doesn’t work, could you please share a snapshot of the selector?


These are my selectors for receipt.


This is my selector for Policy Schedule.

Hi @nia_35183 ,

You should go with the Selector-based approach and fine-tune it properly.

Semantic selectors should be used only as a fallback, as they may introduce additional cost and overhead.

Thanks