Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Jubula » Event Handler = Failed test case
Event Handler = Failed test case [message #788869] Thu, 02 February 2012 05:05 Go to next message
Richard Skoog is currently offline Richard Skoog
Messages: 46
Registered: October 2011
Member
Hi,

Sometimes the Event Handler is used to handle cases when two scenarios can happen and both are correct.

The problem is that as soon as an Event Handler is called this test case is "Failed" according to the log file. When using continous integration and daily builds this is not good due to that you'll get a failed test case even though it's not failed.

Is there any solution for this? It's maybe possible to have a setting not handling manually inserted Event Handlers as failed, or something like that.

Regards Richard
Re: Event Handler = Failed test case [message #788908 is a reply to message #788869] Thu, 02 February 2012 06:17 Go to previous message
Alexandra Schladebeck is currently offline Alexandra Schladebeck
Messages: 1120
Registered: July 2009
Senior Member
Hi,

If both cases are correct, then it sounds like you need the reentry type "retry". This repeats the failed Test Step once the Event Handler has been executed.

You should choose a Test Step that ideally performs a check that will either be correct from the outset, or will be correct once the Event Handler has been executed. The check should reflect a situation that is correct - i.e. the one you require to continue.

e.g.

TC: Deal with occasional overwrite dialog (for when saving asks if I want to overwrite the file)
- Check for non-existence of overwrite dialog (this is what I want to have)
--- if the dialog does exist (i.e. the check fails) then the Event Handler is activated. It can e.g. click "OK" in the window
--- once the Event Handler has been executed, the reentry type "retry" means that the originally failed Test Step is executed again.
--- now, the window is not there, so it is marked as successful.
If the dialog wasn't there in the first place, then the Test Step is marked as successful as well.

There is a cheat sheet on using Event Handlers, including a retry example. The documentation on the retry Event Handler is here.

HTH,
Alex
Previous Topic:Cannot activate app with modal login
Next Topic:Dependencies error on Jubula source code
Goto Forum:
  


Current Time: Wed Aug 20 00:56:26 EDT 2014

Powered by FUDForum. Page generated in 0.02118 seconds