Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- browser.td(:text => "Equipment").parent.td(:index => "2").flash
- browser.tr(:text => "Equipment").flash
- browser.table[row_index][column_index]
- browser.table.tr(:index, 1).flash
- browser.table.row(:index, 2).flash
- #Get the 3rd row down from the row containing the text 'Equipment'
- starting_row_index = browser.table.rows.to_a.index{ |row| row.text =~ /Equipment/ }
- offset = 3
- row = browser.table.row(:index, starting_row_index + offset)
- puts row.text
- # => CAT03 ...
- #Get the 3rd row down from the row containing a cell with yellow background colour
- starting_row_index = browser.table.rows.to_a.index{ |row| row.td(:css => "td[bgcolor=yellow]").present? }
- offset = 3
- row = browser.table.row(:index, starting_row_index + offset)
- puts row.text
- # => ETS36401 ...
- #Output the first column text of each row after the row containing a cell with yellow background colour
- starting_row_index = browser.table.rows.to_a.index{ |row| row.td(:css => "td[bgcolor=yellow]").present? }
- (starting_row_index + 1).upto(browser.table.rows.length - 1){ |x| puts browser.table[x][0].text }
- # => CAT03, CAT08, ..., INTEGRA10, INTEGRA11
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement