Somehow #{$!.class} prints as: SystemExit1 or SystemExit0, which is
the opposite than what I see on the console in Irb: Exit code: 0,
Error code: 1.
In any case I need only the numbers 1 or 0 without the word
SystemName, any idea?
I wrote a script to send email if the test is failing.
For now I am setting variable to 0 when initializing the test, and 1
at the end of the test, if it is not failing, the variable is set to
1. But I prefer to not depends on that.
On Apr 14, 2:00 pm, Ethan <[email protected]> wrote:
> as Charley said, watir does not exit, itself.
> If you want to know if an exception occurred causing your program to exit,
> you can check if the global exception variable, $! is set.
> at_exit do
> if $!
> print "an exception occurred of type #{$!.class}"
> end
> end
> or something along those lines.
>
> On Wed, Apr 14, 2010 at 16:36, Charley Baker <[email protected]>wrote:
>
>
>
> > Watir itself doesn't have an exit code, it's just a library. Are you
> > talking about your own testing framework, rspec, test::unit? Those generally
> > can set exit codes. My question is what are you trying to do? Set it up in a
> > CI run? Something else entirely?
>
> > -c
>
> > On Wed, Apr 14, 2010 at 2:30 PM, Shlomit Gazit
> > <[email protected]>wrote:
>
> >> Is there a method to use watir exit code (0 or 1)?
> >> I want to know that if it is 0 to do something at_exit.
>
> >> Thank you, Shlomit.
>
> >> --
> >> Before posting, please readhttp://watir.com/support. In short: search
> >> before you ask, be nice.
>
> >> You received this message because you are subscribed to
> >>http://groups.google.com/group/watir-general
> >> To post: [email protected]
>
> >> To unsubscribe, reply using "remove me" as the subject.
>
> > --
> > Before posting, please readhttp://watir.com/support. In short: search
> > before you ask, be nice.
>
> > You received this message because you are subscribed to
> >http://groups.google.com/group/watir-general
> > To post: [email protected]
--
Before posting, please read http://watir.com/support. In short: search before
you ask, be nice.
You received this message because you are subscribed to
http://groups.google.com/group/watir-general
To post: [email protected]