ATS: count number of occurences of same value

1
Hi! Is it possible for to count the number of occurences of the same value in a datagrid? I actually wanted to assert that a record in a grid was not there (after I did some action). But it is not as simple as checking whether the record is gone after deletion, but checking whether the record A, valid until 31-12-2050 is there, but record A, valid until 31-12-2999 is NOT there. The only difference is the date. And yes, there are also other records in the grid with date 31-12-2999, records B, C and D… That's why I tought it would be easier to check whether there is only one occurence of record A. Thanks!
asked
2 answers
1

Not a direct answer to your question. But you are saying “But it is not as simple as checking whether the record is gone after deletion” . Why is it not that simple if I may ask?

There is an action called ‘Assert if condition failed’. So you could use:

- ‘Find/Assert DataGrid Row’ with (for example) column1 has value A and column2 has value 31-12-2999.

This action will pass

- Delete the above record with the action you are already using

This action will pass

- ‘Assert if condition failed’ with pre-condition the same find/assert datagrid row as above

This action will not be executed, because the pre-condition will fail finding the record since it was deleted, but if the pre-condition does find the record that should have been deleted it will fail.

answered
0

It is possible to count the number of rows in a datagrid. What you need is a way to filter the grid to only show records A.

If there is a search option in the datagrid this would be the simplest way.

-Andrej

answered