• Save
Fitnesse, Watir and Ruby Based Test Automation System
Upcoming SlideShare
Loading in...5
×
 

Fitnesse, Watir and Ruby Based Test Automation System

on

  • 518 views

Test Automation is a strategic necessity, as the delivery cycles are shrinking and becoming repetitive. Also coupled is the need for ensuring success within Limited Budget and Stringent Deadlines. ...

Test Automation is a strategic necessity, as the delivery cycles are shrinking and becoming repetitive. Also coupled is the need for ensuring success within Limited Budget and Stringent Deadlines.

We would like to hear your comments on our Open source based Fitnesse, Watir and Ruby Based Test Automation System.

sachink@harbingergroup.com

Statistics

Views

Total Views
518
Views on SlideShare
518
Embed Views
0

Actions

Likes
0
Downloads
0
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Fitnesse, Watir and Ruby Based Test Automation System Fitnesse, Watir and Ruby Based Test Automation System Document Transcript

  • HSTW-3a01A Harbinger Systems White PaperFitnesse, Watir and Ruby BasedTest Automation System
  • Copyright © Harbinger Systems. All Rights Reserved Page 2 of 8www.harbinger-systems.comContentsExecutive Summary.............................................................................. 3Current Test Automation Technologies................................................ 3Open Source Technologies..................................................................................................... 3Proposed Test Automation System ...................................................... 4System Architecture............................................................................................................... 5Test Execution........................................................................................................................ 6Compatibility.......................................................................................................................... 7Benefits ............................................................................................... 8Harbinger SystemsYour partner in technology innovationAbout Harbinger Systems: Harbinger Systems (www.harbinger-systems.com) is a leadingprovider of software engineering services to some of the worlds best product companies.This white paper is part of Harbinger’s Software Product Development practice. Harbingerprovides software product development and testing services to service the needs ofenterprise businesses as well as consumer products. Visit our Software ProductDevelopment Practice page to learn more.Visit our website to download or request our white papers on leading edge technologies andtrends.
  • Copyright © Harbinger Systems. All Rights Reserved Page 3 of 8www.harbinger-systems.comExecutive SummaryTest Automation is a strategic necessity, as the delivery cycles are shrinking and becoming repetitive. Inthis white paper, we propose and illustrate a complete test automation solution based on open sourcetechnologies, Fitnesse, Ruby and Watir. This system is web based, and enables a diverse set of projectstakeholders to carry out automated testing from anywhere.After a brief introduction to the available options in open source test automation technologies, we willlook at the building blocks of the solution, and finally the details of the proposed test automationsystem and its application to the testing of Web based applications.Current Test Automation TechnologiesThe current automation solutions are available as both proprietary and open source tools. While it isgenerally thought that an end-to-end test automation can be achieved using proprietary tools like QTP,Rational Robot etc. very easily, as the application undergoes revisions over time, many of these systemsbegin to fall short on their promise. For one thing, maintenance of the test scripts becomes expensive.Added to that, there are issues with them like licensing restrictions, support for scripting language,pricing and dependencies for add-ons. Sooner or later, due to these restrictions, the expensiveautomation ware rests on the shelf.Open Source TechnologiesTest Automation has been the buzzword in the open source forums. The Agile Developmentmethodologies insist on automated testing as a crucial component in the success of projects. This hasled to the development of several test frameworks for different stages of software development lifecycle. For the sake of this discussion, these frameworks can be broadly categorized into two categories:Unit Test Frameworks and Systems Testing Frameworks.Unit Test FrameworksThe most popular unit testing frameworks are JUnit or NUnit based on the application technology inquestion. These frameworks are robust and they provide an engineering view of software testing.The primary drawback with these frameworks is that these are too technical to be used by all projectstakeholders. Moreover, these frameworks perform white box testing over the classes in codebase, andhence, do not provide sufficient information for the system level tests and application behavior.
  • Copyright © Harbinger Systems. All Rights Reserved Page 4 of 8www.harbinger-systems.comSystem Testing FrameworksSelenium has traditionally been a well known open source framework for system testing. Seleniumexecutes tests within the browser. The selenium IDE also provides easy access to test cases.In Selenium, however, JavaScript’s same origin policy is seen as the show stopper. To deal with thisproblem, the framework was enhanced with a proxy server (Selenium RC) where the automation testsuite is to be deployed. The browser, where actual tests are being run, will then point to the proxyserver which will redirect the request to application server. While this configuration works, there aretwo main issues:The configuration is not exactly the same as the actual test environment in production.The overall installation and deployment of this configuration is very heavy and time consuming.Proposed Test Automation SystemHarbinger Systems’ proposed test automation system is built on the following building blocks.FitnesseAn open source framework called Fit is used for integration testing. Fitnesse is a Wiki wrapper over theFit server, and thus provides a web interface to the test suite. The front end of Fitnesse is intuitive andsimple, and it enables customers, testers and programmers to compare what their software actuallydoes against what it should do. Very importantly, Fitnesse is thus seen as a software developmentcollaboration tool since all the stakeholders can collaboratively define the acceptance tests, run thoseand see the results.Test cases in Fitnesse are written in Excel-like tables on wiki pages. Fitnesse provides different types offixture libraries to perform data-driven or action-driven testing. It must be noted, however, that Fitnessewas written to test the application code and not application UI. Hence, it requires interfacing code,which can call the functions of the application testing class.RubyRuby is an open source object oriented programming language with a focus on simplicity andproductivity. It doesn’t run very fast, but it saves a lot of programming time. Further, Ruby code is veryconcise and readable and is much simpler to maintain. These attributes make it a good programminglanguage to write the automation scripts in.
  • Copyright © Harbinger Systems. All Rights Reserved Page 5 of 8www.harbinger-systems.comWatirWatir, pronounced water, stands for Web Application Testing in Ruby, and is an open source library offunctions used to automate browser based tests. Watir provides programming API for Ruby to drivebrowser actions. While Watir traditionally supported Internet Explorer, it now also supports Firefox andSafari, and enjoys a strong community support.System ArchitectureFigure 1: Schematic diagram of Harbingers Proposed Test Automation SystemThe system is architected such that all tests pertaining to a module are packaged and saved in separatefolders. All testing related decisions are made by a class called Test Engine, which is the heart of the
  • Copyright © Harbinger Systems. All Rights Reserved Page 6 of 8www.harbinger-systems.comsystem, and is responsible for maintaining the context of testing. It is also a completely open sourcesolution, and hence, does not have licensing restrictions from its subcomponents.In the proposed system, all the common navigational functionalities are abstracted in a separate class.This is then sub-classed into module specific exploratory test functions. All the test wares are developedin Ruby. A schematic diagram of this system is shown in Figure 1.All artifacts of the automation system are deployed on the automation server machine. The system iscarefully architected after a long research on abstracting and organizing the test procedures into variouscomponents. These components and their responsibilities are as follows:Fixtures:o Parses test data from Test cases in Wiki pages and to fetch them into test engineo Compares the outcome of test execution with the expected behavior and to mark the test caseas pass or failTest Engine: Test Engine is the intelligent class of the system, which makes decisions during testing,and keeps the test context of the system persistent over the next test case / scenarioHelper classes: Helper classes help the Test Engine in exploring the application in conformance tothe test execution steps described in the test caseTest ExecutionThe test automation server can be accessed from a browser, and the user can initiate testing just byclicking the test button in the test scenario page of the wiki. Fitnesse would start executing tests as perthe procedure described in test cases and will report the outcome in the same test tables as shown inFigure 2.
  • Copyright © Harbinger Systems. All Rights Reserved Page 7 of 8www.harbinger-systems.comFigure 2: Outcome of test executionTable cells filled with green indicate success. When the test fails, the fixture class finds thatthe actual state of the application is not the same as expected. The corresponding cell in thetest case is then marked in Red. The actual state of application is also shown in the same cell.CompatibilityThe testing system has been successfully tested on Web 2.0 applications with the following advancedattributes:Web elements in nested framesetsAjax controlsElement identifiers created at runtime by Ext-JS
  • Copyright © Harbinger Systems. All Rights Reserved Page 8 of 8www.harbinger-systems.comBenefitsThe proposed Test Automation System yields the following advantages:Project stakeholders can access the test automation server via webTest outcome clearly shows what the application is expected to do and what it actually does. Thus,the system is an ideal collaboration tool for teams located geographically apartAs testing becomes very simple and can be executed by any team member, this system createsground for agile development cyclesOpen source based automation solution keeps the system free from licensing restrictionsModular design of test wares that is in conformance with modules of system testing designed bymanual test teamsDecision making business function classes have been isolated from the navigational details inseparate classesThe Test Engine component keeps context of test execution, and hence, can take appropriatedecisions in the next test scenario execution cycleLearn More: Visit our website, http://www.harbinger-systems.com to download more white papers onleading edge technologies and trends.Sources1 The Fitnesse Acceptance Testing Framework: http://fitnesse.org/2 Using Fitnesse pages effectively: http://gojko.net/2008/10/21/using-fitnesse-pages-as-templates/3 Architectures of Test Automation Systems - Cem Kaner: http://www.kaner.com/testarch.html4 Getting Automated Testing Under Control – Hans Buwalda:http://www.logigear.com/logi_media_dir/Documents/whitepapers/Getting_Automated_Testing_Under_Control.pdf5 Watir: http://watir.com/6 Using Watir for Test Automation: http://svn.openqa.org/fisheye/browse/~raw,r=267/watir/trunk/watir/doc/watir_user_guide.html7 Firewatir – The Support of Watir for Firefox: http://angrez.blogspot.com/search/label/Firewatir8 On Ruby Programming Language: http://www.ruby-lang.org/en/