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.

1 ACCEPTED SOLUTION

Accepted Solutions
Radford
Super Contributor

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

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

View solution in original post

3 REPLIES 3
Wamboo
Community Hero

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

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

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

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

View solution in original post

SmartBear217
Contributor

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

This worked.

 

Thanks a bunch.

cancel
Showing results for 
Search instead for 
Did you mean: