Getting error while giving a string input to google search in selenium java.

+1 vote
I am trying to automate the process of searching in google. When I am giving an input string to the search box it is giving an error saying:

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

Please help!
Dec 14, 2018 in Selenium by Nitesh
• 2,870 points
167 views

1 answer to this question.

0 votes

The two possible solution to the problem can be:

  1. Change the compiler version from old version to 1.5 or greater.
  2. Change the JRE version from JRE8 to JRE7.
Or just change the way you provide input string to sendKeys()
  1. Create a CharSequence[] ch={"Your string you want to search"};
  2. element.sendKeys(new String[]{"Your string you want to search"});
Hope this helps.
answered Dec 14, 2018 by Nabarupa

Related Questions In Selenium

+2 votes
1 answer
0 votes
1 answer
0 votes
1 answer
0 votes
2 answers

How to scroll down a webpage in selenium using Java?

This works... JavascriptExecutor jse = (JavascriptExecutor)driver; j ...READ MORE

answered Apr 3 in Selenium by anonymous
949 views
0 votes
1 answer

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,050 points
259 views
0 votes
1 answer
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,130 points
627 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,130 points
255 views
0 votes
1 answer
0 votes
1 answer