I.count

Assert the number of occurances for a text or element

Usage

I.count(target, n)
Parameter Type Remarks
target string Text or element to find
n number Expected number of occurances

# Count text

I.count("Success", 20);

Asserts that there's 20 occurances of the text "Success".

Ignores casing and white-spaces. This behavior is not configurable at the moment.

# Count element using CSS / XPATH

I.count(".product", 20);

Asserts that there's 20 occurances of the element with the "product" CSS class.