Ask a Question

is there a better way to count number of referenced endpoints

aaronpliu
Frequent Contributor

is there a better way to count number of referenced endpoints

Hi,

Any ideas to count number of endpoints in test suite / test case?  Maybe use the same endpoints in different test cases.

I'd like to know how many outstanding endpoints left.

 

Thanks in advance

 

 

/Aaron

5 REPLIES 5
Lucian
Community Hero

Re: is there a better way to count number of referenced endpoints

Hey,

 

Do you want count the number of REST endpoints? Do I understand this right?



If my answer helped please click on the 'Accept as Solution' button.
aaronpliu
Frequent Contributor

Re: is there a better way to count number of referenced endpoints

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.

 

 

Lucian
Community Hero

Re: is there a better way to count number of referenced endpoints

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++
}
}

 



If my answer helped please click on the 'Accept as Solution' button.
Olga_T
Moderator

Re: is there a better way to count number of referenced endpoints

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,

 

 


Olga Terentieva
SmartBear Assistant Community Manager

aaronpliu
Frequent Contributor

Re: is there a better way to count number of referenced endpoints

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

 

cancel
Showing results for 
Search instead for 
Did you mean: