Lapis Lazuli:Browser.find all()
Revision as of 14:07, 20 June 2016 by Gijsp (talk | contribs) (Created page with "== find_all functionality == <code>browser.find_all()</code> works almost the same way as <code>browser.find()</code> except that find_all wil...")
find_all functionality
browser.find_all()
works almost the same way as browser.find()
except that find_all will return an array / collection of all the elements that match your condition.
Examples
HTML
<div class="foo">1</div> <div class="foo" id="bar">2</div> <div class="fox" id="jump">3</div>
RUBY
elements = browser.find_all(:class => 'foo') print elements => array(0 => ::WatirElement::, 1 => ::WatirElement::) print elements[0].text => "1" print elements[1].id => "bar" collection = browser.find_all(:div) print browser.pick_one(:last. collection).id => "jump"