Saturday 2 January 2016

Selenium - Error Message "The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments" while use SendKeys() method


We are getting the below error message while use SendKeys() method

"The method sendKeys(CharSequence[]) in the type WebElement is not applicable for the arguments"

Solution :

We got this error while we setup the project incorrectly. please follow below steps for resolve this issue

1) Change your compiler compliance level from 1.4 to 1.7.

Follow these steps in your eclipse:

Right click on your java project and select Build Path -> Click on
Configure Build Path...
In project properties window, Click/select Java Compiler at the left
panel
At the right panel, change the Compiler compliance level from 1.4 to 1.7
(Select which is higher version in your eclipse)
Lastly Click on Apply and OK
Now check your code. it will never show the same error...



or

2?) Set the JRE System Library again. If you use eclipse follow the steps below:

Go to project properties
Select Java Build Path at the left panel -> Select Libraries tab at the right
Click/select JRE System Library[] -> Click Edit button at the right side
Set your preferred JRE and click Finish button
Lastly click OK button from the project properties pop up window
Instead of editing you can also do by deleting and adding. The steps are:

Right-click on project » Properties » Java Build Path
Select Libraries tab
Find the JRE System Library and remove it
Click Add Library... button at right side » Add the JRE System Library (Workspace default JRE)


Refer = http://stackoverflow.com/questions/23485363/the-method-sendkeyscharsequence-in-the-type-webelement-is-not-applicable-for

No comments:

Post a Comment