Forum Discussion

smadji's avatar
smadji
Contributor
10 years ago

asserting 'not match' using content match assertion

I am trying to assert that the results in my api do not return all the results in the database

 

I run a query that gets all the results as a count and enter that into a property at the suite level

 

Now I right click on totalCount in the response of any one of my queries and select add assertion -> for content

 

On the top the assertion generates the path to the value of how many results are found

 

At the bottom I put the code that points to the property

 

What do I add before the code that points to the property to indicate 'is not' ?

So the total count will not match the total results from the DB...

 

I know this can be easily done with groovy but since I would like to add it to 100s of test steps - it would be easier to create an assertion and clone it project wide...

  • You can use Script Assertion which will generate a Groovy type assertion step and then clone the assertion:

     

    Capture.JPG

  • You can use Script Assertion which will generate a Groovy type assertion step and then clone the assertion:

     

    Capture.JPG