Forum Discussion

TesterNo1's avatar
TesterNo1
Contributor
9 years ago

How to call groovy lib classes from event handler?

1. I have lib classes in ext folder of ready api.I am able to access these classes from groovy test steps but having trouble when i try to use it events.They dont get executed at all.

 

2.I have groovy libraries in script library in C:\ReadyAPI-1.5.0-m-SNAPSHOT\bin\scripts.they work fine from groovy test step but dont work from events.

Question 1:

Am i missing something ?Above mentioned is all generic libraries.

 

Question 2:

Also,i have doubt if i can have testrunner specific statements in groovy scripting lib externally ?

 

Question 3:I have 2 groovies that needs to be repeated for all test cases.Initial set up and After execution(save results in db).Which approach is best and feasible ?

 

1.Have the entire code outside of the test cases either in events (so it will be executed before and after test case)  ?

 

2.Copy the groovy call to start up and teardown script of each test case ?

 

2 Replies

  • nmrao's avatar
    nmrao
    Champion Level 3
    May be you can show the script that is being used and error that you see if any from the logs would help.
  • Hi,

    1. Were you able to access testrunner / context / log etc in event handler via script library ?

    2. Can you share DB publishing groovy used as event handler ?