Hi Charley and Paul,

If I use rescue true in the method, i wont be getting any error all the methods 
will execute. But, the method which has error does not shows what actual error 
it has.

Here is the code which i executed 

def test_yahooSite
    test_site = 'http://www.mail.yahoo.com'
    $ie = IE.new
    $ie.goto(test_site)
    assertTextfield
    assertCheckbox #If this method fails it wont execute the next method
    assertButton
end
    
def assertTextfield
assert($ie.text_field(:id,"username").exists?, "Username text field does not 
exist")
assert($ie.text_field(:id,"passwd").exists?, "Password text field does not 
exist")
end
    
def assertButton
      assert($ie.button(:value,"Sign In").exists?, "Sign In button does not 
exist")
end
    
def assertCheckbox
     assert_equal($ie.checkbox(:id, "persistent",2).isSet?, "Keep me signed in, 
         check box is not checked")
     rescue
     true
end    

Is there any other way which executes all the steps defined in the method even 
any of the step fails and also should show the message why it has failed? 


That's what I get for answering emails before finishing my first cup of coffee. 
 :)

-c

 On 4/10/07, Paul  Carvalho < [EMAIL PROTECTED]> wrote: You're  repeating 
yourself, Charley. ;-)  This new assertions.rb covers one aspect of  what Watir 
User asked but not the other: "Its not only related to assertions ..  ".  
That's why I described a general Ruby construct for recovering from methods  
regardless of what Watir version you're using. 

Cheers.  Paul C. 


 On 10/04/07, Charley  Baker <  [EMAIL PROTECTED]> wrote: You  can also pull 
the assertions file and use it with Watir 1.4.1. 
https://svn.openqa.org/svn/watir/trunk/watir/watir/assertions.rb    Download 
this file, put it in your watir/watir directory and use it the  same way I 
mentioned in my previous mail.  

-Charley





       
---------------------------------
 Check out what you're missing if you're not on Yahoo! Messenger 

Attachment: yahoopage.rb
Description: 2132032765-yahoopage.rb

Attachment: yahoorescue.rb
Description: 43341326-yahoorescue.rb

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

Reply via email to