Appearance
I.getCount()
Gets the number of visible text occurrences or visible element on the page.
Usage
js
var count = I.getCount(target: string)Parameters
| Parameter | Type | Description |
|---|---|---|
target | string | The visible text to count, or target elements — by CSS or XPath selector. |
Returns
Returns the number of visible text occurrences or visible matching elements as a number.
Examples
js
var nErrors = I.getCount("Error")In this example, the test counts how many times the visible text “Error” appears on the page.
js
var nRows = I.getCount(".order-items tr")In this example, the test counts the number of visible table rows inside the .order-items table.