Skip to content

Instantly share code, notes, and snippets.

@hemanth
Last active December 11, 2015 20:09
Show Gist options
  • Save hemanth/4653747 to your computer and use it in GitHub Desktop.
Save hemanth/4653747 to your computer and use it in GitHub Desktop.
Better watir-webdriver?
require 'watir-webdriver'
module Browser
def get(obj,how,what,value=nil)
self.browser.send(obj,how,what)
end
def set(obj,how,what,value=nil)
if value
self.browser.send(obj,how,what).set(value)
else
self.browser.send(obj,how,what).set
end
end
def click(obj,how,what)
self.browser.send(obj,how,what).click
end
def clear(obj,how,what)
self.browser.send(obj,how,what).clear
end
def exists?(obj,how,what,msg=nil)
assert(self.browser.send(obj,how,what).exists?,msg)
end
def visible?(obj,how,what)
self.browser.send(obj,how,what).visible?
end
def enabled?(obj,how,what)
self.browser.send(obj,how,what).enabled?
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment