Searching / getting the index of a button in a popup

Really new to this and barely have experience in coding.
I need help in getting the index of a button in a popup.
The only problem is the index keeps changing every refresh. (Sometimes it’s 20 or 19 or 18 etc)

How might I be able to grab / check for the index before running the code to click the button?

Attached image

is the index I’m describing.
JsCJbpR

Nevermind. I solved it by using Xclick (image) on button.