String is not a valid XPath expression - Selenium WebDriver

0

Hello,

I'm using the following expression in xpath, but an invalid xpath syntax error occurs. When I inspect the element in the Mozilla firepath, it acknowledges it, but on test execution it fails.

Follows:

By.xpath ("// * [@ class = 'flaticon flaticon-approval-symbol-in-badge'] // Ancestor :: td // following-sibling :: td / a [@ ng-click = 'createResult (v)'] ");

    
asked by anonymous 26.04.2017 / 20:40

1 answer

0

Actually selenium when you put this type of xpath it error, a solution for you is to use the xpath that the firepath itself gives you, when you open the console and go in the fipath tab next to the name "firepath" goes have an arrow down with the options you leave marked only the middle of "absolute xpath" from there you go to the item that wants to right click and put the firepath to it it will already give you the expression ready for use in selenium .

    
17.07.2017 / 06:39