Ask a Question

Is there a way to run the same groovy script before running every test case?

SOLVED
SmartBear217
Contributor

Is there a way to run the same groovy script before running every test case?

Is there a way to have all scripts within a test suite or project run a groovy script before they execute? (Without having to put a groovy script inside every test case. I want to have only one groovy script that automatically runs any time any of the test cases run.)

 

Putting the script inside the project level/test suite level setup script doesn't work unless I run them at the project or test suite level. I want to run at the test case level and still have it call the groovy script everytime without any need to add something to every single test case.

3 REPLIES 3
Wamboo
Community Hero

Hi

 

You can Consider to use TestComplete events.

 

The one you need for now is event named "OnStartTest". You can find it inside project event manager.

 

If you do not have it on project list add it from menu using right mouse button.

 

Here is the documentation for this event:

 

https://support.smartbear.com/testcomplete/docs/reference/events/onstarttest.html

 

Hope this help you,
If you need any more help, let me know

Radford
Super Contributor

As mentioned above, events are the way to go, here is the Ready API documentation (The link above is for Test Complete, another SmartBear product):

 

https://support.smartbear.com/readyapi/docs/testing/handling-events.html

This worked.

 

Thanks a bunch.

cancel
Showing results for 
Search instead for 
Did you mean: