c# - Unable to recognise an Xpath element in selenium -
having little issue when trying find element using selenium c sharp (hash tag not working).
i have element:
<div class="confirmation-price-summary__price-label underline"> travel essentials </div> i have element same has different text associated it:
<div class="confirmation-price-summary__price-label underline"> transfer </div> i want find 1 contains 'travel essentials' written code below try , find it:
public static travelessentialsbasketlink => by.xpath("//div[text()[contains(.,'travel essentials')] , [@class='confirmation-price-summary__price-label underline']"); however, states not valid xpath, how can retrieve element correctly?
thanks
by.xpath("//div[contains(text(),'travel essentials') , @class='confirmation-price-summary__price-label underline']"); this should trick.
Comments
Post a Comment