webdriver
webdriver copied to clipboard
Consider introducing per-Element script execution.
13.2 Executing Script
It would be nice if we could have the identical document level script execution, per element, such that this would be set to the element in question.
I emulated this, but I think it's such a useful feature it should be a first class operation.
class Element
# ...
def execute(script, *arguments)
@session.execute("return (function(){#{script}}).call(...arguments)", self, *arguments)
end
def execute_async(script, *arguments)
@session.execute_async("return (function(){#{script}}).call(...arguments)", self, *arguments)
end
# ...