One selector is working for two different button

I have a selector of a button and this selector is working perfectly fine for another button as well, which giving me always “True” result in ‘element exist’ activity, which in turn eventually got me stuck in an infinite loop. I have tried ‘get attribute’ and ‘On element appear’ as well but the result is the same for both buttons.

  1. First Button

  2. Second Button(I have tried adding innertext, class as well, but still one selector works for both.)

You can use Get Text activity to get the text displayed for button links and use that to identify which button it is.

Hi @shuaib_akhtar,

could you please check if you are really selecting the same button as UiPath would normally give an IDX-value if there is more then one item with the same selector on a page.
If this is the “next page” selector and only changes on the last page as shown then @virang_21 idea could be the solution with a “get visible text”.

Best,

Frank

Hi Shuaib_akhtar, I agree with FrankSchikora. You may check whether the same button or different buttons are selected. It is not likely to have same selector in browser if the two buttons have different functions. It is only possible when the two buttons refer to the same link, for example, “next page” link at both the top and the bottom of the page.

As to “Element exists” activity, some web site may hide a button and hence the element still exists even though you cannot see it using your eyes. In this case, you can not use “Element Exists” activity to make decision.

Hi there , thanks for your replies , Now , I test ‘Get text’ activity for one selector of ‘Next blink’ Button , and it is working for ‘Mark as finished’ button as well.
However when i tried out “Get visible text” activity , then it threw the error.

Is there any workaround to check that last button “Mark as finished” (shown in above screenshot) to loop through all pages(having “Next blink” button) and then stop at last page.

@shuaib_akhtar - could you post a screenshot of the uiExplorer with the selector for the “Mark as finished” button? Please open up the “unselected items” and the property explorer to get a clearer picture.

hello FrankSchikora here is the selector for "Mark as finished " button. If I am selecting a separate selector for both buttons (i.e. “Next blink” and “Mark as finished”) then it is identifying it, but why the selector of “Next blink” working for other button…?
Thank you in advance for taking out time to read and reply. :relaxed: