I have this error when I trying to use WebElement getValue by XPath.
Caused by: org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression
TypeError: Failed to execute ‘evaluate’ on ‘Document’: The result is not a node set, and therefore cannot be converted to the desired type.
But when I’m testing the same XPath using Console in Chrome browser I have no problem.
The sentence return :
Could you give me some explainations ?
Resolved: this error was due to unecessary caracter " at the beginning XPath sentence.