Method: Selenium::WebDriver::Driver#get_table

Defined in:
lib/oats/oats_selenium_api.rb

#get_table(locator) ⇒ Object



243
244
245
246
247
248
249
250
251
252
253
254
# File 'lib/oats/oats_selenium_api.rb', line 243

def get_table(locator)
  arr = []
  selenium.wait_for_element("//div[@id='#{locator}']")
  arr[0] = get_row("//div[@id='#{locator}']//thead/tr",'th[not(contains(@style,"display: none;"))]')
  for row in 1..100
    #        loc = "//div[@id='#{locator}']//tbody/tr[#{row}]"
    row_array = get_row("//div[@id='#{locator}']//tbody/tr[#{row}]",'td[not(contains(@style,"display: none;"))]')
    break if row_array.empty?
    arr[row] = row_array
  end
  return arr
end