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
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.
- Right click on your project -> Build Path -> Configure Build Path
- Choose Java Compiler.
- Change the Compiler compliance level from 1.4 to 1.7 or higher and press Ok.
The Eclipse will ask for rebuild of the project, just say Yes.
And the error is resolved.
Hope it works for you!