Forum Discussion

llarocca's avatar
llarocca
Occasional Contributor
8 years ago
Solved

I need to be able to put a Range into my Assertions

In order to be able to change Environments easily, I need to be able to put a Range into my Assertions for a TotalResults field.  I have found references on the board to the ability to do this but I ...
  • llarocca's avatar
    llarocca
    8 years ago

    That got me close enough.  Here is what I did.  Two assertions:

     

    Lower End of the Range:

    XPath Expression:

    declare namespace ns1='http://ws.ussco.com/eCatalog/catalog/1';
    ${DataSource RedPen SmallBS#totalResultsLowerRange} <= //ns1:getSearchResponse[1]/ns1:searchResponse[1]/ns1:ItemPage[1]/ns1:TotalResults[1]

     

    Expected Result:

    true

     

    Upper End of the Range:

    declare namespace ns1='http://ws.ussco.com/eCatalog/catalog/1';
    ${DataSource RedPen SmallBS#totalResultsUpperRange} >= //ns1:getSearchResponse[1]/ns1:searchResponse[1]/ns1:ItemPage[1]/ns1:TotalResults[1]

     

    Expected Result:

    true

     

    And then all the Requests in my data set don't have to match exactly.

     

    Thanks for giving me both methods!

     

    Laura