Error when using sendKeys() with Selenium WebDriver Java.lang.CharSequence cannot be resolved

前端 未结 8 1072
北海茫月
北海茫月 2020-12-19 15:46

I have imported the following and still get an error when using sendKeys();

import org.openqa.selenium.*;
import org.openqa.selenium.firefox.*;
         


        
相关标签:
8条回答
  • 2020-12-19 16:14

    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

    0 讨论(0)
  • 2020-12-19 16:18

    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.

    0 讨论(0)
  • 2020-12-19 16:21

    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.

    0 讨论(0)
  • 2020-12-19 16:21

    This is because of your eclipse Editor.

    Follow the steps below to overcome that error.

    1. Right click on the java Project.
    2. Select Build Path >Configure Build Path.

    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.

    0 讨论(0)
  • 2020-12-19 16:23

    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.

    0 讨论(0)
  • 2020-12-19 16:32

    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" });
    
    0 讨论(0)
提交回复
热议问题