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,080 points
1,797 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
5 answers

How to scroll down a webpage in selenium using Java?

 to scroll up or down with Selenium, a JavaScript executor is a ...READ MORE

answered Dec 16, 2020 in Selenium by Roshni
• 10,520 points
44,539 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,500 points
13,475 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

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

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
9,026 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,910 points
7,139 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 3, 2020 in Selenium by Sri
• 3,190 points
7,814 views
+1 vote
1 answer
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP