Thanks the unit tests are of course the obvious resource, sorry.

 

But trying them I am now confused. I am running the following test with
the subsequent error. I have run out of brain. I cannot attach the
'Another' modal dialog. Can I borrow some brain?

 

:::: Environment ::::

 

Ruby 1.8.2-15

MS Vista

watir-1.5.1.1166

 

:::: Test code ::::

 

$LOAD_PATH.unshift File.join(File.dirname(__FILE__), '..') if $0 ==
__FILE__

require 'unittests/setup'

require 'watir/dialog'

 

class TC_Dialog_Test < Test::Unit::TestCase

  include Watir

  

  def setup

    $ie.goto($htmlRoot  + 'modal_dialog.html')

  end    

  def teardown

    begin 

      sleep 0.4 # XXX 

      dialog.button('OK').click

    rescue

    end

  end

  

  def test_modal_text

    $ie.text_field(:name, 'modal_text').set('Some Text I Entered')

    $ie.button(:value, 'Close').click

  end 

    

  def test_another_modal

   $ie.button(:value, 'Another Modal').click     

   $ie2 = IE.attach(:title, /Pass/) 

  end

 

    #TODO

  def test_modal_with_frames

    $ie.button(:value, 'Modal with Frames').click 

  end

 

end

:::: Result ::::

 

>ruby modal_dialog_unit_test.rb

Loaded suite modal_dialog_unit_test

Started

E..

Finished in 5.266 seconds.

 

  1) Error:

test_another_modal(TC_Dialog_Test):

Watir::Exception::NoMatchingWindowFoundException: Unable to locate a
window with title of (?-mix:Pass)

 
c:/ruby182/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1630:in
`attach_browser_window'

 
c:/ruby182/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1507:in
`attach_init'

 
c:/ruby182/lib/ruby/gems/1.8/gems/watir-1.5.1.1166/./watir.rb:1500:in
`attach'

    modal_dialog_unit_test.rb:26:in `test_another_modal'

 

3 tests, 0 assertions, 0 failures, 1 errors

>Exit code: 1

 

_______________________________________________
Wtr-general mailing list
Wtr-general@rubyforge.org
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to