Sha256: 14c57071cf3844ff649c374e00bfe92b0eb9b7e4216680d18d0b8fa5fbcd08fe

Contents?: true

Size: 932 Bytes

Versions: 1

Compression:

Stored size: 932 Bytes

Contents

#!/usr/local/bin/ruby -w 

module Statt
  class Client < Selenium::Client::Driver
    def initialize(options = {})
      options = { :host => "localhost", 
                  :port => 4444,
                  :timeout => 300, 
                  :browser => "*firefox",
                  :url => "http://localhost:3000"}.merge(options)
      super(options)
    end
    
    def start
      start_new_browser_session
    end
    
    def stop
      close_current_browser_session
    end
    
    def click_button_by_text(value)
      click "xpath=//input[@value='#{value}']"
    end
    
    def click_link_by_text(value)
      begin
        click "xpath=//a[text()='#{value}']"
      rescue Exception => msg
        begin
          click "xpath=//a/*[text()='#{value}']"
        rescue Exception => msg
          puts "Couldn\'t locate '#{value}' #{msg}"
        end
      end
    end
    
    def source
      
    end
  end
  
  
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
statt-0.0.4 lib/statt/client.rb