-1

I am using the following code for POM :

@FindBy(xpath="[@value='Send query']") private WebElement queryButton;

I am getting this error

org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression [@value='Send query'] because of the following error: SyntaxError: Failed to execute 'evaluate' on 'Document': The string '[@value='Send query']' is not a valid XPath expression.
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352
  • 1
    The acronym "POM" already has a meaning in the Java world: https://en.wikipedia.org/wiki/Apache_Maven#Project_Object_Model Please do not confuse it with Page Object Model! – SiKing Feb 26 '18 at 23:58
  • If people start referring to POM as "POP" I'm probably not going to know what they're talking about. – Bill Hileman Feb 27 '18 at 15:15

1 Answers1

3

The error "invalid selector" is pretty explanatory: [@value='Send query'] is not a valid XPath.

You probably meant //*[@value='Send query'].

SiKing
  • 10,003
  • 10
  • 39
  • 90