Friends, the solution below solves my problem when there is a vertical column that validates the record in the cell with the field on the application screen. But if the spreadsheet is horizontally, I am not able to read the records and validate on the application screen.
here OK I get the values from the status column [invisible....etc]
| fields | status |
|---|---|
| Leitura | Invisível |
| Hidrometro | Invisíve |
| Diametro | Invisível |
| Lacre | Obrigatório |
Spreadsheet.client_encoding = 'UTF-8'
book = Spreadsheet.open('c:/temp/gab.xls', "r")
sheet = book.worksheet 4
xls_offset = 1
row_offset = 2
sheet.each_with_index(xls_offset) do |row, idx|
expected_tooltip = row[1]
break if row[1].nil?
expect(page).to have_css("tr.tvRow:nth-child(#{row_offset+idx}) .tvCell:nth-child(6) img[tooltip='#{expected_tooltip}']")
end
end
How to adjust the code above to do this reading horizontally to read the records [Invisivel, Invisivel,Habilitado,Invisivel] in line 3 from the Leitura column?
Here NOK
| code | situation | tab | leitura | hidrometro | diametro | lacre |
|---|---|---|---|---|---|---|
| 8 | ok | B | Invisivel | Invisivel | Habilitado | Invisivel |
| 9 | ok | C | Invisivel | Invisivel | Habilitado | Invisivel |
| 10 | ok | C | Invisivel | Invisivel | Habilitado | Invisivel |