begin
rescue =>e
        puts e.message
        puts e.backtrace
end
Thanks.
Wesley Chen.


On Wed, Mar 25, 2009 at 4:04 AM, watirRookie <ukj...@hotmail.com> wrote:

>
> hello,
> I am fairly new to watir and ruby in general. I am trying to automate
> some web testing that requires to check for the existing of certain
> html elements. So I am using the following code in my def:
>
> #
> def validate_header_login_page
>  begin
>        assert($ie.div(:id, "header").exists?)
>          puts (" header Test Passed")
>        rescue => e
>          puts(" header Test Failed" + "\t\t" + e.message)
>  end #begin
> end #def
> #
>
> The problem I am having is that if a certain element does not exist or
> if I am doing negative test such as:
> assert($ie.div(:id, "headerxyz").exists?)
>
> the header test puts the failing comment but I don't get the metrics
> correct in the end.
> 3 tests, 5 assertions, 0 failures, 0 errors
>
> Does anyone know how to put the failing comment and also increment the
> fail metrics so it looks like:
> 3 tests, 5 assertions, 1 failures, 0 errors
>
> Thanks,
> uj
>
> >
>

--~--~---------~--~----~------------~-------~--~----~
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: 
http://wiki.openqa.org/display/WTR/Support
To unsubscribe from this group, send email to 
watir-general-unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/watir-general
-~----------~----~----~----~------~----~------~--~---

Reply via email to