Skip to content

Instantly share code, notes, and snippets.

@ivaravko
ivaravko / file.rb
Created June 15, 2011 07:35 — forked from jarib/file.rb
selenium-webdriver bug report template
require 'rubygems'
require 'selenium-webdriver'
path = File.expand_path("test.html")
File.open(path, "w") { |io| io << DATA.read }
browser = Selenium::WebDriver.for :firefox # replace :firefox with the browser you're having trouble with
begin
browser.get "file://#{path}"
@ivaravko
ivaravko / test.rb
Created June 21, 2011 15:42 — forked from jarib/test.rb
require 'selenium-webdriver'
driver = Selenium::WebDriver.for :chrome
driver.extend Selenium::WebDriver::DriverExtensions::HasInputDevices
wait = Selenium::WebDriver::Wait.new
begin
driver.get "http://dev.sencha.com/deploy/touch/examples/kitchensink/"
wait.until { driver.all(:class => "x-list-item-body").find { |e| e.displayed? && e.text == "User Interface"} }.click
@ivaravko
ivaravko / test.rb
Created July 1, 2011 08:27 — forked from jarib/test.rb
require 'selenium-webdriver'
wait = Selenium::WebDriver::Wait.new
driver = Selenium::WebDriver.for :firefox
driver.get "http://www.google.no/?as_qdr=all"
driver.find_element(:name => "q").send_keys("selenium")
suggestions = nil
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?
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
@ivaravko
ivaravko / file.rb
Created July 21, 2011 19:10 — forked from jarib/file.rb
e = @driver.find_element(:xpath, "//span[text()='IL-4']")
@driver.action.click_and_hold(e).
move_to(e, 0, 10).
release(e).
perform
ReplSetConnection.new(['db1.app.com'], ['db2.app.com'],
:rs_name => "myapp")
{:x=>"", :y=>""}
{:x=>"100", :y=>"2279"}
{:x=>"200", :y=>"2379"}
{:x=>"300", :y=>"2479"}
@ivaravko
ivaravko / file.rb
Created August 9, 2011 08:46 — forked from jarib/file.rb
require 'selenium/server'
server = Selenium::Server.new "/mnt/jobs/rake/selenium-server-standalone-2.2.0.jar", :background => true
server.start
# code
server.stop
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