Skip to main content
Active reading [<http://en.wikipedia.org/wiki/XPath>].
Source Link
Peter Mortensen
  • 31.1k
  • 22
  • 111
  • 134

This error message...

org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //input[@id="attachmentUpload-file0"]// because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//input[@id="attachmentUpload-file0"]//' is not a valid XPath expression.

...implies that your xpathXPath expression was not a valid one.

You can use the following line of code  :

driver.findElement(By.xpath("//input[@id='attachmentUpload-file0']")).sendKeys("test");

This error message...

org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //input[@id="attachmentUpload-file0"]// because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//input[@id="attachmentUpload-file0"]//' is not a valid XPath expression.

...implies that your xpath was not a valid one.

You can use the following line of code  :

driver.findElement(By.xpath("//input[@id='attachmentUpload-file0']")).sendKeys("test");

This error message...

org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //input[@id="attachmentUpload-file0"]// because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//input[@id="attachmentUpload-file0"]//' is not a valid XPath expression.

...implies that your XPath expression was not a valid one.

You can use the following line of code:

driver.findElement(By.xpath("//input[@id='attachmentUpload-file0']")).sendKeys("test");
minor changes to reduce odds it (inadvertently) comes of as "RTFError."
Source Link
Jaydles
  • 251
  • 7
  • 16

TheThis error says it all :message...

org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //input[@id="attachmentUpload-file0"]// because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//input[@id="attachmentUpload-file0"]//' is not a valid XPath expression.

Which implies...implies that your xpath was not a valid one.

You can use the following line of code :

driver.findElement(By.xpath("//input[@id='attachmentUpload-file0']")).sendKeys("test");

The error says it all :

org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //input[@id="attachmentUpload-file0"]// because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//input[@id="attachmentUpload-file0"]//' is not a valid XPath expression.

Which implies that your xpath was not a valid one.

You can use the following line of code :

driver.findElement(By.xpath("//input[@id='attachmentUpload-file0']")).sendKeys("test");

This error message...

org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //input[@id="attachmentUpload-file0"]// because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//input[@id="attachmentUpload-file0"]//' is not a valid XPath expression.

...implies that your xpath was not a valid one.

You can use the following line of code :

driver.findElement(By.xpath("//input[@id='attachmentUpload-file0']")).sendKeys("test");
Source Link
undetected Selenium
  • 194.8k
  • 44
  • 306
  • 388

The error says it all :

org.openqa.selenium.InvalidSelectorException: invalid selector: Unable to locate an element with the xpath expression //input[@id="attachmentUpload-file0"]// because of the following error:
SyntaxError: Failed to execute 'evaluate' on 'Document': The string '//input[@id="attachmentUpload-file0"]//' is not a valid XPath expression.

Which implies that your xpath was not a valid one.

You can use the following line of code :

driver.findElement(By.xpath("//input[@id='attachmentUpload-file0']")).sendKeys("test");