NAME
Brownie::Node - base class of Brownie::Node series
METHODS
new(%args)Returns a new instance.
my $node = Brownie::Node->new(%args);%argsare:driver: parent Brownie::Driver instancenative: native driver specific node representation instance
driverReturns a driver instance.
my $driver = $node->driver;nativeReturns a native node instance.
my $native = $node->native;attr($name)Returns an attribute value.
my $title = $node->attr('title');valueReturns the value of element.
my $value = $node->value;textReturns a child node text. (= innerText)
my $text = $node->text;tag_nameReturns a tag name.
my $tag_name = $node->tag_name;is_displayed,is_not_displayedWhether this element is displayed, or not.
if ($node->is_displayed) { print "this node is visible"; } if ($node->is_not_displayed) { warn "this node is not visible"; }is_checked,is_not_checkedWhether this element is checked, or not. (checkbox)
if ($checkbox->is_checked) { print "marked"; } if ($checkbox->is_not_checked) { warn "unmarked..."; }is_selected,is_not_selectedWhether this element is selected, or not. (radio, option)
if ($radio->is_selected) { print "this radio button is selcted"; } if ($option->is_not_selected) { warn "this option element is not selected"; }set($value)Sets value to this element. (input, textarea)
$input->set($value); $textarea->set($text);selectSelect this element (option, radio)
$option->select; $radio->select;unselectUnselect this element (options - multiple select)
$option->unselect;clickClicks this element.
$link->click; $button->click;find($locator)Finds and returns an located element under this.
my $element = $node->find($locator); # search under $nodeall($locator)Finds and returns located elements under this.
my @elements = $node->all($locator); # search under $node
AUTHOR
NAKAGAWA Masaki <masaki@cpan.org>
LICENSE
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.