cancel
Showing results for 
Search instead for 
Did you mean: 

Detach event from test complete

SOLVED
Occasional Contributor

Detach event from test complete

Hi all,

My case:

1. I have several keyword tests in my project

2. I also have OnLogError General Event attached 

 

The problem

In one of the keyword test I have to turn it off.

Is it possible to do it?

 

Thanks tcuser3 ...

1 ACCEPTED SOLUTION

Accepted Solutions
Community Hero

Re: Detach event from test complete


@tcuser3 wrote:

Hi and thank you for a quick reply.

 

One more thing - is there a way to do it FROM testitem and not by adding code to the event itself ?

 

Thanks tcuser3 ...

 


Short answer, no... because it's an event.  As soon as an error is logged and the event triggers, the event handler takes over.  You would have to make sure that, from your actual keyword test or script code you don't actually call anything that generates an error in the test log.  This includes propery checkpoints and other processes that write errors to the test log.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
4 REPLIES 4
Contributor

Re: Detach event from test complete

Yes you can do that. Just go into OnLogError general event and write the condition in it.

 

if (Project.TestItems.Current.Name == 'Keyword Test Name to Skip'
{ // Do nothing
null;
}
else
{
// For remaining cases
}

Highlighted
Occasional Contributor

Re: Detach event from test complete

Hi and thank you for a quick reply.

 

One more thing - is there a way to do it FROM testitem and not by adding code to the event itself ?

 

Thanks tcuser3 ...

 

Community Hero

Re: Detach event from test complete


@tcuser3 wrote:

Hi and thank you for a quick reply.

 

One more thing - is there a way to do it FROM testitem and not by adding code to the event itself ?

 

Thanks tcuser3 ...

 


Short answer, no... because it's an event.  As soon as an error is logged and the event triggers, the event handler takes over.  You would have to make sure that, from your actual keyword test or script code you don't actually call anything that generates an error in the test log.  This includes propery checkpoints and other processes that write errors to the test log.


Robert Martin
[Community Expert Group]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Extensions available
Occasional Contributor

Re: Detach event from test complete

Thank you.

 

 

New Here?
Join us and watch the welcome video:
6 / 7 API Testing Mistakes Video
Top Kudoed Authors