This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "selenium-webdriver" | |
require "selenium/rspec/spec_helper" # where is this coming from? what does it do? (jari) | |
require "spec/test/unit" # this looks outdated - should just be require "rspec" (jari) | |
describe "base.sel" do | |
before(:all) do | |
@verification_errors = [] | |
@driver = Selenium::WebDriver.for :firefox | |
@driver.manage.timeouts.implicit_wait = 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'selenium-webdriver' | |
browser = Selenium::WebDriver.for :firefox | |
begin | |
browser.get "data:text/html;content-type=utf-8,#{URI.escape DATA.read}" | |
browser.find_element(:tag_name => "div").click | |
browser.switch_to.alert.accept | |
ensure | |
browser.quit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def element_present?(how, what) | |
@driver.find_element(how, what) | |
true | |
rescue Selenium::WebDriver::Error::NoSuchElementError | |
false | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'selenium-webdriver' | |
d = Selenium::WebDriver.for :firefox | |
begin | |
d.get "data:text/html,#{URI.escape DATA.read}" | |
d.find_elements(:tag_name => "option").last.click | |
sleep | |
ensure | |
d.quit | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'selenium/server' | |
server = Selenium::Server.new "/mnt/jobs/rake/selenium-server-standalone-2.2.0.jar", :background => true | |
server.start | |
# code | |
server.stop |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{:x=>"", :y=>""} | |
{:x=>"100", :y=>"2279"} | |
{:x=>"200", :y=>"2379"} | |
{:x=>"300", :y=>"2479"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ReplSetConnection.new(['db1.app.com'], ['db2.app.com'], | |
:rs_name => "myapp") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
e = @driver.find_element(:xpath, "//span[text()='IL-4']") | |
@driver.action.click_and_hold(e). | |
move_to(e, 0, 10). | |
release(e). | |
perform |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'selenium-webdriver' | |
d = Selenium::WebDriver.for :firefox | |
begin | |
d.get "data:text/html,#{URI.escape DATA.read}" | |
d.find_elements(:tag_name => "option").last.click | |
sleep | |
ensure | |
d.quit | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'selenium-webdriver' | |
require 'rack' | |
require 'rack/handler/thin' | |
class IframeServer | |
def start | |
@pid = fork { Rack::Handler::Thin.run(self, :Port => 9292) } | |
poller = Selenium::WebDriver::SocketPoller.new("localhost", 9292, 30) | |
raise "could not start #{self.inspect}" unless poller.connected? |