Code Monkey home page Code Monkey logo

watir's Introduction

Watir

Watir Logo

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.

About

This is the meta-gem for installing all necessary dependencies and having a convenient way to switch between different Watir drivers.

Currently supported drivers are:

Visit Watir website or refer to each gem's own README and documentation for better understanding of how to use these libraries.

Watir Related Libraries

Integration

Frameworks

Other

Usage

Add it into your Gemfile:

gem "watir", "~>4.0"

Or install it manually with the following command:

gem install watir

Then in your test file:

require "watir"
browser = Watir::Browser.new

The command above will use watir-classic with Internet Explorer on Windows and watir-webdriver with Firefox on Linux/OS X by default.

Switching Between Drivers

There are multiple ways to specify a different driver.

By specifying different browser via #initialize:

require "watir"
# will use watir-webdriver with Chrome
browser = Watir::Browser.new :chrome

By specifying driver manually via Watir.driver#=:

require "watir"
# will use watir-webdriver with Internet Explorer
Watir.driver = :webdriver
browser = Watir::Browser.new :ie

Or by using an environment variable WATIR_DRIVER:

require "watir"
# will use watir-classic
ENV["WATIR_DRIVER"] = "classic"
browser = Watir::Browser.new

Limitations

Currently it is possible to use only one driver per Ruby process. All the methods to switch between drivers won't have any effect after you've opened your first browser window.

License

See LICENSE for details.

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.