Google search input text box

0 votes

I am trying to visit "https://www.google.co.in" and want to enter the word "Googling" in the input text box and then click on the search button. The input text box has id "gs_htif0".

This statement is not working

driver.findElement(By.id("gs_htif0")).sendKeys("Googling");

This is working fine.

driver.findElement(By.name("q")).sendKey("Googling");
Jul 24, 2018 in Selenium by Martin
• 4,320 points
1,057 views

1 answer to this question.

0 votes

It seems you tried incorrect id. Please check with :

driver.findElement(By.id("lst-ib")).sendKeys("Googling");

answered Jul 24, 2018 by Samarpit
• 5,910 points

Related Questions In Selenium

+1 vote
1 answer
0 votes
1 answer

How to input text in the text box without calling the sendKeys()?

Hi Rohan, you can use Javascript Executer ...READ MORE

answered May 29, 2019 in Selenium by Abha
• 28,140 points
45,168 views
0 votes
1 answer

Selenium WebDriver typing speed is slow in input text field

It worked for me in the 64bit ...READ MORE

answered Jun 1, 2018 in Selenium by Meci Matt
• 9,460 points
13,131 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,771 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,187 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,262 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,901 views
+1 vote
1 answer

Auto suggest text box in selenium webdriver

You must enter a value to suggest ...READ MORE

answered Jul 27, 2018 in Selenium by Samarpit
• 5,910 points
8,387 views
0 votes
1 answer

Exclude text from `<script>` tag within the HTML DOM when calling `element.getText()`

As you have already identified the WebElement as element next you ...READ MORE

answered May 8, 2018 in Selenium by Samarpit
• 5,910 points
1,540 views
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