Skip to main content
2 of 3
minor changes to reduce odds it (inadvertently) comes of as "RTFError."
Jaydles
  • 251
  • 7
  • 16

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");
undetected Selenium
  • 194.8k
  • 44
  • 306
  • 388