I have imported the following and still get an error when using sendKeys();
import org.openqa.selenium.*;
import org.openqa.selenium.firefox.*;
Faced the same kind of issue.
Issue got resolved on upgrading to Eclipse Luna and then changing the compiler version to 1.8
Compiler version 1.8 is not available with the previous version
As you are using JDK8, your compiler version should be 1.8 which you can get only with latest eclipse version - ECLIPSE LUNA. Alternate way is to downgrade your JDK8 to JDK7 and it will still work.
I faced the same problem during using eclipse Kepler.
Problem domain:
My java compiler compliance level was 1.4
Solution:
so using build path >> configure build path>> java compiler>> changed the compiler compliance level to 1.7 or higher
This could solve the problem.
This is because of your eclipse Editor.
Follow the steps below to overcome that error.
Here there are two things you need to check
A.Java Build Path > Libraries- Here editor should refer the version installed on your machine. If it's referring the old library files then remove it and click on Add Library and select the latest Jre system library from the List.
B.Java Compiler. Here Compiler compliance level should be the latest/ the one installed on your machine.
Issue will get resolved on upgrading to Eclipse Luna and then changing the compiler version to 1.8
Compiler version 1.8 is not available with the previous version
There you are getting The type java.lang.CharSequence error.
You could try this, similar issue has been answered here #sendKeys Issue
myElement .sendKeys(new String[] { "text" }); //You could create a string array
or simply
myElement .sendKeys(new String { "text" });