public
Description: A Framework for Watir
Home | Edit | New

Commands

The following commands can be used in tests or in script\console

  • browser – access the browser
  • goto url – go to a url; url is relative to the base url.
  • site.config[:url] – returns the base url of the environment (see also Configuration Options)

These are two different ways of doing the same thing:

browser.goto site.config[:url]
goto ''

In addition, you can access any page; e.g. home_page will return an instance of HomePage. See Pages

Execution Contexts

These commands will work in any “execution context”. WatirCraft supplies several execution contexts:

  1. Inside an it block in an Rspec test
  2. Inside a before or after block in an Rspec test
  3. Inside a step definition for a Cucumber test
  4. At the script\console prompt (after irb START)
  5. Inside your initialize_browser method definition for your Site.
  6. Inside a project method
Last edited by MauravdL, Fri Apr 17 14:00:26 -0700 2009
Home | Edit | New
Versions: