The result is not a node set, and therefore cannot be converted to the desired type

Hello,

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 :
[div#ajxcell_609_0_1.class_List_unsel]

Could you give me some explainations ?
Regards.

Resolved: this error was due to unecessary caracter " at the beginning XPath sentence.

1 Like