Using Selenium with interactive interpreter shells?

6 Nov

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

Advertisements

3 Responses to “Using Selenium with interactive interpreter shells?”

  1. David February 7, 2012 at 2:17 am #

    It would also be interesting to see how this might be adapted for SauceLabs. Connect to SauceLabs and run test via shell rather than code/script and see it in action live and on demand on SauceLabs job video page.

    You can test and debug from SauceLabs live this way. The only drawback is that automation run this way tends to be slower than fully automated code/scripts and hence you would be burning up precious minutes in your account.

Trackbacks/Pingbacks

  1. A Selenium IDE alternative for other browsers and another record & playback method « autumnator - May 3, 2012

    […] Using Selenium with interactive interpreter shells? […]

  2. Thoughts on a Selenium interactive exploratory test and debug tool | autumnator - January 24, 2014

    […] Using selenium with interactive interpreter shells […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Seek Nuance

Python, technology, Seattle, careers, life, et cetera...

TELLURIUM

New Era of Test Automation

Der Flounder

Seldom updated, occasionally insightful.

The 4T - Trail, Tram, Trolley, Train

Exploring Portland with the 4T

Midnight Musings

Thoughts on making art

Automation Guide

The More You Learn The More You Play...!

The Performance Engineer

Code.Test.Tune.Optimize.

humblesoftwaredev

Thoughts related to software development

Yi Wang's Tech Notes

A blog ported from http://cxwangyi.blogspot.com

Appium Tutorial

Technical…..Practical…..Theoretically Interesting

LinuxMeerkat

I swear! Meerkats can do Linux

PacketsDropped

Requeuing the packets dropped in my memory.

Two cents of software value

Writing. Training. Consulting.

@akumar overflow

wisdom exceeding 140 chars.

Lazy Programmer's Shortcut

Java, J2EE, Spring, OOAD, DDD & LIFE! .......all in one :)

Testing Mobile Apps

www.SoftwareTestingStudio.com

Photofocus

education and inspiration for visual storytellers

%d bloggers like this: