How to incorporate the visibility attribute value of a button to its selector?

I am currently trying to automate a web page process, and I am struggling with the selector of one button.

The button is present on an overlay, and the Robot should only click the button that is visible on the overlay. I noticed that the button’s selector still seems to “exist” when the overlay has been closed, and so sometimes the Robot clicks in white spaces on the overlay instead of the visible button, which I guess are the other “ghost” buttons cached somewhere else the web page.

After using Get Attribute activity, I know that when the button is visible on the overlay and that the Robot should click it, its visibility attribute is 0. When I’ve closed the overlay, its visibility attribute value is 1.

And so, I want to know how could I incorporate the visibility attribute value of a button to its selector? Would I simply add visibility = ‘1’ within the selector?

Thank you very much!

Use simulate click property. It will work on back ground. :grinning:

If you want to click button only when it is visible and if the property of the elements (visibility =1) when it is visible you can have a check before element exist with this selector, if it is true (i.e 1) then you can click on that element.

Thank you all.

The struggle is that the same selector for the button is present multiple times on the webpage, and so sometimes the Robot clicks on white spaces on the overlay, presumably clicking other ghost buttons. I only want to the Robot to click on the button of which the visibility attribute value is 0 (i.e. it is the visible one the Robot should click, not the other ghost buttons)

In that case edit your selector using UiExplorer and you will see the attribute that makes you able to select the attribute. Try once.

You could use idx attribute with your selector in a get attribute activity. Use that inside a while loop until the get attribute returns what you need (0). Then that’s the element you want, so then use that selector (with the correct idx) in your click activity. It’s kind of brute force, might not be very performant if there are many ghost buttons.

I don’t know if this works, I’m just brainstorming, good luck!