Getting Started

vapir edited this page Sep 13, 2010 · 1 revision

Assuming that you have installed Vapir via Rubygems, you will need rubygems to be required. How to do that is discussed in The RubyGems manual , see that for details.

Then you need to require Vapir. If you already have a script or scripts written for Watir, see Coming from Watir. If you’re writing from scratch, though, carry on.

You should be able to just

require 'vapir'

And then Autoload will take care of requiring the browser-specific library when you refer to Vapir::IE or Vapir::Firefox.

To instantiate a browser, use one of:

browser = Vapir::IE.new

browser = Vapir::Firefox.new

browser = Vapir::Browser.new

You can also use .start and .attach methods which you are probably familiar with from Watir.

Requiring browser-specific libraries directly

If there’s any problem with require 'vapir' not loading the browser-specific libraries, you can load them directly using:

require 'vapir-ie'

or

require 'vapir-firefox'