Xpath unable to select 2 of the same elements

Not sure what you’re after here based on the way you posted your issue. I am assuming that your XPath is returning more than one element here based on the path you used to find the element. You will need to change your XPath to be more specific to match the uniqueness of the element if the element is truly unique. If they are not unique, then you can try indexing the elements e.g. [1] or [2] to find the element you want. If you want the last element in the array, then try using the last() e.g /descendant::button[contains(@class, ‘some_class_name’)][last()]