Method: PageObject::Platforms::SeleniumWebDriver::Element#flash

Defined in:
lib/page-object/platforms/selenium_webdriver/element.rb

#flashObject

flash the element by temporarily changing the background color



29
30
31
32
33
34
35
36
# File 'lib/page-object/platforms/selenium_webdriver/element.rb', line 29

def flash
  original_color = attribute('backgroundColor')
  the_bridge = bridge
  10.times do |n|
    color = (n % 2 == 0) ? 'red' : original_color
    the_bridge.executeScript("arguments[0].style.backgroundColor = '#{color}'", element)
  end
end