I have an HTML element I would like to select that looks like this:
<button data-button-id="close" class="modal__cross modal__cross-web"></button>
Now clearly I can use this XPath selector:
//button[(contains(@data-button-id,'close')) and (contains(@class,'modal'))]
to select the element. However, I would really like to select buttons that have both close and modal contained in any attributes. So I can generalize the selector and say:
//button[(contains(@*,'close')) and (contains(@class,'modal'))]
and that works. What I'd love to do is extend it to this:
//button[(contains(@*,'close')) and (contains(@*,'modal'))]
but that doesn't return any results. So clearly that doesn't mean what I'd like it to mean. Is there a way to do it correctly?
Thanks, Craig