Uncle Sam
Uncle Sam

Reputation: 255

Counting number of rows in a dynamically changing web table in karate?

Requirement is to count the number of rows available in a dynamically changing web table created using <div>. For this I tried using waitForResultCount('.myClass', 4) just to get the basics right of what is currently been displayed on the UI but couldn't get any help.

I want to see if the current value is updated in the table as a row or not, so want to know the updated count of the number of rows and match particular field in the corresponding rows. Any help would be appreciated. Thanks in advance!

Upvotes: 1

Views: 750

Answers (1)

Peter Thomas
Peter Thomas

Reputation: 58088

Just find all instances of a chosen attribute. This is just an example, you can find other ways to identify each "row":

* def rows = locateAll("[tabulator-field]")
* print 'count:', rows.length

Upvotes: 1

Related Questions