Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions lib/WWW/Selenium.pm
Original file line number Diff line number Diff line change
Expand Up @@ -2801,6 +2801,29 @@ sub get_xpath_count {
return $self->get_number("getXpathCount", @_);
}

=item $sel-E<gt>get_css_count($css)

Returns the number of nodes that match the specified selector, eg. "css=table" would give the number of tables.

=over

=item $css is the css selector to evaluate. do NOT wrap this expression in a 'count()' function; we will do that for you..

=back

=over

=item Returns the number of nodes that match the specified css selector

=back

=cut

sub get_css_count {
my $self = shift;
return $self->get_number("getCssCount", @_);
}

=item $sel-E<gt>assign_id($locator, $identifier)

Temporarily sets the "id" attribute of the specified element, so you can locate it in the futureusing its ID rather than a slow/complicated XPath. This ID will disappear once the page isreloaded.
Expand Down
1 change: 1 addition & 0 deletions t/selenium-core.t
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ $sel->_method_exists("get_element_height");
$sel->_method_exists("get_cursor_position");
$sel->_method_exists("get_expression");
$sel->_method_exists("get_xpath_count");
$sel->_method_exists("get_css_count");
$sel->_method_exists("assign_id");
$sel->_method_exists("allow_native_xpath");
$sel->_method_exists("ignore_attributes_without_value");
Expand Down
Loading