Friday, April 9, 2010

watir:Run Unit Tests:How to run Unit test in Watir?

The unit tests don't work with the Watir 1.6 gem, as described below. Sorry.
You will need a development environment (Get the source code and unit tests from SVN) to run them.

Unit Tests
If you are following the Quick Start Guide, this section is not necessary to get up and running

Running the Unit Tests

After you have installed Ruby and Watir, you can run the unit tests to verify the installation.
To run the unit tests:
  • If you have installed Ruby in its default folder of "C:\Ruby" then in "SciTE" goto:
C:\ruby\lib\ruby\gems\1.8\gems\watir-1.5.x\unittests\core_tests.rb
And press "F5"
  • The tests should all run and pass.
  • If you receive any errors, try updating your gems with:
gem update

Having Problems?

If you are using Windows XP with Service Pack 2 or Windows Server 2003, several tests will fail unless you enable active content. To fix this:
  • From the browser, select Tools > Internet Options
  • Select the Advanced tab
  • Under Security, check Allow active content to run in files on My Computer
  • Click OK

Additional Problems

  • If you have the google toolbar installed, you will need to turn off the popup blocker.
  • If you are installing on a new system, you will get a dialog asking about auto-complete. You will have to answer this question before you can run the unit tests.
  • The following gems must be installed. (These are installed when you install the watir gem.)
    • activesupport
    • user-choices

No comments:

Post a Comment