Home » Java » The method sendKeys(String) is undefined for the type ByJava(67108964) with sendKeys method while working in VS Code using Selenium through Java-Exceptionshub

The method sendKeys(String) is undefined for the type ByJava(67108964) with sendKeys method while working in VS Code using Selenium through Java-Exceptionshub

Posted by: admin February 25, 2020 Leave a comment

Questions:

I am using Selenium writing in Java by VS Code.

I am unable to compile this line of code since there is a red line under the method sendKeys.

The line of code is:

driver.findElement(By.xpath("xpath")).sendKeys("Cologne");

Error is shown as:

The method sendKeys(String) is undefined for the type ByJava(67108964)
How to&Answers:

This error message…

The method sendKeys(String) is undefined for the type ByJava(67108964)

…implies that there is a configuration issue within the environmental settings.


As per this discussion Solution for sendkeys(CharSequence) in Selenium while you start writing code using Selenium‘s client, at times your project Java Compiler version will be below v1.5 and sendKeys() will won’t be read by the compiler. In these cases you need to upgrade the compiler version to 1.5 and above.

JavaCompiler


Solution

You need to make the following changes:

  • Change the compiler version from old version to 1.5 or greater.
  • Additionally, you may need to go to Java Build Path -> Libraries -> Select Java SE 1.8 (if Java 8 is installed)