Automated Keyword Driven Framework using Selenesse  Ameya Naik Rasika Doshi
Contents <ul><li>Challenges in Test Automation </li></ul><ul><li>Automation Frameworks </li></ul><ul><li>The SeleNesse Fra...
Challenges in Test Automation <ul><li>Limited Skilled Resources </li></ul><ul><li>Tool support </li></ul><ul><li>Framework...
Automation Frameworks
<ul><li>Script actions as well as data are maintained outside of the automation script. </li></ul><ul><li>Enables document...
SeleNesse Architecture Front End Driver Tool Application
<ul><li>Open source tool for Functional testing of  </li></ul><ul><li>web applications.  </li></ul><ul><li>Supports multip...
<ul><li>Fitnesse is a lightweight, open-source  </li></ul><ul><li>framework for automated testing. </li></ul><ul><li>It he...
<ul><li>Fitnesse Fixtures are the bridges between the tables and the AUT. </li></ul><ul><li>Fixtures process the table com...
<ul><li>Developed by  Marisa Seal, Dawn Cannan and Chris McMahon. </li></ul><ul><li>It is a Fitnesse Fixture that connects...
<ul><li>Methods for Verification </li></ul>Special Commands <ul><ul><li>|check|getText|<locator>|<expected text>| </li></u...
Feature Summary
<ul><li>Pre-Requisites </li></ul><ul><li>Selenium RC –  </li></ul><ul><ul><li>http://seleniumhq.org/download </li></ul></u...
Pros & Cons Pros Cons Provides Test Management in a browser. Test assets can be shared on demand. Programming constructs l...
<ul><li>? </li></ul>Questions
<ul><li>Ameya Naik </li></ul><ul><li>[email_address] </li></ul><ul><li>Rasika Doshi </li></ul><ul><li>[email_address] </li...
 
<ul><li>We can create a custom method to the Selenesse JAR file. This method can then be called directly from Fitnesse tab...
 
Order of method execution The order of method execution is as follows: 1. Find method on fixture, if present execute 2. Fi...
Upcoming SlideShare
Loading in …5
×

Automated keyword driven framework using selenesse

2,863 views

Published on

Session Presented at 2nd IndicThreads.com Conference On Software Quality held on 25-26 March 2011 in Pune, India. WEB: http://Q11.IndicThreads.com

Published in: Technology
0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,863
On SlideShare
0
From Embeds
0
Number of Embeds
362
Actions
Shares
0
Downloads
65
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Automated keyword driven framework using selenesse

  1. 1. Automated Keyword Driven Framework using Selenesse Ameya Naik Rasika Doshi
  2. 2. Contents <ul><li>Challenges in Test Automation </li></ul><ul><li>Automation Frameworks </li></ul><ul><li>The SeleNesse Framework </li></ul><ul><ul><li>Selenium </li></ul></ul><ul><ul><li>FitNesse </li></ul></ul><ul><ul><li>Selenesse Library </li></ul></ul><ul><ul><li>Demo </li></ul></ul><ul><ul><li>Pros & Cons </li></ul></ul>
  3. 3. Challenges in Test Automation <ul><li>Limited Skilled Resources </li></ul><ul><li>Tool support </li></ul><ul><li>Framework Maintenance </li></ul><ul><li>Understanding the Automation Scripts </li></ul><ul><li>Sharing Results with Management/Client </li></ul>
  4. 4. Automation Frameworks
  5. 5. <ul><li>Script actions as well as data are maintained outside of the automation script. </li></ul><ul><li>Enables documentation of functionality in a tabular format. </li></ul><ul><li>Test Scripts are represented as step by step instructions (similar to Manual test cases). </li></ul>Keyword Driven Framework Window Control Action Arguments Window 1 Menu Click File, Open Window 2 Pushbutton Click Folder Name Window 3 Verify Results
  6. 6. SeleNesse Architecture Front End Driver Tool Application
  7. 7. <ul><li>Open source tool for Functional testing of </li></ul><ul><li>web applications. </li></ul><ul><li>Supports multiple scripting languages like Java, </li></ul><ul><li>C#, Ruby, Python, PHP, Perl, etc </li></ul><ul><li>Supports playback on multiple browsers - IE, FF, Chrome, Safari. </li></ul><ul><li>Supports multiple operating systems - Windows, Linux, Mac OS X, Solaris, Android*, iPhone* (* Selenium 2.0 and higher) </li></ul><ul><li>Fast growing user community. </li></ul>Selenium
  8. 8. <ul><li>Fitnesse is a lightweight, open-source </li></ul><ul><li>framework for automated testing. </li></ul><ul><li>It helps to collaboratively define and </li></ul><ul><li>organize acceptance / functional tests </li></ul><ul><li>It works as a Wiki to easily create and edit Scripts and documentation. </li></ul>FitNesse
  9. 9. <ul><li>Fitnesse Fixtures are the bridges between the tables and the AUT. </li></ul><ul><li>Fixtures process the table commands and drive the AUT. They capture the results and send them back to FitNesse. </li></ul><ul><li>FitNesse Table: </li></ul><ul><li>Fixture Code: </li></ul>FitNesse Fixtures public class Division { private double numerator, denominator; public void setNumerator(double numerator) {this.numerator = numerator;} public void setDenominator(double denominator} {this.denominator = denominator;} public double quotient() {return numerator/denominator;} } Eg. Division Numerator denominator quotient? 10 2 5.0 12.6 3 4.2 100 4 33
  10. 10. <ul><li>Developed by Marisa Seal, Dawn Cannan and Chris McMahon. </li></ul><ul><li>It is a Fitnesse Fixture that connects to Selenium which connects to the actual AUT (Web project). </li></ul><ul><li>FitNesse Table: </li></ul><ul><li>Fixture </li></ul>SeleNesse https://github.com/marisaseal/selenesse/blob/master/src/selenesse/SlimSeleniumDriver.java open www.google.co.in type; q Selenesse windowFocus windowMaximize click btnG ensure isTextPresent Selenese
  11. 11. <ul><li>Methods for Verification </li></ul>Special Commands <ul><ul><li>|check|getText|<locator>|<expected text>| </li></ul></ul><ul><ul><li>|ensure|isTextpresent|controlLocator| </li></ul></ul><ul><ul><li>|reject|isTextpresent|controlLocator|  </li></ul></ul><ul><ul><li>|$checkbox=|get attribute|//img[@id='enableRequest']/@src| </li></ul></ul>Methods for checkbox / Radio buttons <ul><ul><li>|makeChecked|<locator>| </li></ul></ul><ul><ul><li>|makeUnchecked|<locator>| </li></ul></ul>Note: All Verify methods in Selenium can be accessed as is* methods. e.g. ‘verifyTextPresent’ becomes ‘isTextPresent’, ‘verifyElementPresent’ becomes ‘isElementPresent’ java -jar fitnesse.jar -c &quot;MyTestPage?test&format=text&quot; Command Line Interface
  12. 12. Feature Summary
  13. 13. <ul><li>Pre-Requisites </li></ul><ul><li>Selenium RC – </li></ul><ul><ul><li>http://seleniumhq.org/download </li></ul></ul><ul><ul><li>http://saucelabs.com/downloads </li></ul></ul><ul><li>FitNesse Server – </li></ul><ul><ul><li>http://fitnesse.org/FrontPage.FitNesseDevelopment.DownLoad </li></ul></ul><ul><li>Selenesse Library – </li></ul><ul><ul><li>http://github.com/marisaseal/selenesse </li></ul></ul>Demo
  14. 14. Pros & Cons Pros Cons Provides Test Management in a browser. Test assets can be shared on demand. Programming constructs like loops cannot be used in FitNesse. (can write fixtures / methods in SeleNesse to achieve the same result) Inherent documentation in Wiki Pages. Not tested for Huge projects with tens of thousands of test cases. Scripts can be shared for Manual & Automation tests Requires 2 servers to be running for FitNesse and Selenium. Importing from spreadsheet is possible No commercial support. Have to depend on community for support. Customizable and Extensible FitNesse syntax / format needs to be learnt. Hides complexity of code from end users Quick and Easy Setup Good fit for Agile Teams.
  15. 15. <ul><li>? </li></ul>Questions
  16. 16. <ul><li>Ameya Naik </li></ul><ul><li>[email_address] </li></ul><ul><li>Rasika Doshi </li></ul><ul><li>[email_address] </li></ul>Thank You
  17. 18. <ul><li>We can create a custom method to the Selenesse JAR file. This method can then be called directly from Fitnesse tables. </li></ul><ul><li>public boolean verifyComboItemPresent (String selectLocator, String value) { </li></ul><ul><li>boolean elementFound = seleniumInstance.isElementPresent(selectLocator); </li></ul><ul><ul><li>if (elementFound) { </li></ul></ul><ul><ul><li>String[] retrievedOptions = seleniumInstance.getSelectOptions(selectLocator); </li></ul></ul><ul><ul><li>for (int i=0; i<retrievedOptions.length; i++) { </li></ul></ul><ul><ul><li>if (retrievedOptions[i].equals(value)) { </li></ul></ul><ul><ul><li>return true; </li></ul></ul><ul><ul><li>} </li></ul></ul><ul><ul><li>} </li></ul></ul><ul><ul><li>System. out.println(&quot;The requested item '&quot;+value+&quot;' was not found in the Combo box&quot;); </li></ul></ul><ul><ul><li>return false; </li></ul></ul><ul><ul><li>} </li></ul></ul><ul><ul><li>System. out.println(&quot;The Combo box was not found on the page&quot;); </li></ul></ul><ul><ul><li>return false; </li></ul></ul><ul><li>} </li></ul>open http://www.quikr.com/ ensure isTextPresent Welcome to Quikr verifyComboItemPresent categoryId Pune
  18. 20. Order of method execution The order of method execution is as follows: 1. Find method on fixture, if present execute 2. Find method on  SystemUnderTest , if present execute 3. Find method on installed Library in  reversed  order of creation. So last one created takes precedence over the ones created earlier. SYSTEM UNDER TEST Using SystemUnderTest allows you to let SliM directly invoke a method on your SystemUnderTest without having to create a method in a SliM fixture for it. Currently only available in Java. More on Fixtures…

×