Forum Discussion
Hey,
Do you want count the number of REST endpoints? Do I understand this right?
yes. For Rest endpoints only. including the same URL alongwith different method (ie. GET, POST, PUT)
(Example)
GET /a/b/c/123
POST /a/b/c/123
There should be calculated as 2 endpoints.
Case 1
---- GET
---- POST
Case 2
----- GET
Should have 2 endpoints covered in case 1 and case 2.
- Lucian7 years agoCommunity Hero
Oh, you can count them like this:
// Get all interfaces in the project
def interfaces = testRunner.getTestCase().getTestSuite().getProject().getInterfaceList()
def restInterfacesCount = 0
interfaces.each {
if (it instanceof com.eviware.soapui.impl.rest.RestService) {
restInterfacesCount++
}
}- Olga_T7 years agoSmartBear Alumni (Retired)
Hi all,
Lucian, thank you for having a look!
aaronpliu, if this suggestion works for you, do you mind accepting it as a solution? It would be easier to find it in the future.
Thanks in advance,
- aaronpliu7 years agoFrequent Contributor
Maybe I want to get number of endpoints that all of test suites contains, excluding duplicated (ie: some of test cases reference the same endpoint in test step). Not just count the number of endpoints under project.
Anyway, Thanks Lucian.
Many thanks
Regards,
/Aaron
Related Content
- 9 months ago
- 5 years ago