Unit Testing Revisited

A Member? Please Login  
type your username and password to login
Date: December 03, 2008, 01:44 AM
267517 members and 164438 Topics
Latest Member: RobbyKein
Nairaland [Nigerian Forum] Home Help Search Who is currently online? Login Register
Nairaland Forum  |  Technology  |  Webmasters (Moderator: OmniPotens)  |  Unit Testing Revisited
Pages: (1) Go Down Send this topic Notify of replies
Author Topic: Unit Testing Revisited  (Read 133 views)
my2cents (m)
Unit Testing Revisited
« on: August 22, 2007, 04:58 PM »

So, in an effort to impart my knowledge to posterity  Tongue, I have decided to practice what I preach, so to speak, by sharing with you all what I use for unit testing at work.  Basically, you develop the tests as you write your code and once you are done writing your code, you run the test(s) again.  If anything changed, links aren't going to where they are supposed to go, etc, the test fails.

Say hello to Selenium.  The site: http://www.openqa.org/ , the IDE: http://openqa.org/selenium-ide/

Note:
  • This is an FF plugin.  It doesn't work in IE although what you are testing, since it is front-end, will be verified for all browsers.
  • This is for front-end testing (where elements are on a page, link verification, etc). It doesn't verify business logic.  For that, you would need (if you code in java) JUnit

You basically run the test the first time by starting from, say, your home page, and clicking to the end page.  You then modify the test case file (which you have a choice of saving as java, html, perl, php, ruby, python or c#) to, say, verify or assert links, images, text, etc.  Note that when you run your tests, the "verify" function will verify your test and continue on testing where the "assert" function will stop the test if a condition isn't meant.  Right-clicking from within your FF browser will pull up a list of functions you can use (of course for this to show, you should have installed the Selenium IDE).

If you have any questions, let me know.  It has definitely made my life a lot easier.  Happy coding and testing!
 Email System  Professional Web Site Design - Request For Bids  100% Free Traffic For All!  Page 2
Pages: (1) Go Up Send Topic to Friend by E-mail Reply 
Google
 
Web www.nairaland.com
Sections: TV/Movies (2) Music/Radio (2) Celebrities Job Talk Jobs/Vacancies (2) Career Talk Romance Books Politics Sports Fashion Travel
Health Schooling Religion General(2) Business Webmaster Programming Computers Phones Cars & Trucks

Links: Page1 Page2 Page3 Page4 Page5 Page6 Page7 Page8 Page9 Page10

Nairaland is owned by Oluwaseun Osewa
Nairaland Forum | Powered by SMF 1.0.12.
© 2001-2005, Lewis Media. All Rights Reserved.