Trigger REST end point from an groovy script
Hello,
We have a requirement in our project to fetch an id from a REST end point and that would be stored in the DB.
We have to do this in Before Run event and we are using ProjectListener.beforerun event for it. I tried but not able to proceed further.Can some one please help me in implementing this, that is calling the REST end point (it is defined in a project in a separate testsuite) from the groovy script in BeforeRun event.
I can maintain the REST end point in the project or it is even ok to construct the end point and hit the service in the BeforeRun event groovy script.
So the final flow will be, first it comes to the BeforeRun event hits the end point and fetches the id and the same will be inserted as a record in DB and then BeforeSuite, BeforeTestCase, BeforeStep and the actual teststeps executions goes.
Thanks alot.