countElements

The countElements method returns the number of elements on a web page that match a CSS selector.

Syntax

countElements( cssSelector )

Arguments

Argument Description
cssSelector (string) A CSS selector.

Returns

(Integer). The number of elements.

Example

local n = session:countElements("#next-button")