Eddy Jones : January 2010 Archives

There are many easy to use testing automation tools on the market.  There are many powerful testing automation tools on the market.  There are, however, rather few that are both.  Selenium is one that stands out, though and it is the tool that I most often use.  In this tutorial, I'll demonstrate a quick way to create simple tests using the tool.

 

In order to play back your tests, simply press the green arrow "play buttons" on the toolbar.

WHAT???  Why did my tests fail??

Well, your tests probably failed here, but that's ok.  This really demonstrates the speed of Selenium.  Your test most likely failed because Selenium tried to move on to the next step before the web page finished rendering.  So it tried to click on your next link before the link was actually on the page.  There are two ways to handle this.  The quick but bad way would be to adjust the speed of your test by adjusting the slider on the toolbar.  This would allow the web pages a chance to render prior to Selenium trying to act on it.  The better way to handle this would be to change the "click" commands to "ClickAndWait" commands, though.  This way, Selenium will wait for the page to completely render before moving on to the next command.  One thing to note about this method, however, if you are testing a page that has frames, you might run into problems with FireFox.  FireFox says the page is completed once the Frameset is complete rather than waiting for the contents of the frame have completely rendered.

Also before I sign off for this first tutorial, I'll mention the difference between Assert and Verify

When you ASSERT that an element is present, you are telling Selenium to stop the test and proceed no further if the assertion is not valid.  So, if I assert that an image is present and that image is NOT present, Selenium will not move on and all testing will stop.  The test will be marked a failure.

When you verify something is present, you are looking for something that is not terribly important enough to stop the entire test if it's not.

An example of when I might use assert versus using a verify:

If I loaded a web page displayed a render time, I might want to verify that the render time was under 5 seconds, but I wouldn't necessarily think that it's a total failure if it took 6 seconds to render.  I would want to use an assert to verify that it didn't take longer than 10 seconds because 10 seconds is way past my threshold for acceptable render times and there is no point in continuing my tests if it takes longer than that.

 

Stay tuned for the next session: "Creating Tests Suites"

We all hear about the Hubble Telescope.  Many of us will remember the snafu upon its launch.  The main mirror had been ground incorrectly and we weren't FileHST-SM4 able to fully utilize it until the first service mission in 1993.  But ever since then, the Hubble Space Telescope has been raining down data like digital manna from heaven.  I think we've become jaded to the wonder of it.  We've grown complacent with its abilities. 

Well, I'm here to bring your attention to this wonderful piece of technology.  Go take a look at some of its beautiful photos in the gallery.  I promise you, you'll be amazed at the stunning beauty that makes up our night time sky.

One mind blowing thing about this:  We are actually looking back in time whenever we look at stars and galaxies.  The closest star to us is 4.37 light years away from us.  That means, when we look at see that star system through a telescope, we are seeing the light that left the binary star system 4.37 years ago.  We are, in effect, looking 4.37 years into the past.  Now take that thought and apply it some of the most distant galaxies that the Hubble is able to peer at.  Billions of light years away...  We are literally looking at images of the universe from billions of years ago.  Creeping our perception ever closer to the beginning of it all.  That's about 700 million years since the Big Bang, or almost 95% of the way back to the beginning. Staggering to think about.  Read from the related articles below to learn more about this.

 

 

 

FireFactor

Google Ads

 

The Tao of Calvin