
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.
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
2- Click on Java Compiler to 1.5 or later
3- Check the latest version or select from dropdown
4- Now you are done. Go back to the program and you will notice no error will be present.
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
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
Hi Nancy, can u share the code snippet?
sir i am still not able to solve the issue, the section in java compiler >>> jdk compliance not selecting in my eclipse
Please use Java 11
hi
after updating 1.6 stil its geetinf error
Try with 11
Thanks the solution given here fixed the issue
That’s great…:)
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.
Thanks for providing your feedback, Varsha…:)
Thanks !! It fixed the issue
Great…:)
Thanks It helped a lot.
Ritika, you’re always welcome…:)
This article is super awesome. No other blog or tutorials explain this.
Hi Debanjan,
Thanks for appreciation…:)
Please feel free to ask your doubts…
automating google home page
normal sendkeys alphabet working but fucntion key not working,can u confirm?
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
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();
Hi Sam,
Use driver.findElement(By.id(“identifierId”)).sendKeys(“abc“);
still stuck with same problem, i am not able to check- checkbox after changing compiler version from 1.4 to 1.6
Hi Riya,
Also go to Java Build Path -> Libraries -> Select Java SE 1.8(if Java 8 is installed)
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.
Sry it’s data(Text) not date
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.
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 .
Hi Tarun,
Have you changed your compiler level? Moreover I recommend you to use Java 8.
working !! thanks for the solution
Great…:)
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…
Hi Mahadev what issue you are getting with Chrome?
Still the issue is coming
Hi Samreen,
Which version of JDK have you installed?
Thanks for the Solution
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.
Hi Balaji.
Kindly explain your exact requirement.
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
Hi Prashant,
Which architecture version of IEDriver are you using, 32 Bit or 64 Bit?
64 bit version of IE i am using
Hi Prashant,
I would recommend you to use 32 bit IEDriver version and let me know how it is behaving…
It behaves same as for 64bit version and even more issues 🙂
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.
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?
Hi Sandeep,
Kindly change Compiler Compliance level to 1.8 and let me know.
Hi
I am also facing similar kind of issue during send keys using time.Kindly help me to resolve ..
Hi Siva,
Have you followed all steps mentioned blog post content?
How to use type() and typeKeys() in WebDriver can u provide some example? because sendkeys is not working
Hi Anil,
These two commands are specific to Selenium IDE not for Webdriver. In your case, you can give try to robot class.
in my system showing 1.6 latest. code is still showing same error. And check box is not markable
Hi Saket,
Upgrade java to version 8
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
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.
in my system showing 1.6 latest. code is still showing same error. And check box is not markeble
Hi Tarun,
Check whether you have other java installation on machine.
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
Great 🙂
Compiler veraion I am using is 1.8 and jre version 1.7
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.
Try with new version of Eclipse and create fresh project.
It’s useful.
I can solve the issue by your artical.
Thanks
Cheers Mate
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”
Hi Vandana,
Can you please try with fresh project and make sure while creating new project select JRE 1.8 only.
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
Hi Shipra,
Can you create fresh project and try again.
Note- While creating project select latest JRE option. It will work
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
is it fixed?
Thanks for the info..really helped
Thanks and I am glad to know that you find it usefull. Keep learning.
Thanks for information.
Thanks Sathya
Hi,
Done the same. But still error exists.
Help needed desperately.
Hi Sajith,
Above solution worked for me always.
Im new to selenium and got this issue. Thanks lot for the solution and root cause which was so helpful.
Thanks Sridhar
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
Hi Ishan,
is this fixed?
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
Thanks Malikarjun Glad to know that you are able to relate it.
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
Hi Linh,
Can you try creating new project and while creating select JRE 1.8