Title: Re: [Wtr-general] Script return values
I came across some situations where the exceptions thrown by Watir were not picked up by the rescue. The work around for me was  
 
        rescue Exception => e
            log("Exception in #{getFunctionName()} " + e.message + "\n" + e.backtrace.join("\n"))
            return false, e.message
        ensure
____________________________________________

Peter Chau
Intermediate Automation Tester
[EMAIL PROTECTED]
Toll Free: 888.258.5859 ext. 4443
Local: 403.233.9466 ext. 4443
Fax: 403.277.7996
www.NETeller.com
 


From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Daniel Kurtz
Sent: Wednesday, July 27, 2005 10:03 AM
To: [email protected]
Subject: RE: [Wtr-general] Script return values

I'm familar with it. I don't think it would make much of a difference for what I'm doing here. Your code is exactly equivelant to:
 
try

rescue => e
    puts ("Test failed.  Error:  " + e)
end
 
Daniel Kurtz
Consultant
Olenick & Associates
205 W. Wacker Drive
Suite 2010
Chicago, IL 60606
312-332-0096


From: [EMAIL PROTECTED] on behalf of Chris McMahon
Sent: Wed 7/27/2005 9:32 AM
To: [email protected]
Subject: Re: [Wtr-general] Script return values

Do you know about $!?  It holds the last error Ruby encountered.  Instead of

> rescue
>      puts("TEST FAILED.")
> end

try

rescue
    puts ("Test failed.  Error:  " + $!)
end

_______________________________________________
Wtr-general mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/wtr-general

Reply via email to