SlideShare a Scribd company logo
FireWatir - Web Application Testing Using Ruby & Firefox Angrez Singh Proteans Software Solutions Pvt. Ltd.
Motivation Web Applications are increasingly ubiquitous as a functionality delivery paradigm. Testing  Web Applications is important Web-Application specific test functionality in commercial test tools leaves much to be desired. …and they cost a bomb.
Problems with existing Tools Most provide record-and-replay style test automation functionality. Semantic Gap Little or no support for web application specific test functionality Vendor specific scripting languages (“Vendorscript”)
What is Ruby? Purely Object Oriented scripting language Everything is an Object as in Java Scripting language features Full Regular expression support Tight integration with OS Dynamic evaluation References http://www.rubycentral.com http://www.ruby-lang.org http://www.rubygarden.org/ruby http:// tryruby.hobix.com /
What is FireWatir? Testing Web Application using Ruby and Firefox browser Framework / Library for scripting Web application testing cases Functional testing tool for automated browser-based tests
Example Yahoo Mail
Conceptual Framework Class for Firefox Classes for each element (e.g. image, link, checkbox etc) Selection mechanism for elements (e.g. index, id, name, value etc)
Firefox Class Active methods goto() back() refresh() etc. Methods that provide current state url() title() contains_text() etc
Element Class Base class  for all Elements Provides  common methods click() enabled? exists? Selection Mechanism index, id, name, value etc
Checkbox & Radiobutton Class Summary Used to access checkbox & radiobutton Methods set, clear For e.g.: <input type=“checkbox” name=“checkbox1”> ff.checkbox(:name, “checkbox1”).clear <input type=“checkbox” name=“order” value=“order1”> <input type=“checkbox” name=“order” value=“order2”> ff.checkbox(:name, “order”, “order1”).set
SelectList Class Summary Used to select value from listbox, dropdownlist Methods option, select, select_item_in_select_list For e.g.: <select name=“selectBox”> <option value=“1”>1</option> </select> ff.select_list(:name, “selectBox”).select(“1”)
Text Field Class Summary Used for accessing text box Methods append, maxLength, set, size etc. For e.g.: <input type=“text” name=“UserName” id=“txtUserName”> ff.text_field(:name,”UserName”).set(“set value”)
Image Class Summary Use to access image Methods height, width etc. Selection   mechanism index, name, id, alt, src For e.g.: <img name=“myimage” alt=“A picture” src=“/images/mypic.jpg“> ff.image(:alt, “A picture”).height()
Example Airdeccan
Button class Summary Used to access button on page Selection mechanism caption For e.g.: <input type=“button” id=“btnSearch” name=“search” value=“Search”> ff.button(:name,”search”).click ff.button(:id,”btnSearch”).exists?
Link Class Summary Used to access link Methods innerText, src etc Properties href Selection mechanism url, text, title For e.g.: <a href=“ http:// www.google.com ” title=“Go to Google”> ff.link(:title, “Go to Google”).src ff.link(:title, “Go to Google”).link_has_image
XPath Selection Mechanism Language for addressing parts of XML document Used to navigate through elements DOM model is represented using Tree like structure XPath is used to select element in DOM Tree References http://www.w3schools.com/xpath/default.asp
Selection Mechanism Exact string match ff.text_field(:name, ”txtUserName”) Regular Expression ff.text_field(:name, /txtUserName/) XPath expression ff.text_field(:xpath, “//input[@name=‘txtUserName’]/”) ff.element_by_xpath(“//area[id=‘area1’]/”)
Example Indigo
How FireWatir interacts? Uses JSSh extension Runs at port 9997 and listens for commands Firewatir sends JavaScript commands via socket Read back the results
Advanced Concepts Handling Windows pop up Use attach method of Firefox using title Get a new Firefox instance Use this Firefox instance for accessing elements in pop up window For e.g.: newFF = ff.attach(:title, “Google”) newFF.button(:name, “Search”)
Handling Javascript Pop ups Redefines the function alert and confirm in JavaScript JSSh doesn’t get blocked For e.g.: ff.button(:name, /Sign In/).click_no_wait ff.click_jspopup_button(button)
Advanced Concepts - Example
Advantages In built XML and XPath support More compliant to standards Can support Linux, Mac platform Made to run on any client machine
References FireWatir home page http://code.google.com/p/firewatir/ JSSh home page http://croczilla.com/jssh/ Element References http://www.xulplanet.com/references/elemref/ Download XPI’s http://people.mozilla.com/~davel/jssh/
Q & A

More Related Content

What's hot

Java I/O
Java I/OJava I/O
Dom parser
Dom parserDom parser
Dom parser
sana mateen
 
Chapter 08 data file handling
Chapter 08 data file handlingChapter 08 data file handling
Chapter 08 data file handling
Praveen M Jigajinni
 
Understanding java streams
Understanding java streamsUnderstanding java streams
Understanding java streams
Shahjahan Samoon
 
ASP.NET Session 7
ASP.NET Session 7ASP.NET Session 7
ASP.NET Session 7
Sisir Ghosh
 
File Handling in Java Oop presentation
File Handling in Java Oop presentationFile Handling in Java Oop presentation
File Handling in Java Oop presentation
Azeemaj101
 
java.io - streams and files
java.io - streams and filesjava.io - streams and files
java.io - streams and files
Marcello Thiry
 
Data Persistence in Android with Room Library
Data Persistence in Android with Room LibraryData Persistence in Android with Room Library
Data Persistence in Android with Room Library
Reinvently
 
Java Streams
Java StreamsJava Streams
Java Streams
M Vishnuvardhan Reddy
 
Input output streams
Input output streamsInput output streams
Input output streams
Parthipan Parthi
 
File handling
File handlingFile handling
File handling
prateekgemini
 
Python 45 minutes hangout #3
Python 45 minutes hangout #3Python 45 minutes hangout #3
Python 45 minutes hangout #3
Al Sayed Gamal
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
babak danyal
 
Java I/o streams
Java I/o streamsJava I/o streams
Java I/o streams
Hamid Ghorbani
 
C# File IO Operations
C# File IO OperationsC# File IO Operations
C# File IO Operations
Prem Kumar Badri
 
14 file handling
14 file handling14 file handling
14 file handling
APU
 
File handling in c++
File handling in c++File handling in c++
Reading and Writing Files
Reading and Writing FilesReading and Writing Files
Reading and Writing Files
primeteacher32
 
Byte stream classes.49
Byte stream classes.49Byte stream classes.49
Byte stream classes.49
myrajendra
 
Io streams
Io streamsIo streams

What's hot (20)

Java I/O
Java I/OJava I/O
Java I/O
 
Dom parser
Dom parserDom parser
Dom parser
 
Chapter 08 data file handling
Chapter 08 data file handlingChapter 08 data file handling
Chapter 08 data file handling
 
Understanding java streams
Understanding java streamsUnderstanding java streams
Understanding java streams
 
ASP.NET Session 7
ASP.NET Session 7ASP.NET Session 7
ASP.NET Session 7
 
File Handling in Java Oop presentation
File Handling in Java Oop presentationFile Handling in Java Oop presentation
File Handling in Java Oop presentation
 
java.io - streams and files
java.io - streams and filesjava.io - streams and files
java.io - streams and files
 
Data Persistence in Android with Room Library
Data Persistence in Android with Room LibraryData Persistence in Android with Room Library
Data Persistence in Android with Room Library
 
Java Streams
Java StreamsJava Streams
Java Streams
 
Input output streams
Input output streamsInput output streams
Input output streams
 
File handling
File handlingFile handling
File handling
 
Python 45 minutes hangout #3
Python 45 minutes hangout #3Python 45 minutes hangout #3
Python 45 minutes hangout #3
 
Java IO Package and Streams
Java IO Package and StreamsJava IO Package and Streams
Java IO Package and Streams
 
Java I/o streams
Java I/o streamsJava I/o streams
Java I/o streams
 
C# File IO Operations
C# File IO OperationsC# File IO Operations
C# File IO Operations
 
14 file handling
14 file handling14 file handling
14 file handling
 
File handling in c++
File handling in c++File handling in c++
File handling in c++
 
Reading and Writing Files
Reading and Writing FilesReading and Writing Files
Reading and Writing Files
 
Byte stream classes.49
Byte stream classes.49Byte stream classes.49
Byte stream classes.49
 
Io streams
Io streamsIo streams
Io streams
 

Similar to FireWatir - Web Application Testing Using Ruby and Firefox

Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
wiradikusuma
 
Java Script Patterns
Java Script PatternsJava Script Patterns
Java Script Patterns
Allan Huang
 
Developing web apps using Erlang-Web
Developing web apps using Erlang-WebDeveloping web apps using Erlang-Web
Developing web apps using Erlang-Web
fanqstefan
 
FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09
Pyxis Technologies
 
Laurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus PresentationLaurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus Presentation
Ajax Experience 2009
 
Using SPMetal for faster SharePoint development
Using SPMetal for faster SharePoint developmentUsing SPMetal for faster SharePoint development
Using SPMetal for faster SharePoint development
Pranav Sharma
 
INTRODUCTION TO CLIENT SIDE PROGRAMMING
INTRODUCTION TO CLIENT SIDE PROGRAMMINGINTRODUCTION TO CLIENT SIDE PROGRAMMING
INTRODUCTION TO CLIENT SIDE PROGRAMMING
Prof Ansari
 
Microsoft Silverlight
Microsoft SilverlightMicrosoft Silverlight
Microsoft Silverlight
guest3a8196
 
Using SP Metal for faster share point development
Using SP Metal for faster share point developmentUsing SP Metal for faster share point development
Using SP Metal for faster share point development
Pranav Sharma
 
Functional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with FrankensteinFunctional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with Frankenstein
vivek_prahlad
 
Struts 2
Struts 2Struts 2
Struts 2
Lalit Garg
 
Struts2
Struts2Struts2
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
Visual Engineering
 
Advanced full text searching techniques using Lucene
Advanced full text searching techniques using LuceneAdvanced full text searching techniques using Lucene
Advanced full text searching techniques using Lucene
Asad Abbas
 
Java Basics
Java BasicsJava Basics
Java Basics
shivamgarg_nitj
 
Sencha / ExtJS : Object Oriented JavaScript
Sencha / ExtJS : Object Oriented JavaScriptSencha / ExtJS : Object Oriented JavaScript
Sencha / ExtJS : Object Oriented JavaScript
Rohan Chandane
 
Java Script
Java ScriptJava Script
Java Script
husbancom
 
JavaScript Basics
JavaScript BasicsJavaScript Basics
JavaScript Basics
Mats Bryntse
 
Java XML Parsing
Java XML ParsingJava XML Parsing
Java XML Parsing
srinivasanjayakumar
 
Declarative Development Using Annotations In PHP
Declarative Development Using Annotations In PHPDeclarative Development Using Annotations In PHP
Declarative Development Using Annotations In PHP
Stephan Schmidt
 

Similar to FireWatir - Web Application Testing Using Ruby and Firefox (20)

Introducing Struts 2
Introducing Struts 2Introducing Struts 2
Introducing Struts 2
 
Java Script Patterns
Java Script PatternsJava Script Patterns
Java Script Patterns
 
Developing web apps using Erlang-Web
Developing web apps using Erlang-WebDeveloping web apps using Erlang-Web
Developing web apps using Erlang-Web
 
FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09FluentSelenium Presentation Code Camp09
FluentSelenium Presentation Code Camp09
 
Laurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus PresentationLaurens Van Den Oever Xopus Presentation
Laurens Van Den Oever Xopus Presentation
 
Using SPMetal for faster SharePoint development
Using SPMetal for faster SharePoint developmentUsing SPMetal for faster SharePoint development
Using SPMetal for faster SharePoint development
 
INTRODUCTION TO CLIENT SIDE PROGRAMMING
INTRODUCTION TO CLIENT SIDE PROGRAMMINGINTRODUCTION TO CLIENT SIDE PROGRAMMING
INTRODUCTION TO CLIENT SIDE PROGRAMMING
 
Microsoft Silverlight
Microsoft SilverlightMicrosoft Silverlight
Microsoft Silverlight
 
Using SP Metal for faster share point development
Using SP Metal for faster share point developmentUsing SP Metal for faster share point development
Using SP Metal for faster share point development
 
Functional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with FrankensteinFunctional Testing Swing Applications with Frankenstein
Functional Testing Swing Applications with Frankenstein
 
Struts 2
Struts 2Struts 2
Struts 2
 
Struts2
Struts2Struts2
Struts2
 
Workshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testingWorkshop 23: ReactJS, React & Redux testing
Workshop 23: ReactJS, React & Redux testing
 
Advanced full text searching techniques using Lucene
Advanced full text searching techniques using LuceneAdvanced full text searching techniques using Lucene
Advanced full text searching techniques using Lucene
 
Java Basics
Java BasicsJava Basics
Java Basics
 
Sencha / ExtJS : Object Oriented JavaScript
Sencha / ExtJS : Object Oriented JavaScriptSencha / ExtJS : Object Oriented JavaScript
Sencha / ExtJS : Object Oriented JavaScript
 
Java Script
Java ScriptJava Script
Java Script
 
JavaScript Basics
JavaScript BasicsJavaScript Basics
JavaScript Basics
 
Java XML Parsing
Java XML ParsingJava XML Parsing
Java XML Parsing
 
Declarative Development Using Annotations In PHP
Declarative Development Using Annotations In PHPDeclarative Development Using Annotations In PHP
Declarative Development Using Annotations In PHP
 

Recently uploaded

how to successfully withdraw hamster tokens to TON - WALLET
how to successfully withdraw hamster tokens to TON - WALLEThow to successfully withdraw hamster tokens to TON - WALLET
how to successfully withdraw hamster tokens to TON - WALLET
CRYPTO SPACE 🪙
 
Chapter_3 Lecture.pptx Agricultural Marketing Extension
Chapter_3 Lecture.pptx Agricultural Marketing ExtensionChapter_3 Lecture.pptx Agricultural Marketing Extension
Chapter_3 Lecture.pptx Agricultural Marketing Extension
HaimanotBAtinkut
 
Girls Call Laxmi Nagar 9711199171 Provide Best And Top Girl Service And No1 i...
Girls Call Laxmi Nagar 9711199171 Provide Best And Top Girl Service And No1 i...Girls Call Laxmi Nagar 9711199171 Provide Best And Top Girl Service And No1 i...
Girls Call Laxmi Nagar 9711199171 Provide Best And Top Girl Service And No1 i...
Ak47
 
Domestic investment in pension schemes - a good thing?
Domestic investment in pension schemes - a good thing?Domestic investment in pension schemes - a good thing?
Domestic investment in pension schemes - a good thing?
Henry Tapper
 
Lucknow Girls Call Kesar Bagh 08630512678 Provide Best And Top Girl Service A...
Lucknow Girls Call Kesar Bagh 08630512678 Provide Best And Top Girl Service A...Lucknow Girls Call Kesar Bagh 08630512678 Provide Best And Top Girl Service A...
Lucknow Girls Call Kesar Bagh 08630512678 Provide Best And Top Girl Service A...
eshikajshani
 
Hamster kombat - A simple and effective method to withdraw mined tokens.
Hamster kombat - A simple and effective method to withdraw mined tokens.Hamster kombat - A simple and effective method to withdraw mined tokens.
Hamster kombat - A simple and effective method to withdraw mined tokens.
CRYPTO SPACE 🪙
 
Lucknow Girls Call Adil Nagar 08630512678 Available full Day
Lucknow Girls Call Adil Nagar 08630512678 Available full DayLucknow Girls Call Adil Nagar 08630512678 Available full Day
Lucknow Girls Call Adil Nagar 08630512678 Available full Day
annarivihqrika
 
how to sell hamster kombat on bybit crypto exchange.
how to sell hamster kombat on bybit crypto exchange.how to sell hamster kombat on bybit crypto exchange.
how to sell hamster kombat on bybit crypto exchange.
CRYPTO SPACE 🪙
 
hamster kombat airdrop - official launch date revealed.
hamster kombat airdrop - official launch date revealed.hamster kombat airdrop - official launch date revealed.
hamster kombat airdrop - official launch date revealed.
CRYPTO SPACE 🪙
 
Northeastern University degree offer diploma Transcript
Northeastern University degree offer diploma TranscriptNortheastern University degree offer diploma Transcript
Northeastern University degree offer diploma Transcript
oywfdy
 
is hamster kombat still worth mining (HMSTER - update)
is hamster kombat still worth mining (HMSTER - update)is hamster kombat still worth mining (HMSTER - update)
is hamster kombat still worth mining (HMSTER - update)
CRYPTO SPACE 🪙
 
How do I sell my Hamster kombat currency?
How do I sell my Hamster kombat currency?How do I sell my Hamster kombat currency?
How do I sell my Hamster kombat currency?
CRYPTO SPACE 🪙
 
Bangalore Girls Call Bangalore 0X0000000X Payment On Delevery Cash Hot Premiu...
Bangalore Girls Call Bangalore 0X0000000X Payment On Delevery Cash Hot Premiu...Bangalore Girls Call Bangalore 0X0000000X Payment On Delevery Cash Hot Premiu...
Bangalore Girls Call Bangalore 0X0000000X Payment On Delevery Cash Hot Premiu...
seenaoberoi
 
MEMBERS, FRIENDS AND ASSOCIATES OF ATHENS CALLS ATHENS JUNE 2024
MEMBERS, FRIENDS AND ASSOCIATES OF ATHENS CALLS ATHENS  JUNE 2024MEMBERS, FRIENDS AND ASSOCIATES OF ATHENS CALLS ATHENS  JUNE 2024
MEMBERS, FRIENDS AND ASSOCIATES OF ATHENS CALLS ATHENS JUNE 2024
Antonis Zairis
 
Is it possible to sell hamster kombat tokens?
Is it possible to sell hamster kombat tokens?Is it possible to sell hamster kombat tokens?
Is it possible to sell hamster kombat tokens?
CRYPTO SPACE 🪙
 
University of Southern California degree offer diploma Transcript
University of Southern California degree offer diploma TranscriptUniversity of Southern California degree offer diploma Transcript
University of Southern California degree offer diploma Transcript
oywfdy
 
How can I withdraw my hamster tokens to real money in India.
How can I withdraw my hamster tokens to real money in India.How can I withdraw my hamster tokens to real money in India.
How can I withdraw my hamster tokens to real money in India.
CRYPTO SPACE 🪙
 
Introduction to Islamic Banking and Finance
Introduction to Islamic Banking and FinanceIntroduction to Islamic Banking and Finance
Introduction to Islamic Banking and Finance
NasrudinMohamedAhmed
 
Surat Girls Call Surat 0X0000000X Payment On Delevery Cash Hot Premium Genuin...
Surat Girls Call Surat 0X0000000X Payment On Delevery Cash Hot Premium Genuin...Surat Girls Call Surat 0X0000000X Payment On Delevery Cash Hot Premium Genuin...
Surat Girls Call Surat 0X0000000X Payment On Delevery Cash Hot Premium Genuin...
seenaoberoi
 
how to sell hamster kombat at high rate - $1 per token.
how to sell hamster kombat at high rate - $1 per token.how to sell hamster kombat at high rate - $1 per token.
how to sell hamster kombat at high rate - $1 per token.
CRYPTO SPACE 🪙
 

Recently uploaded (20)

how to successfully withdraw hamster tokens to TON - WALLET
how to successfully withdraw hamster tokens to TON - WALLEThow to successfully withdraw hamster tokens to TON - WALLET
how to successfully withdraw hamster tokens to TON - WALLET
 
Chapter_3 Lecture.pptx Agricultural Marketing Extension
Chapter_3 Lecture.pptx Agricultural Marketing ExtensionChapter_3 Lecture.pptx Agricultural Marketing Extension
Chapter_3 Lecture.pptx Agricultural Marketing Extension
 
Girls Call Laxmi Nagar 9711199171 Provide Best And Top Girl Service And No1 i...
Girls Call Laxmi Nagar 9711199171 Provide Best And Top Girl Service And No1 i...Girls Call Laxmi Nagar 9711199171 Provide Best And Top Girl Service And No1 i...
Girls Call Laxmi Nagar 9711199171 Provide Best And Top Girl Service And No1 i...
 
Domestic investment in pension schemes - a good thing?
Domestic investment in pension schemes - a good thing?Domestic investment in pension schemes - a good thing?
Domestic investment in pension schemes - a good thing?
 
Lucknow Girls Call Kesar Bagh 08630512678 Provide Best And Top Girl Service A...
Lucknow Girls Call Kesar Bagh 08630512678 Provide Best And Top Girl Service A...Lucknow Girls Call Kesar Bagh 08630512678 Provide Best And Top Girl Service A...
Lucknow Girls Call Kesar Bagh 08630512678 Provide Best And Top Girl Service A...
 
Hamster kombat - A simple and effective method to withdraw mined tokens.
Hamster kombat - A simple and effective method to withdraw mined tokens.Hamster kombat - A simple and effective method to withdraw mined tokens.
Hamster kombat - A simple and effective method to withdraw mined tokens.
 
Lucknow Girls Call Adil Nagar 08630512678 Available full Day
Lucknow Girls Call Adil Nagar 08630512678 Available full DayLucknow Girls Call Adil Nagar 08630512678 Available full Day
Lucknow Girls Call Adil Nagar 08630512678 Available full Day
 
how to sell hamster kombat on bybit crypto exchange.
how to sell hamster kombat on bybit crypto exchange.how to sell hamster kombat on bybit crypto exchange.
how to sell hamster kombat on bybit crypto exchange.
 
hamster kombat airdrop - official launch date revealed.
hamster kombat airdrop - official launch date revealed.hamster kombat airdrop - official launch date revealed.
hamster kombat airdrop - official launch date revealed.
 
Northeastern University degree offer diploma Transcript
Northeastern University degree offer diploma TranscriptNortheastern University degree offer diploma Transcript
Northeastern University degree offer diploma Transcript
 
is hamster kombat still worth mining (HMSTER - update)
is hamster kombat still worth mining (HMSTER - update)is hamster kombat still worth mining (HMSTER - update)
is hamster kombat still worth mining (HMSTER - update)
 
How do I sell my Hamster kombat currency?
How do I sell my Hamster kombat currency?How do I sell my Hamster kombat currency?
How do I sell my Hamster kombat currency?
 
Bangalore Girls Call Bangalore 0X0000000X Payment On Delevery Cash Hot Premiu...
Bangalore Girls Call Bangalore 0X0000000X Payment On Delevery Cash Hot Premiu...Bangalore Girls Call Bangalore 0X0000000X Payment On Delevery Cash Hot Premiu...
Bangalore Girls Call Bangalore 0X0000000X Payment On Delevery Cash Hot Premiu...
 
MEMBERS, FRIENDS AND ASSOCIATES OF ATHENS CALLS ATHENS JUNE 2024
MEMBERS, FRIENDS AND ASSOCIATES OF ATHENS CALLS ATHENS  JUNE 2024MEMBERS, FRIENDS AND ASSOCIATES OF ATHENS CALLS ATHENS  JUNE 2024
MEMBERS, FRIENDS AND ASSOCIATES OF ATHENS CALLS ATHENS JUNE 2024
 
Is it possible to sell hamster kombat tokens?
Is it possible to sell hamster kombat tokens?Is it possible to sell hamster kombat tokens?
Is it possible to sell hamster kombat tokens?
 
University of Southern California degree offer diploma Transcript
University of Southern California degree offer diploma TranscriptUniversity of Southern California degree offer diploma Transcript
University of Southern California degree offer diploma Transcript
 
How can I withdraw my hamster tokens to real money in India.
How can I withdraw my hamster tokens to real money in India.How can I withdraw my hamster tokens to real money in India.
How can I withdraw my hamster tokens to real money in India.
 
Introduction to Islamic Banking and Finance
Introduction to Islamic Banking and FinanceIntroduction to Islamic Banking and Finance
Introduction to Islamic Banking and Finance
 
Surat Girls Call Surat 0X0000000X Payment On Delevery Cash Hot Premium Genuin...
Surat Girls Call Surat 0X0000000X Payment On Delevery Cash Hot Premium Genuin...Surat Girls Call Surat 0X0000000X Payment On Delevery Cash Hot Premium Genuin...
Surat Girls Call Surat 0X0000000X Payment On Delevery Cash Hot Premium Genuin...
 
how to sell hamster kombat at high rate - $1 per token.
how to sell hamster kombat at high rate - $1 per token.how to sell hamster kombat at high rate - $1 per token.
how to sell hamster kombat at high rate - $1 per token.
 

FireWatir - Web Application Testing Using Ruby and Firefox

  • 1. FireWatir - Web Application Testing Using Ruby & Firefox Angrez Singh Proteans Software Solutions Pvt. Ltd.
  • 2. Motivation Web Applications are increasingly ubiquitous as a functionality delivery paradigm. Testing Web Applications is important Web-Application specific test functionality in commercial test tools leaves much to be desired. …and they cost a bomb.
  • 3. Problems with existing Tools Most provide record-and-replay style test automation functionality. Semantic Gap Little or no support for web application specific test functionality Vendor specific scripting languages (“Vendorscript”)
  • 4. What is Ruby? Purely Object Oriented scripting language Everything is an Object as in Java Scripting language features Full Regular expression support Tight integration with OS Dynamic evaluation References http://www.rubycentral.com http://www.ruby-lang.org http://www.rubygarden.org/ruby http:// tryruby.hobix.com /
  • 5. What is FireWatir? Testing Web Application using Ruby and Firefox browser Framework / Library for scripting Web application testing cases Functional testing tool for automated browser-based tests
  • 7. Conceptual Framework Class for Firefox Classes for each element (e.g. image, link, checkbox etc) Selection mechanism for elements (e.g. index, id, name, value etc)
  • 8. Firefox Class Active methods goto() back() refresh() etc. Methods that provide current state url() title() contains_text() etc
  • 9. Element Class Base class for all Elements Provides common methods click() enabled? exists? Selection Mechanism index, id, name, value etc
  • 10. Checkbox & Radiobutton Class Summary Used to access checkbox & radiobutton Methods set, clear For e.g.: <input type=“checkbox” name=“checkbox1”> ff.checkbox(:name, “checkbox1”).clear <input type=“checkbox” name=“order” value=“order1”> <input type=“checkbox” name=“order” value=“order2”> ff.checkbox(:name, “order”, “order1”).set
  • 11. SelectList Class Summary Used to select value from listbox, dropdownlist Methods option, select, select_item_in_select_list For e.g.: <select name=“selectBox”> <option value=“1”>1</option> </select> ff.select_list(:name, “selectBox”).select(“1”)
  • 12. Text Field Class Summary Used for accessing text box Methods append, maxLength, set, size etc. For e.g.: <input type=“text” name=“UserName” id=“txtUserName”> ff.text_field(:name,”UserName”).set(“set value”)
  • 13. Image Class Summary Use to access image Methods height, width etc. Selection mechanism index, name, id, alt, src For e.g.: <img name=“myimage” alt=“A picture” src=“/images/mypic.jpg“> ff.image(:alt, “A picture”).height()
  • 15. Button class Summary Used to access button on page Selection mechanism caption For e.g.: <input type=“button” id=“btnSearch” name=“search” value=“Search”> ff.button(:name,”search”).click ff.button(:id,”btnSearch”).exists?
  • 16. Link Class Summary Used to access link Methods innerText, src etc Properties href Selection mechanism url, text, title For e.g.: <a href=“ http:// www.google.com ” title=“Go to Google”> ff.link(:title, “Go to Google”).src ff.link(:title, “Go to Google”).link_has_image
  • 17. XPath Selection Mechanism Language for addressing parts of XML document Used to navigate through elements DOM model is represented using Tree like structure XPath is used to select element in DOM Tree References http://www.w3schools.com/xpath/default.asp
  • 18. Selection Mechanism Exact string match ff.text_field(:name, ”txtUserName”) Regular Expression ff.text_field(:name, /txtUserName/) XPath expression ff.text_field(:xpath, “//input[@name=‘txtUserName’]/”) ff.element_by_xpath(“//area[id=‘area1’]/”)
  • 20. How FireWatir interacts? Uses JSSh extension Runs at port 9997 and listens for commands Firewatir sends JavaScript commands via socket Read back the results
  • 21. Advanced Concepts Handling Windows pop up Use attach method of Firefox using title Get a new Firefox instance Use this Firefox instance for accessing elements in pop up window For e.g.: newFF = ff.attach(:title, “Google”) newFF.button(:name, “Search”)
  • 22. Handling Javascript Pop ups Redefines the function alert and confirm in JavaScript JSSh doesn’t get blocked For e.g.: ff.button(:name, /Sign In/).click_no_wait ff.click_jspopup_button(button)
  • 24. Advantages In built XML and XPath support More compliant to standards Can support Linux, Mac platform Made to run on any client machine
  • 25. References FireWatir home page http://code.google.com/p/firewatir/ JSSh home page http://croczilla.com/jssh/ Element References http://www.xulplanet.com/references/elemref/ Download XPI’s http://people.mozilla.com/~davel/jssh/
  • 26. Q & A