Hey everyone, I am trying to copy the data by clicking the copy to clipboard button. But when I have 2 copy to clipboard buttons appeared in the chat it throws an error because there are multiple elements (Duplication of element error). Could anyone please help me out how can I resolve this issue?
Attached herewith is a sample screenshot for more clarification.
Identify unique attributes: Check the HTML source code of the webpage or application to identify attributes that uniquely identify each copy to clipboard button. Attributes such as “id,” “name,” “class,” or any other attribute that uniquely distinguishes the buttons can be used in the selector.
Modify the selector: Update the selector of the “Click” activity for each copy to clipboard button to make sure it targets the specific button you want to click.
I cannot do it that way because I have a huge stuff to search and copy the details and paste it back to Excel. Once I will stop the script and RUN it again at that time It will again try to find the element ID which was inserted in the script at the beginning which means if in the beginning we give the ID 5 it will work fine for the first time.
When I will execute it next time the element may be 115 on the webpage because of the previously generated responses but when the BOT will try to find copy to clipboard with the element ID 5.
I just want to click on the last copy to clipboard button.
If you want to click the last one, use Find Children, set to FIND_DESCENDANTS, and then for the output array (let’s say you named it buttonArray) you use buttonArray.Last as the input element for your Click activity.
If you want to copy the data that is most latest, you can use the click activity and set anchor as the input box of chatgpt or make the selector dynamic to only select that particular button
In this code you can see idx=‘5’ which means when BOT will generate next result the idx will be idx=‘6’ and BOT will throw an error that UI element not found.
Yes that will work for the first time. When I will stop the BOT and start it again on chatGPT thread the IDX id will be for instance 36 but we assign the IDX as 5 in the assign activity in the beginning in this case my BOT will fail.