lib/gogo_driver.rb in gogo_driver-0.1.2 vs lib/gogo_driver.rb in gogo_driver-0.1.3
- old
+ new
@@ -19,10 +19,18 @@
def find(selector)
logging "[FIND] #{selector}..."
@driver.find_element(css: selector)
end
+ # http://stackoverflow.com/questions/11908249/debugging-element-is-not-clickable-at-point-error
+ def scroll(selector)
+ logging "[SCROLL] #{selector}..."
+ element = find(selector)
+ @driver.driver.execute_script "window.scrollTo(#{element.location.x},#{element.location.y})"
+ element
+ end
+
def finds(selector)
@driver.find_elements(css: selector)
end
def has?(selector)
@@ -58,10 +66,10 @@
end
class Selenium::WebDriver::Element
def fill(text)
$focus = self
- "[FILL] #{selector}..."
+ "[FILL] #{text}..."
send_key(text)
end
def find(selector)
find_element(css: selector)