Setup Test automation with Selenium and Ruby
Download and install Ruby using
https://www.ruby-lang.org/en/documentation/installation/#rubyinstaller
or use Chocolatey package
Download Selenium gem - selenium-webdriver (2.53.4)
run command "gem install selenium-webdriver"
Download Gecko driver (geckodriver-v0.13.0) https://github.com/mozilla/geckodriver/releases
put it in a folder and path to SYS ENV variable
Downgrade Firefox - 45.0 v
require 'rubygems'
require 'selenium-webdriver'
begin
driver=Selenium::WebDriver.for :firefox
puts "Init success"
driver.manage.window.maximize
puts "Navigating to site"
driver.navigate.to("http://google.com")
driver.find_element(:name,'q').send_keys("Selenium Tutorials\n\r")
puts "Hit enter to quit"
gets #waits until user hits enter key
puts "Closing browser..."
driver.quit
rescue => detail
print detail.backtrace.join("\n")
gets
end
save and run
https://www.ruby-lang.org/en/documentation/installation/#rubyinstaller
or use Chocolatey package
Download Selenium gem - selenium-webdriver (2.53.4)
run command "gem install selenium-webdriver"
Download Gecko driver (geckodriver-v0.13.0) https://github.com/mozilla/geckodriver/releases
put it in a folder and path to SYS ENV variable
Downgrade Firefox - 45.0 v
Simple test rb script for google
require 'rubygems'
require 'selenium-webdriver'
begin
driver=Selenium::WebDriver.for :firefox
puts "Init success"
driver.manage.window.maximize
puts "Navigating to site"
driver.navigate.to("http://google.com")
driver.find_element(:name,'q').send_keys("Selenium Tutorials\n\r")
puts "Hit enter to quit"
gets #waits until user hits enter key
puts "Closing browser..."
driver.quit
rescue => detail
print detail.backtrace.join("\n")
gets
end
save and run
Comments
Best Selenium Training Institute in Chennai
Selenium training institute in Chennai
Software Testing Training in Chennai
software testing course in chennai
JAVA Training in Chennai
Python Training in Chennai
Hadoop Training in Chennai
Software Testing Training in Chennai
Software testing training in Tambaram