[rspec-users] Unable to use Rspec Framework in Watir

abhisheksreepal abhisheksreepal at gmail.com
Fri Oct 23 09:47:27 EDT 2009


Hi ,

My OS is Windows Xp.
I have mentioned a code below.Initially I didn't had safariwatir
installed.
When i was executing the code, I was getting an Error-  No such File
to Load -"safariwatir"
I didn't Know the Root Cause. So had to install SafariWatir in
Windows.

Now I am able to execute the code.
I am getting "PENDING" which i want to implement
Please tell me how to implement with simple example
and what are the methods i can use.(Please give me the source where
all the methods are listed like "should include","should_not
include","should have_link")
Whenever I use these methods"should include" or "should_not include",
i will get No Method Defined Error. I don't no which library file
should i "include" or "require"


# CODE.


    require 'test/unit/assertions'
  require 'rubygems'
   require 'watir'
   require 'spec'
  require 'watir/container'
   include Watir::Container
    include Test::Unit::Assertions
            #include
Spec::Example::Subject::ExampleGroupMethods::ExampleMethods
$email="www.gmail.com"
$username="USERNAME"
$password="password"
describe 'should Navigate to Gmail Login Screen' do
    it 'Enter username'
    $ie = Watir::IE.new
    $ie.goto($email)
    $ie.text_field(:id, 'Email').set($username)
    #$ie.text.should ('Aidy Lewis')
  end


OUTPUT:


C:\Ruby\Abhi_My Ruby>spec abhiRspec.rb --format specdoc


should Navigate to Gmail Login Screen
- Enter username (PENDING: Not Yet Implemented)


Pending:


should Navigate to Gmail Login Screen Enter username (Not Yet
Implemented)
./abhiRspec.rb:18


Finished in 0.672 seconds


1 example, 0 failures, 1 pending




More information about the rspec-users mailing list