tstmartin
14 years agoContributor
[Resolved] How to do assertion count() of multiple responses
Hi,
Is there some syntax or technique to allow comparing counts of responses of different test steps in the
XPath Match tool ?
I want to do an assertion that a count of specific elements in a test step
response matches a count of elements in a response from a previous test
step.
For example:
associateDomainsResponse == current response
insertDomains#Response == response from a previous test step
-----------------------------------------------------------
-----------------------------------------------------------
-----------------------------------------------------------
XPath Expression:
declare namespace ns2='http://v1_0.webservice.asi.proxy.example.com/';
count( //ns2:associateDomainsResponse/return/domains) =
count('${insertDomains#Response#declare namespace ns2='http://v1_0.webservice.asi.proxy.sincera.com/'; //ns2:insertDomainsResponse/return/domains}')
Expected Result:
true
-----------------------------------------------------------
Putting the count for the insertDomains response into the Expected Result area
also fails.
Perhaps I have to use XQuery or Groovy instead of the XPath Match?
Thanks
-tom
Is there some syntax or technique to allow comparing counts of responses of different test steps in the
XPath Match tool ?
I want to do an assertion that a count of specific elements in a test step
response matches a count of elements in a response from a previous test
step.
For example:
associateDomainsResponse == current response
insertDomains#Response == response from a previous test step
-----------------------------------------------------------
-----------------------------------------------------------
-----------------------------------------------------------
XPath Expression:
declare namespace ns2='http://v1_0.webservice.asi.proxy.example.com/';
count( //ns2:associateDomainsResponse/return/domains) =
count('${insertDomains#Response#declare namespace ns2='http://v1_0.webservice.asi.proxy.sincera.com/'; //ns2:insertDomainsResponse/return/domains}')
Expected Result:
true
-----------------------------------------------------------
Putting the count for the insertDomains response into the Expected Result area
also fails.
Perhaps I have to use XQuery or Groovy instead of the XPath Match?
Thanks
-tom