Home > Web Application Development > Selenium Test Scripts – To record or write?

Selenium Test Scripts – To record or write?

So I’ve gotten the Selenium Core installed on a staging web server where we run development code.  Additionally, I have installed the Selenium IDE Firefox extension to record test scripts.  I have been recording a few test scripts on some very basic functionality of an application I have been working on, then uploaded the test suite to a testing directory within my application directory structure.  Then it’s time to run the Selenium TestRunner and access my test suite.  For some reason, I get small failures that while not indicative of a problem with my code, but rather idiosyncracies with Selenium or my JavaScript deficiencies.  I’m getting very minor errors about elements not being found which I’m fairly sure is due to me not being in the habit of assigning an id attribute to everything especially form elements, so that Selenium can find them.  I’m also wondering if it is better to manually write test scripts for Selenium, which sounds too time consuming, or is it OK to just use the Firefox extension to record them.  I’ll do a bit more digging to see what I can find.  Selenium is available at http://openqa.org.

  1. June 23, 2008 at 4:27 pm

    Hi, Kenneth.
    Glad you’re finding Selenium useful (despite its idiosyncrasies). Unfortunately, there is no free lunch in software testing. Putting in a little bit more work to make your app more testable (like inserting those id tags that you mentioned), and not always relying on what Selenium IDE produces in its recorded script will make your tests less brittle.

    Jason “Mr. Selenium” Huggins

  1. January 2, 2011 at 2:43 am

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 )

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: