Warren Pollans wrote on 09/28/2005 03:25:36 PM:
> I converted the the TestRunner tests that were included in the
> yesterday's svn version of selenium to run as ruby-driven tests. Too
> much free time, I guess :-) They all worked OK after I added about a
> dozen or so commands to Interpreter.py and RPC2.rpy.
...
> At any rate, here's what I had to add:
>
> >>> RPC2.rpy
(snip, snip)
Thank you, thank you!! :-)
Ideally... we'd use Python's __getattr__ method to catch any Selenium command without having to explicitly define an "xmlrpc_*" method and just simply forwarding the command it to Selenium.... Kind of like Ruby's method_missing command. If you notice, this is how the Ruby driver for Selenium works.
However, the Selenium standalone server is written using Twisted Python's XML-RPC driver library. And as far as I can tell with Twisted, you *have* to name explicit methods and prepend them with "xmlprc_". So, the solution is to either hack Twisted to support my "method missing" idea. Or use xmlrpclib directly to serialize/unserialize the request (skipping the Twisted way of doing it.). Or time to find a different framework... In the meantime... I'll check in your changes to RPC2 and Interpreter.py... For awhile now, the 0.3 of the standalone server was out of date with the "core" Selenium _javascript_ code. Your work makes bringing it officially up-to-date tons easier. Yeah, open source! :-)
> If this is of any
> interest, I'd be happy to try to provide a script that will generate
> these tests from TestRunner html test files - I did it the hard way by
> parsing the log.
Like I said above, ideally if we use the "method_missing" way of calling Selenium commands, we won't need to tweak the API in the Python code every time the JavScript API changes.
Cheers,
- Jason
_______________________________________________ Selenium-devel mailing list Selenium-devel@lists.public.thoughtworks.org http://lists.public.thoughtworks.org/mailman/listinfo/selenium-devel