webdriver icon indicating copy to clipboard operation
webdriver copied to clipboard

Consider introducing per-Element script execution.

Open ioquatix opened this issue 2 years ago • 0 comments

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
  # ...

ioquatix avatar Dec 03 '23 20:12 ioquatix