The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments (String)

Sometimes, you might have got the compile time error while using sendKeys() method.

The error in the Eclipse exactly looks like this :

Multiple markers at this line
– Line breakpoint:SendKeysAdvanced [line: 17] – main(String[])
– The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments
(String)

We have a simple solution to fix this error. We just need to change the JDK compliance level from 1.4 to 1.7 or higher. Have a look at the step by step approach to fix the issue.

  1.  Right click on your project -> Build Path -> Configure Build PathJDKCompliance1
  2. Choose Java Compiler.JDKCompliance2
  3. Change the Compiler compliance level from 1.4 to 1.7 or higher and press Ok.JDKCompliance3

The Eclipse will ask for rebuild of the project, just say Yes.

And the error is resolved.

Hope it works for you!

Cheers 🙂

Advertisements

#sendkeys