ruby - Find element which has no style -
in table, there rows this:
<tr id="filtersjob_intrinsictable_row6" class="evenrow" style="display: none;">some stuff here<tr> <tr id="filtersjob_intrinsictable_row7" class="evenrow">some stuff here<tr> how use watir rows displayed, i.e rows not have style="display: none; ?
you have number of ways of collecting elements without style attribute:
using :css locator:
browser.trs(css: 'tr:not([style])') using :xpath locator:
browser.trs(xpath: '//tr[not(@style)]') you check attribute value:
browser.trs.select { |tr| tr.attribute_value('style').nil? } note should cautious using style attribute indicator of row being displayed. add other unrelated style property , of tests fail. instead, suggest rows present:
browser.trs.select(&:present?) i think makes purpose of code more obvious , readable.
Comments
Post a Comment