I’m not sure why your first fails, it looks okay to me, but your second one fails because you’re looking for an exact match, but only showing part of the URL and in your example, at least, is missing quotes.

WebElement lnk = driver.findElement(By.xpath("//a[ends-with(@href,'/principal.aspx')]"));



Source link https://sqa.stackexchange.com/questions/32552/---can-not---with-xpath

LEAVE A REPLY

Please enter your comment!
Please enter your name here