Forum Discussion
Hi SanthoshShetty,
Can you please provide more details to describe your questions? for instance, can show an endpoint here and let us know what id you would like to fetch.
As you request, it seems need to construct sql statement to connect DB. Anyway, it should be simple to query DB via groovy.
Not sure how you process endpoint in project level? fetch all endpoints under project? or you'd like to get endpoint under test suites for each test case / test step?
Fetch endpoints for each test suite - test case - test step (Rest request)
project.getTestSuiteList().each{testsuite -> testsuite.getTestCaseList().each{testcase -> testcase.getTestStepsOfType(com.eviware.soapui.impl.wsdl.teststeps.RestTestRequestStep.class).each{teststep -> log.info teststep.testRequest.getEndpoint() } } }
fetch all endpoints under project
project.getInterfaceList().each{it.getEndpoints().each{log.info it}}
Thanks
/Aaron
- SanthoshShetty7 years agoOccasional Contributor
Hi Aaron,
Thanks alot for your response.
End point looks like below:
https://projectURL01:9002/webservices/website/public/releaseId
I have the project structure as like below.
Project -> TestSuite ->TestCase ->RestEndpoint (to fetch the id)
Before the execution is triggered, I have to insert a record into the DB and for that I neeed an id and that I will get by hitting the above end point. Connecting to the DB and inserting the record and all that am able to do, but am not knowing how to hit the end point from the BeforeRun event. Thanks alot that your response has the details to fetch the rest end point in test suite-test case, can you please tell me, after reading the end point how it can be triggered. So that I will read the response and capture the id details and will set in a global property.
Then after the other execution continues, that is BeforeRun, BeforeTestSuite, BeforeTestCase and the steps in the testcase.
Even am ok, instead of maintaining a test case with end point to fetch id details , if I can create an end point in the BeforeRun Event and hit the service and read the id details,
Thank you.
Related Content
- 2 years ago
- 8 years ago
Recent Discussions
- 13 days ago
- 16 days ago