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
• 3,020 points
587 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
3 answers

How to scroll down a webpage in selenium using Java?

JavascriptExecutor js = ((JavascriptExecutor) driver); js.executeScript("window.scrollTo(0, document.body.scrollHeight)"); or js.executeScript("arguments[0].scrollIntoView(true);", ...READ MORE

answered Sep 3 in Selenium by Sri
• 2,970 points
25,472 views
0 votes
2 answers

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,520 points
3,750 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
4,732 views
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,890 points
2,726 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2 in Selenium by Sri
• 2,970 points
3,069 views
+1 vote
1 answer
0 votes
1 answer