Method: Sapphire::WebAbstractions::RubySeleniumWebDriver#FindItemWithWait

Defined in:
lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb

#FindItemWithWait(array, comparator = nil) ⇒ Object



217
218
219
220
221
222
223
224
225
226
227
228
229
230
# File 'lib/sapphire/Adapters/Selenium/RubySeleniumWebDriver.rb', line 217

def FindItemWithWait(array, comparator=nil)
  masterWait = Selenium::WebDriver::Wait.new(:timeout => 5)

  element, by, value = masterWait.until {
    x, by, value = FindItem(array, comparator)
    return x, by, value if x != nil
    return x, by, value if comparator.Compare(x != nil, true) if comparator != nil
  }

  return element, by, value if element != nil
  return element, by, value if comparator.Compare(element != nil, true) if comparator != nil
  raise "Could not find control for array: " + array.to_s

end