Sha256: b315255ae9d38a0ac47f290e7fed8cdb995337797e995e39fd055a040da7cdf3

Contents?: true

Size: 981 Bytes

Versions: 1

Compression:

Stored size: 981 Bytes

Contents

#!/usr/bin/env ruby
#
# Sample Test:Unit based test case using the selenium-client API
#
require "test/unit"
require "rubygems"
gem "selenium-client", ">=1.2.12"
require "selenium/client"

class ExampleTest < Test::Unit::TestCase
	attr_reader :browser
   
  def setup
    @browser = Selenium::Client::Driver.new \
        :host => "localhost", 
        :port => 4444, 
        :browser => "*firefox", 
        :url => "http://www.google.com", 
        :timeout_in_second => 60

    browser.start_new_browser_session
  end
    
  def teardown
    browser.close_current_browser_session
  end
  
  def test_page_search
		browser.open "/"
		assert_equal "Google", browser.title
		browser.type "q", "Selenium seleniumhq"
		browser.click "btnG", :wait_for => :page
		assert_equal "Selenium seleniumhq - Google Search", browser.title
		assert_equal "Selenium seleniumhq", browser.field("q")
		assert browser.text?("seleniumhq.org")
		assert browser.element?("link=Cached")
  end
    
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
selenium-client-1.2.12 examples/testunit/google_test.rb