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 in Selenium by Jino
• 5,560 points
55 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 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
283 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,110 points
930 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
1,114 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
853 views
0 votes
1 answer