Rows' count (advanced)
It’s possible to go further with the assertion row-count and define a filter. Suppose that you know that you’ve made less than 100 sales with a TotalAmountWithVAT higher than 1000$. To assert this create a query returning all your sales, define a filter to hold the rows with a TotalAmountWithVAT greater than 1000 and assert that the count is not greater than 100. You could also have asserted that this set of rows represent less than 1% of your sales. All these scenarios are supported by row-count.
To define a filter, you must specify it in the element row-count by the means of the tags filter.
This filter is defined by the means of variables, expressions and predicates. For more info about these elements check the page about them.
Fixed value and percentage
It’s possible to use the standard behaviour of row-count and compare the remaining rows (after filter’s application). To achieve this, just specify the expected values in the xml element corresponding to one of the following operators equal, more-than, less-than (the two last element accepts the overload of the attribute or-equal).
If you want to assert the ratio of filtered rows, you can specify percentage. The count of filtered rows will be divided by the count of rows in the unfiltered result-set. To specify this kind of behaviour, you need to add the symbol percentage (%) after the value in the operator tag.