This is the usual way we write some
By identifier = By.xpath("//span[@trans='WbOrderHeader.OneCancelsAnother']");
In the above code after that equals we write the
WbOrderHeader.OneCancelsAnother inside the apostrophe. but what if my identifier starts with an apostrophe?
for example, the same code will be like this
By identifier = By.xpath("//span[@trans=''WbOrderHeader.OneCancelsAnother']");
so the identifier will be
There is one
apostrophe (') at the beginning and there is none at the end. In this case, when I write the XPath the way I wrote here, it’s not identifying. How can I solve this problem?
How to write XPath in this kind of situation?
Source link https://sqa.stackexchange.com/questions/26341/how-to-write-xpath-if-i-have-apostrophe-in-my-xpath-element