Just wondering if anyone has used Selenium with interactive interpreter shells, via Python or Ruby. I believe those are the only such options aside from their Java/.NET equivalents of JRuby, Jython, IronPython, etc.
If so, how have you used it and why use it? Just wanted to get some ideas.
I’ve found it quite useful for debugging Selenium commands for a test and finding locators. Sure there’s Firebug, but you still have to test locator in action with Selenium via code, etc.
And for other languages but also including Python and Ruby, guess you can set breakpoints in code via IDE/debugger and do single stepping of test execution.
But using interpreter shell, I can bring up and teardown Selenium as I choose, w/o an IDE/debugger either. Quick way to test things out. Course for testing something that has dependency of being on certain state or page (logged in, etc.) requires additional work. Either type them all manually to interpreter shell or invoke a stub script from interpreter that executes all the commands up to the point you want to test/debug.
Another advantage of this shell approach is that Selenium will feel more like a stateless API or web service. Send a command and watch Selenium do something. You can also manually make changes in the Selenium browser (faster than coding) and then do some follow up Selenium command tests after the manual configuration. That kind of thing is harder to do when running a script (it has to have sleeps or is slow enough for manual config, while it is waiting for element, etc. or you’d have to set breakpoints in debugger).
But of course this works best if your test is written as Python or Ruby. Might be ok if it was in Java/.NET if you use Jython/JRuby or IronPython.
It can work if using other languages too. Just that you have to translate API calls back and forth and you can’t utilize any test framework/library classes you build in your language because you can’t call from Python/Ruby (unless is Java or .NET).
Update 1: you can use Java with interpreter shell for Selenium and WebDriver w/o Jython, JRuby, rather using Beanshell. See my related post on how to do so: Developing and debugging in Java via an interpreter