How can I automate google search for a keyword using ruby selenium webdriver?

0 votes
How can I automate google search for a keyword using ruby selenium webdriver?
Aug 26 in Selenium by Amir
60 views

1 answer to this question.

0 votes

Hi Amir, following code snippet shows how to automate google search for a keyword:

driver = Selenium::WebDriver.for :firefox
driver.navigate.to "https://www.google.com"

elem = driver.find_element(:name, 'q')      #q is the namespace of searchbox element
elem.send_keys "Ruby Selenium Webdriver"    #send_keys method used to write text
elem.submit

driver.quit
answered Aug 26 by Anvi
• 13,960 points

Related Questions In Selenium

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

How can I automate Google Chrome using Selenium RC?

Chrome is used to launch a special ...READ MORE

answered Mar 6 in Selenium by Surya
• 970 points
159 views
0 votes
1 answer
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,430 points
1,182 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,170 points
1,268 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,170 points
1,025 views
0 votes
1 answer
0 votes
1 answer