Smart Driver
Smart selenium base web driver written in Ruby.
Installation
- Install gem as you like.
$ gem install kirchhoff
- Install chromedriver. (Below is the MacOS example.)
$ brew install chromedriver
Demo
require 'kirchhoff'
driver = Kirchhoff::Driver.new
driver.go 'https://www.facebook.com/'
driver.find('input#email').fill('[email protected]')
driver.find('input#pass').fill('password')
driver.submit
driver.find_text('メールアドレスが正しくありません') do |e|
unless e
# If there is no text 'メールアドレスが正しくありません'
end
end
driver.wait_element("div#wait", timeout: 5)
driver.wait_text("wait for you...", timeout: 5, maybe: false)
#=> raise err if there is no text 'wait for you...'
