• Skip to main content
  • Skip to primary sidebar
  • Skip to footer
  • Home
  • Programming Languages
    • Java Tutorials
    • Python Tutorials
    • JavaScript Tutorials
  • Automation Tools and Different Tools
    • Web Automation
      • Selenium with Java
        • Selenium Basic
        • Selenium Advance
        • Selenium Realtime
        • Framework
        • Selenium Interview
        • Selenium Videos
        • Selenium with Docker
      • Selenium with Python
      • WebdriverIO
        • Selenium Webdriver C# Tutorial
      • Cypress
      • Playwright
    • TestNG
    • Cucumber
    • Mobile Automation
      • Appium
    • API Testing
      • Postman
      • Rest Assured
      • SOAPUI
    • testRigor
    • Katalon
    • TestProject
    • Serenity BDD
    • Gradle- Build Tool
    • RPA-UiPath
    • Protractor
    • Windows Automation
  • Automation For Manual Testers
  • Services
  • Online Training
  • Contact us
  • About me
  • Follow us
    • Linkedin
    • Facebook Group
    • Facebook Page
    • Instagram

Automation

Selenium WebDriver tutorial Step by Step

You are here: Home / Basic Selenium / Solution for sendkeys(CharSequence) in Selenium

Solution for sendkeys(CharSequence) in Selenium

November 9, 2015 by Mukesh Otwani 81 Comments

sendkeys_issue_in_selenium

If you are working with Selenium and if SendKeys is not working in Selenium then you have to do small settings which will fix your issue.

Please refer below screenshot for the exact problem statement.

 

SendKeys is not working in Selenium

 

Solution if SendKeys is not working in Selenium

Problem Statement for sendkeys(CharSequence) in Selenium

This is one of the most common problems for guys who are new in Selenium Webdriver. If you are on this issue then do not worry there are some configuration changes only that I will show you in next few minutes.

 

Sometimes while creating project compiler version will be below 1.5 version so Selenium method that is sendKeys will not able to read by the compiler so we need to upgrade the compiler version to 1.5 and above.

 

The error which will come is

” sendKeys (CharSequence) from the type Webelement refers to the missing type charSequence“

 

 

Solution for sendkeys(CharSequence) in Selenium

you will be happy to know that we have two solutions for this I will tell you the first one in detail and the second one is quite easy that you can try from the end as well.

1- Change the compiler version from old version to 1.5 or greater.

2- Change the JRE version from JRE8 to JRE7.

 

 

How to change the compiler version

1- Right click on project 

 

SendKeys is not working in Selenium

 

2- Click on Java Compiler to 1.5 or later

 

sendkey issue detected

 

3- Check the latest version or select from dropdown

 

Save changes

 

4- Now you are done. Go back to the program and you will notice no error will be present.

 

Selenium issue fixed

If you are still finding any issue while creating scripts in Selenium webdriver just comment below. We all are here to help each other.

 

 

For More updates Learn Automation page

For any query join Selenium group- Selenium Group

 

 

Filed Under: Basic Selenium Tagged With: sendkeys error in Selenium

Reader Interactions

Comments

  1. Nancy says

    August 1, 2023 at 3:04 AM

    Hi,

    I am facing the issue “The method sendKeys(WebDriver, WebElement, Duration, String) in the type SynchronizationInSelenium(class name) is not applicable for the arguments (ChromeDriver, WebElement, int, String) while trying to use generic function using “WebDriverWait” (basically the explicit wait).

    Tried to make changes in Java compiler but still seeing this issue.

    JRE: 18.9

    Could you please help me in resolving this issue.

    Thanks
    Nancy

    Reply
    • Mukesh Otwani says

      August 9, 2023 at 9:40 AM

      Hi Nancy, can u share the code snippet?

      Reply
  2. sathish says

    April 19, 2023 at 6:47 PM

    sir i am still not able to solve the issue, the section in java compiler >>> jdk compliance not selecting in my eclipse

    Reply
    • Mukesh Otwani says

      July 24, 2023 at 1:04 AM

      Please use Java 11

      Reply
  3. saikumar says

    March 2, 2023 at 11:50 AM

    hi
    after updating 1.6 stil its geetinf error

    Reply
    • Mukesh Otwani says

      July 24, 2023 at 1:06 AM

      Try with 11

      Reply
  4. Sourabh says

    February 7, 2022 at 6:31 PM

    Thanks the solution given here fixed the issue

    Reply
    • Mukesh Otwani says

      February 11, 2022 at 11:04 AM

      That’s great…:)

      Reply
  5. Varsha says

    March 11, 2021 at 9:40 PM

    Thanks a lott Mukesh!! I almost spent 1 hr time inorder to send the text in to the text field of email address in Flipkart application. I have tried javascript executor, actions class etc; none of them threw the error but text is not entering in to the text filed. I have followed the steps mentioned by you and it worked finally!!! You are savior of people who want to learn selenium.

    Reply
    • Mukesh Otwani says

      March 12, 2021 at 9:06 AM

      Thanks for providing your feedback, Varsha…:)

      Reply
  6. Prabhakaran says

    December 22, 2020 at 8:24 PM

    Thanks !! It fixed the issue

    Reply
    • Mukesh Otwani says

      December 23, 2020 at 12:30 AM

      Great…:)

      Reply
  7. Ritika says

    August 9, 2020 at 8:49 PM

    Thanks It helped a lot.

    Reply
    • Mukesh Otwani says

      August 10, 2020 at 11:03 AM

      Ritika, you’re always welcome…:)

      Reply
  8. Debanjan Bhattacharjee says

    February 18, 2020 at 2:23 AM

    This article is super awesome. No other blog or tutorials explain this.

    Reply
    • Mukesh Otwani says

      February 18, 2020 at 10:15 AM

      Hi Debanjan,

      Thanks for appreciation…:)
      Please feel free to ask your doubts…

      Reply
  9. vijay shetty says

    October 31, 2019 at 4:59 PM

    automating google home page
    normal sendkeys alphabet working but fucntion key not working,can u confirm?

    Reply
    • Mukesh Otwani says

      November 4, 2019 at 9:51 PM

      Hi Vijay,

      You can use robot class for function keys. For details, please refer this link http://learn-automation.com/robot-class-in-selenium-webdriver/
      Function keys are not supported by Selenium as OS doesn’t know about Fn keys

      Reply
  10. sam says

    September 17, 2019 at 12:29 AM

    hello I am new to selenium sendkey compiler thing worked for me thanks alot . I am trying to enter email or phone gor gmail login and click next button but its not working

    i used driver.findElement(By.id(“identifierId”)).sendKeys(“abc “+Keys.TAB);

    driver.findElement(By.id(“identifierNext”)).click();

    Reply
    • Mukesh Otwani says

      September 17, 2019 at 10:54 AM

      Hi Sam,

      Use driver.findElement(By.id(“identifierId”)).sendKeys(“abc“);

      Reply
  11. Riya says

    August 12, 2019 at 3:42 PM

    still stuck with same problem, i am not able to check- checkbox after changing compiler version from 1.4 to 1.6

    Reply
    • Mukesh Otwani says

      August 12, 2019 at 5:40 PM

      Hi Riya,

      Also go to Java Build Path -> Libraries -> Select Java SE 1.8(if Java 8 is installed)

      Reply
  12. Jagadeesh says

    July 10, 2019 at 4:01 PM

    Hi this is jagadeesh. I am facing issue in iOS appium web. after entering date in text box it’s clearing in 2seconds . Please let me know if you have any solution.

    Reply
    • Jagadeesh says

      July 10, 2019 at 4:05 PM

      Sry it’s data(Text) not date

      Reply
      • Mukesh Otwani says

        July 10, 2019 at 5:39 PM

        Hi Jagadeesh,

        Can you try something like, after entering data, press tab key/ click somewhere to remove focus from input box and let me know with observation.

        Reply
  13. Tarun Mukherjee says

    June 21, 2019 at 6:27 PM

    I am getting the error while reading data from property file .
    ERROR:
    java.lang.IllegalArgumentException: Keys to send should be a not null CharSequence

    There’s no compiling errors. But this exception is thrown while the test is run .

    Reply
    • Mukesh Otwani says

      June 23, 2019 at 9:44 PM

      Hi Tarun,

      Have you changed your compiler level? Moreover I recommend you to use Java 8.

      Reply
  14. Angel says

    June 18, 2019 at 10:23 PM

    working !! thanks for the solution

    Reply
    • Mukesh Otwani says

      June 19, 2019 at 8:44 AM

      Great…:)

      Reply
  15. Mahadev says

    April 25, 2019 at 9:43 AM

    Hi Mukesh,

    I have Jdk 1.8 and JRE 1.8 latest version. Its working fine for Firefox browser(64-bit) but not for chrome(64-bit). Please let me know how to resolve this issue.

    Thanks a lot…

    Reply
    • Mukesh Otwani says

      April 25, 2019 at 2:54 PM

      Hi Mahadev what issue you are getting with Chrome?

      Reply
  16. Samreen Siddiqui says

    April 17, 2019 at 3:38 PM

    Still the issue is coming

    Reply
    • Mukesh Otwani says

      April 18, 2019 at 8:36 AM

      Hi Samreen,

      Which version of JDK have you installed?

      Reply
  17. Prasanna says

    April 15, 2019 at 7:11 PM

    Thanks for the Solution

    Reply
  18. Balaji Mahendran says

    April 15, 2019 at 1:34 PM

    Hi Guys, Upon defining the sendkeys in POM class
    public void Mail_enter(String Admmailaddress) {

    Admmail.sendKeys(Admmailaddress);

    }
    This will be called in testng class using Pagefactory. I am using data driven framework.So that data is stored in excel sheet and called using dataprovider annotations.

    Reply
    • Mukesh Otwani says

      April 15, 2019 at 1:53 PM

      Hi Balaji.

      Kindly explain your exact requirement.

      Reply
  19. Prashant says

    April 8, 2019 at 4:48 PM

    Hi Mukesh, I am working on 1.8 version.still i am facing similar issue that sometimes it is not typing complete value to the text box on IE. and sometime click event is also not working. i have already put code for waiting element to be visible and clickable.. can you please help what else i should do to work consistently? Thanks

    Reply
    • Mukesh Otwani says

      April 8, 2019 at 7:18 PM

      Hi Prashant,

      Which architecture version of IEDriver are you using, 32 Bit or 64 Bit?

      Reply
      • Prashant says

        April 15, 2019 at 10:27 PM

        64 bit version of IE i am using

        Reply
        • Mukesh Otwani says

          April 15, 2019 at 11:42 PM

          Hi Prashant,

          I would recommend you to use 32 bit IEDriver version and let me know how it is behaving…

          Reply
          • Prashant says

            May 7, 2019 at 6:16 PM

            It behaves same as for 64bit version and even more issues 🙂

          • Mukesh Otwani says

            May 7, 2019 at 8:53 PM

            Hi Prashant,

            Are you getting error message which I’ve posted in concerned topic(i mean sendkeys(charsequence) error) or is it simply not doing sendkeys action on UI?
            I would also recommend you to use latest version of Selenium and corresponding IEDriverServer.exe. if you’re not.

  20. Sandeep says

    April 4, 2019 at 12:57 PM

    Hi Mukesh, I changed to version 1.6 but unable to select JDK Compliance check box. I am using Eclipse Helios, is this the problem?

    Reply
    • Mukesh Otwani says

      April 4, 2019 at 2:25 PM

      Hi Sandeep,

      Kindly change Compiler Compliance level to 1.8 and let me know.

      Reply
  21. siva says

    March 30, 2019 at 8:28 PM

    Hi

    I am also facing similar kind of issue during send keys using time.Kindly help me to resolve ..

    Reply
    • Mukesh Otwani says

      March 31, 2019 at 9:07 AM

      Hi Siva,

      Have you followed all steps mentioned blog post content?

      Reply
  22. Anil says

    February 21, 2017 at 12:47 PM

    How to use type() and typeKeys() in WebDriver can u provide some example? because sendkeys is not working

    Reply
    • Mukesh Otwani says

      February 21, 2017 at 2:23 PM

      Hi Anil,

      These two commands are specific to Selenium IDE not for Webdriver. In your case, you can give try to robot class.

      Reply
  23. saket kumar says

    February 20, 2017 at 12:43 AM

    in my system showing 1.6 latest. code is still showing same error. And check box is not markable

    Reply
    • Mukesh Otwani says

      February 20, 2017 at 7:38 PM

      Hi Saket,

      Upgrade java to version 8

      Reply
  24. ZORO says

    February 5, 2017 at 7:24 PM

    Hi Mukesh,
    I am trying to write one program in Selenium, in which i am trying to log-in through the username and password like as in gmail.
    But when i run the program it gives error sendkeys(CharSequence), I have tried all the configurations and tricks mentioned by you in the blog, but it is not working.
    Any other suggestions/help you can provide will be indebted.
    Regards
    ZORO

    Reply
    • Mukesh Otwani says

      February 6, 2017 at 11:39 AM

      Hi Zoro,

      Please check whether the locators are correct. Moreover in some applications, sendKeys for input box doesn’t work in one shot, so first do click inside input box and then try with sendKeys action.

      Reply
  25. Tarun Tyagi says

    January 11, 2017 at 7:43 PM

    in my system showing 1.6 latest. code is still showing same error. And check box is not markeble

    Reply
    • Mukesh Otwani says

      January 11, 2017 at 9:59 PM

      Hi Tarun,

      Check whether you have other java installation on machine.

      Reply
  26. Gaurav Khurana says

    December 1, 2016 at 8:57 AM

    Though i have never faced this problem. But intentionally change the settings to see this problem from 1.8 to 1.4 and i was able to reproduce the problem.

    Very well reported Mukesh. Thanks

    Reply
    • Mukesh Otwani says

      December 6, 2016 at 12:33 PM

      Great 🙂

      Reply
  27. Naina says

    November 27, 2016 at 10:07 PM

    Compiler veraion I am using is 1.8 and jre version 1.7

    Reply
  28. Bidhulata Sahu says

    November 4, 2016 at 12:34 PM

    if i will use 1.7 jdk then it is not showing error BUT while i tried to run the programme it is showing “java exception error occured ” with a new pop up box named java virtual machine launcher.

    Reply
    • Mukesh Otwani says

      November 4, 2016 at 10:38 PM

      Try with new version of Eclipse and create fresh project.

      Reply
  29. PThanh says

    October 6, 2016 at 1:45 PM

    It’s useful.
    I can solve the issue by your artical.
    Thanks

    Reply
    • Mukesh Otwani says

      October 7, 2016 at 7:32 PM

      Cheers Mate

      Reply
  30. vandana says

    September 27, 2016 at 11:42 AM

    Hi ,

    Iam using Selenium 3.0 .0 beta 3 version with JRE 1.8.0.101.
    Compiler Compliance level 1.7

    Iam getting following error
    “The type java.lang.CharSequence cannot be resolved. It is indirectly referenced from required .class files
    The method sendKeys(CharSequence…) from the type WebElement refers to the missing type CharSequence”

    Reply
    • Mukesh Otwani says

      September 29, 2016 at 10:52 AM

      Hi Vandana,

      Can you please try with fresh project and make sure while creating new project select JRE 1.8 only.

      Reply
  31. shipra garg says

    September 15, 2016 at 4:41 PM

    Hi
    I have updated the compiler compliance from 1.4 to 1.76 but still the error is there.

    I am using JRE 1.8.0_91

    Please help me out.

    Thanks ,
    Shipra Garg

    Reply
    • Mukesh Otwani says

      September 15, 2016 at 5:15 PM

      Hi Shipra,

      Can you create fresh project and try again.

      Note- While creating project select latest JRE option. It will work

      Reply
  32. Himani says

    September 3, 2016 at 4:24 PM

    Hi,
    I am using selenium 3 beta 2 with Firefox. And Java 1.8.0_65 version. Done above steps but sendkeys error is still appearing in console. Could you help in this regard.

    Thanks in advance

    Reply
    • Mukesh Otwani says

      September 8, 2016 at 12:00 AM

      is it fixed?

      Reply
  33. Sivani says

    July 23, 2016 at 5:31 AM

    Thanks for the info..really helped

    Reply
    • Mukesh Otwani says

      July 25, 2016 at 12:11 PM

      Thanks and I am glad to know that you find it usefull. Keep learning.

      Reply
  34. Sathya says

    March 8, 2016 at 5:15 PM

    Thanks for information.

    Reply
    • Mukesh Otwani says

      March 11, 2016 at 6:44 PM

      Thanks Sathya

      Reply
  35. Sajith Kumar says

    February 22, 2016 at 5:30 PM

    Hi,

    Done the same. But still error exists.

    Help needed desperately.

    Reply
    • Mukesh Otwani says

      March 3, 2016 at 4:07 PM

      Hi Sajith,

      Above solution worked for me always.

      Reply
  36. sridhar says

    February 6, 2016 at 2:16 PM

    Im new to selenium and got this issue. Thanks lot for the solution and root cause which was so helpful.

    Reply
    • Mukesh Otwani says

      March 11, 2016 at 6:36 PM

      Thanks Sridhar

      Reply
  37. Ishan Agarwal says

    February 6, 2016 at 2:06 PM

    Hi,

    I have updated the compiler compliance from 1.4 to 1.7 but still the error is there.

    I am using JRE 1.8.0_66

    Please help me out.

    Thanks,
    Ishan

    Reply
    • Mukesh Otwani says

      March 3, 2016 at 5:05 PM

      Hi Ishan,

      is this fixed?

      Reply
  38. Mallikarjun says

    January 4, 2016 at 4:25 PM

    Thanks for info

    I too faced this problem when I was new to selenium but i didn’t know d reason for it and i forgot abt dis

    By reading this blog only I came 2 know d exact reason 4 it

    Reply
    • Mukesh Otwani says

      January 6, 2016 at 1:02 AM

      Thanks Malikarjun Glad to know that you are able to relate it.

      Reply
      • linh says

        September 23, 2016 at 3:44 PM

        Hello Mukesh Otwani,

        Compliance level: 1.8
        JRE 1.8.0_45
        but it does not work in my side.

        could you please give some help?

        Thanks,
        Linh

        Reply
        • Mukesh Otwani says

          September 23, 2016 at 11:17 PM

          Hi Linh,

          Can you try creating new project and while creating select JRE 1.8

          Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Primary Sidebar

Free Selenium Videos

https://www.youtube.com/watch?v=w_iPCT1ETO4

Search topic

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?

Stay connected via Facebook

Stay connected via Facebook

Archives

Footer

Categories

Recent Post

  • Syllabus For Playwright Online Training Program
  • API Testing Using Postman And RestAssured
  • Disable Personalise Your Web Experience Microsoft Edge Prompt In Selenium
  • How To Fix Error: No tests found In Playwright
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse

Top Posts & Pages

  • Selenium Webdriver tutorial for beginners
  • How To Fix Eclipse Autocomplete Or Code Suggestion In Eclipse
  • Selenium Webdriver C# Tutorial
  • WHAT ARE YOUR EXPECTATIONS FROM US?