On Thursday, March 14, 2013 3:30:47 AM UTC-7, mc060200778 wrote:

> Hi
>
> I am trying to find out the way that *how to continue test cases 
> execution on error*. Right now test case execution stops as soon some 
> error encounter during test execution.
> I am using Watir Test/Unit framework.
>
> Any comments please?
>

Are all your tests just a series of steps in order all inside a single test 
method?   This is a common mistake for people who try to use unit test 
frameworks for functional testing.  If your test looks something like the 
following, then this is likely your problem 

class TestMyAppWithWatir < Test::Unit::TestCase
  def setup
    @browser = Watir::Browser.new
  end

  def my_test_script
    a very long series of steps here...

    I mean really really long... 
  end
end



This problem is reflective of a bad habit, often learned from tools like 
Selenium IDE or various flavors of mercury poisoning (qtp etc), of creating 
'tests' based on recording manual tests, often a long series of them, in 
order..  e.g.  create a user, log in, do x, do y, do z that uses the thing 
your created in y, delete y, etc.   It's really a series of multiple tests, 
all in one script and often referred to as if it was a single 'test'    

First of all, bad way to do automation.  a good automated test ought to be 
atomic, create any data it needs, clean up after itself, be able to be run 
in isolation, or with other tests in any order, or in parallel with other 
tests. 

Unit test frameworks presume tests designed like that, and if ANYTHING 
generates an error when running a test, that test is failed the result 
recorded, and the framework moves on to the next test.  

If you are using a unit test framework, design your tests to meet the 
above, and define each one as it's own test inside that class.  it is 
REALLY important you not expect these to run in the order listed btw.. make 
each one independent.  So you'd have LOTS of little things like

def user_can_login
  blahhh
end

def can_search_for_item
  blahhh
end

etc etc

-- 
-- 
Before posting, please read http://watir.com/support. In short: search before 
you ask, be nice.

[email protected]
http://groups.google.com/group/watir-general
[email protected]

--- 
You received this message because you are subscribed to the Google Groups 
"Watir General" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to