aivaturi/Selenium-Remote-Driver — pull request #30 by Swandog (2012-03-06 21:48:07+00:00)
Title: Support for returning data structures containing WebElements from execute_script

I was using the Selenium::Remote::Driver modules recently, and I came into an annoyance. I was using JavaScript to return an element from a page, but it was not being converted into a Selenium::Remote::WebElement object. It turned out that the problem was that I was returning an array of 1 web element, and the execute_script code that turned things into WebElement objects only handled a web element being returned directly.

It was a simple matter to get the Selenium::Remote::WebElement object with a call to new(), but it was a pain to do that for everything that execute_script might return. So instead, I thought I would make the change in the module and offer it to you.

I hope you find it useful; this is my first time contributing code on github, so I apologize for any faux pas I might make.