Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
Jon Warbrick, July 2014, V3.2 (for Ansible 1.7)
First one found from of
def highlight(element): | |
"""Highlights (blinks) a Webdriver element. | |
In pure javascript, as suggested by https://github.com/alp82. | |
""" | |
driver = element._parent | |
driver.execute_script(""" | |
element = arguments[0]; | |
original_style = element.getAttribute('style'); | |
element.setAttribute('style', original_style + "; background: yellow; border: 2px solid red;"); | |
setTimeout(function(){ |
# spec_helper.rb | |
require 'rspec' | |
require 'watir-webdriver' | |
require 'page-object' | |
require 'page-object/page_factory' | |
require 'require_all' | |
require_all 'lib/pages' | |
RSpec.configure do |config| |
require 'rubygems' | |
require 'selenium-webdriver' | |
path = File.expand_path("test.html") | |
File.open(path, "w") { |io| io << DATA.read } | |
browser = Selenium::WebDriver.for :firefox # replace :firefox with the browser you're having trouble with | |
begin | |
browser.get "file://#{path}" |