GithubHelp home page GithubHelp logo

isabella232 / watir Goto Github PK

View Code? Open in Web Editor NEW

This project forked from facebookarchive/watir

0.0 0.0 0.0 8.99 MB

Watir is a Ruby browser-driver suitable for apps in any language.

Home Page: http://www.watir.com

License: Other

Ruby 82.40% JavaScript 0.61% CSS 0.62% C++ 0.60% C 15.77%

watir's Introduction

Archived Repo

This is an archived fork and is no longer supported or updated by Facebook. Please do not file issues or pull-requests against this repo. The primary on-going source of the project may now be found at github.com/watir/watir-classic

Watir

Watir, pronounced water, is an open-source (BSD) family of Ruby libraries for automating web browsers. It supports your app no matter what technology it is developed in. They support Internet Explorer on Windows, Firefox and Chrome on Windows, Mac and Linux and Safari on Mac.

Project Home

watir.com

Source Code

github.com/bret/watir

Support

watir.com/support

Gem

rubygems.org/gems/watir

Gem

rubygems.org/gems/firewatir

Gem

rubygems.org/gems/commonwatir

Gem

rubygems.org/gems/safariwatir

Gem

rubygems.org/gems/watir-webdriver

Gem

rubygems.org/gems/celerity

Install

You have to install Ruby and RubyGems first. To be able to drive Firefox you have to install Firefox add-on. Detailed installation instructions are at watir.com/installation

Windows

To install Internet Explorer and Firefox driver:

gem update --system
gem install watir

Mac

To install Firefox driver:

sudo gem update --system
sudo gem install firewatir

To install Safari driver, you have to install Xcode first and then:

sudo gem install rb-appscript
sudo gem install safariwatir

Linux

To install Firefox driver:

sudo gem update --system
sudo gem install firewatir

Examples

Some examples from watir.com/examples

Loading Watir gem to drive Internet Explorer on Windows

require 'watir'

Loading FireWatir gem to drive Firefox on Windows/Mac/Linux

require 'firewatir'

Starting a new browser & and going to our site

browser = Watir::Browser.new
browser.goto("http://bit.ly/watir-example")

Setting a text field

browser.text_field(:name => "entry.0.single").set "Watir"

Setting a multi-line text box

browser.text_field(:name => "entry.1.single").set "I come here from Australia. \n The weather is great here."

Setting and clearing a radio button

browser.radio(:value => "Watir").set
browser.radio(:value => "Watir").clear

Setting and clearing check boxes

browser.checkbox(:value => "Ruby").set
browser.checkbox(:value => "Python").set
browser.checkbox(:value => "Python").clear

Clicking a button

browser.button(:name => "logon").click

Clearing, getting and selecting selection list values

browser.select_list(:name => "entry.6.single").clear
puts browser.select_list(:name => "entry.6.single").options
browser.select_list(:name => "entry.6.single").select "Chrome"

Clicking a button

browser.button(:name => "submit").click

Checking for text in a page

puts browser.text.include?("Your response has been recorded.")

Checking the title of a page

puts browser.title == "Thanks!"

watir's People

Contributors

jarmo avatar jarib avatar bret avatar zeljkofilipin avatar charley avatar hatched-marek avatar angrez avatar raldred avatar abaird avatar jojje avatar jubishop avatar undees avatar jamesgpearce avatar mattbaker avatar pairing avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.