Trying to check if the element set focus to using class header matching by text and getting error unable to locate the element. I know the header title which is 'My Details' in this example, and using this title, how to locate the element?
<div class="attribute-group-header card__header">
<h3 class="attribute-group-title card__header-title">My Details</h3>
</div>
Element should be focused //div[contains(.,'My Details')
To locate the h3
in your example code, use this xpath //h3[contains(text(),'My Details')]
To locate the div
which has card__header
in class
, use this xpath //div[contains(@class,'card__header')]