How to search for a string without clicking on search button

+1 vote
Is there a way to google search without clicking on search button? Can someone help me with this? I am new to selenium.
Jan 4, 2019 in Selenium by Jino
• 5,810 points
306 views

1 answer to this question.

0 votes

There is a way by which you can do this. All you need to do is in sendkeys you need to send a keystroke enter.

So normally what you do is that you type for a keyword and press enter. Similar will be the scenario here.

Here is the code for doing this :-

driver.findElement(By.name("q")).sendKeys("Your keyword",Keys.ENTER);

Hope this helps.

answered Jan 4, 2019 by Disha

Related Questions In Selenium

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

How can I search for a video on YouTube?

I will tell you step by step ...READ MORE

answered Dec 19, 2018 in Selenium by Nabrupa
2,790 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
4,916 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,010 points
5,710 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
3,490 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, 2020 in Selenium by Sri
• 3,010 points
4,201 views
0 votes
1 answer