I'm using Watir to automate the testing of a report generated by MS
SQL Reporting Services.  The report generates 4 pages of output.  Each
page except the last one has a table which is addressable with Watir
as follows:

        tbl = ie.frame(:id,'ReportFramectl144').frame
(:id,'report').table(:class,'a3 r3')

For whatever reason, the final page is addressed differently.  It is:

        tbl = ie.frame(:id,'ReportFramectl144').frame

So in order to handle this situation I placed the following 'begin -
rescue - end' block inside a loop which is executed for each page of
the output:

        tbl = ie.frame(:id,'ReportFramectl144').frame
(:id,'report').table(:class,'a3 r3')
        puts "A3 R3"
        tbl = ie.frame(:id,'ReportFramectl144').frame
        puts "A3"

My expectation is that any exception generated by the 'a3 r3'
definition of tbl should cause the 'a3' definition of tbl to be
executed.  However, this is not happening.  When the 'a3 r3' exception
raises an exception, the script does not execute the rescue clause,
nor does it skip the final execution of 'puts "A3 R3".  The complete
output, run within Scite, is as follows:

   >ruby wt_no_policy_claims_list_spec.rb
   A3 R3
   A3 R3
   A3 R3
   A3 R3

   Watir::Exception::UnknownObjectException in 'Wt No Policy Claims
List No Policy Claims'
   Unable to locate element, using :class, "a3 r3"
   wt_no_policy_claims_list_spec.rb:26:in `loop'

   Finished in 7.032 seconds

   1 example, 1 failure

So 'rescue' doesn't seem to be working as advertised, at least as I
understand it.  Any wisdom would be much appreciated.

You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To post to this group, send email to watir-general@googlegroups.com
Before posting, please read the following guidelines: 
To unsubscribe from this group, send email to 
For more options, visit this group at 

Reply via email to