SlideShare a Scribd company logo
Presentation @ selemium tool Jagdish Patel Sr. QA Engineer
A brief overview of functional, regression and compatibility  testing An introduction to Selenium tool  Understanding various concepts related to Selenium Practical examples Q&A Topics for today's presentation © Copyright 2008, Gateway Group of companies.
Measures the quality of the business components of the system.  Verifies that the system behaves correctly from the user / business perspective.  Verifies that each component or business event performs in accordance to the specifications, responds correctly to all conditions that may be presented by incoming events / data, moves data correctly from one business event to the next  in the order required to meet the business objectives of the system. Functional testing © Copyright 2008: Gateway Group of companies.
Testing of a program that has been modified in order to ensure that additional bugs have not been introduced. When a program is enhanced, testing is often done only for the newly added features. However, adding source code to a program often introduces errors in other routines. Hence the old and stable functions must be retested along with the new ones.  Regression testing © Copyright 2008, Gateway Group of companies.
Part of software non-functional testing, conducted on the application to  evaluate the application's compatibility with the computing environment like:  Browser compatibility (Firefox, Netscape, Internet Explorer,Safari, etc.)‏ Operating systems (MVS, UNIX, Windows, etc.)‏ Database (Oracle, Sybase, DB2, etc.)‏ Other System Software (Web server, networking/ messaging tool, etc.)‏ Computing capacity of Hardware Platform (IBM 360, HP 9000, etc.)‏ Bandwidth handling capacity of networking hardware Compatibility testing © Copyright 2008, Gateway Group of companies.
A  test case  is a set of test data and test programs (test scripts) and their expected results. A test case validates one or more system requirements and generates a pass or fail. A  test suite  is collection of test scenarios and/or test cases that are related or that cooperate with each other.   Test Case & Test Suite © Copyright 2008, Gateway Group of companies.
Selenium is a portable software testing framework for web applications. The tests can be written as HTML tables or coded in a number of popular programming languages and can be run directly in most modern web browsers. Selenium can be deployed on Windows, Linux, and Macintosh. Selenium was developed by a team of programmers and testers at  ThoughtWorks Inc .  It is released under the Apache 2.0 license and can be downloaded and used without charge.  What is Selenium? © Copyright 2008, Gateway Group of companies.
Reduce the time in regression testing Platform independent  Browser compatibility Open source Light weight Check periodically to see if the site is on-line and works correctly Why should we care? © Copyright 2008, Gateway Group of companies.
Get everything at:  www.openqa.org/selenium/ Additional requirements: JDK 1.5 or above:  www.sun.com Ant 1.7:  http://apache.mirrors.hoobly.com/ant/binaries/apache-ant-1.7.0-bin.zip Where to get Selenium © Copyright 2008, Gateway Group of companies.
Selenium Core Selenium IDE Selenium Remote Control Selenium Grid Selenium core concepts © Copyright 2008, Gateway Group of companies.
How Selenium Works © Copyright 2008, Gateway Group of companies.
Browser support Platforms supported by Selenium © Copyright 2008, Gateway Group of companies. Browser Selenium IDE Selenium RC Selenium Core Firefox 3 Record and playback tests Start browser, run tests Run test Firefox 2 Record and playback tests Start browser, run tests Run test IE 6 not supported Start browser, run tests Run test IE 7 not supported Start browser, run tests Run test Safari 3 not supported Start browser, run tests Run test Safari 2 not supported Start browser, run tests Run test Opera 9 not supported Start browser, run tests Run test
OS Support Platforms supported by Selenium.. © Copyright 2008, Gateway Group of companies. OS Selenium IDE Selenium RC Selenium Core Windows Works in Firefox 2+ Start browser, run tests Run test OS X Works in Firefox 2+ Start browser, run tests Run test Linux Works in Firefox 2+ Start browser, run tests Run test Solaris Works in Firefox 2+ Start browser, run tests Run test
Programming Languages support Platforms supported by Selenium.. © Copyright 2008, Gateway Group of companies. Language Selenium IDE Selenium RC Selenium Core C# Generate code Library ("driver") support n/a Java Generate code Library ("driver") support n/a Perl Generate code Library ("driver") support n/a PHP Generate code Library ("driver") support n/a Python Generate code Library ("driver") support n/a Ruby Generate code Library ("driver") support n/a
Selenium Core © Copyright 2008, Gateway Group of companies. Selenium Core is a test tool for web applications. Selenium Core tests run directly in a browser, just as real users do. The test cases/suites can be tested on various browsers like: IE, FireFox and Opera and also on multiple platforms like: Mac, Windows, Linux etc.
Selenium Core uses a unique mechanism which allows it to run on so many platforms Written in pure JavaScript/DHTML We must have 'write' access to the machine our web application server is running on to install Selenium Core. Selenium Core.. © Copyright 2008, Gateway Group of companies.
Platform and Browser Compatibility: Windows:   Internet Explorer 6.0 and 7.0  Firefox 0.8 to 2.0  Mozilla Suite 1.6+, 1.7+  Seamonkey 1.0  Opera 8 & 9 Mac OS X: Safari 2.0.4+  Firefox 0.8 to 2.0  Camino 1.0a1  Mozilla Suite 1.6+, 1.7+  Seamonkey 1.0  Not yet supported: OmniWeb  Selenium Core.. © Copyright 2008, Gateway Group of companies.
Linux:   Firefox 0.8 to 2.0  Mozilla Suite 1.6+, 1.7+  Konqueror  Opera 8 & 9 Selenium Core.. © Copyright 2008, Gateway Group of companies.
We need to extract the Selenium Core zip file into the 'DocumentRoot', 'htdocs', or 'webroot' folder of our webserver. We then try to open the TestRunner.html page on our website, which should be in the folder/directory. http://10.0.1.106/selenium core/core/TestRunner.html Installing Selenium Core © Copyright 2008, Gateway Group of companies.
Selenium uses javascript and iframes to embed a test automation engine in your browser . This technique should work with any javascript-enabled browser .  Because different browsers handle javascript somewhat differently, we usually have to tweak the engine to support a wide range of browsers on Windows, Mac OS X and Linux.  How does Selenium Core Work © Copyright 2008, Gateway Group of companies.
Running Selenium's Test Suite © Copyright 2008, Gateway Group of companies.
Test Suite Application being  tested Test Cases Steps of the test case Execution Control
Run All Tests Run Selected Test Pause/Play Execution Step through Execution Control Speed of  Execution Highlight Elements in  the Execution View the DOM of the current Page being tested Summary of the Test View the log of the  current execution
To use Selenium Core, we need to make it available from the same web server as the application you want to test.  That means that we can't use Selenium Core (pure DHTML/JavaScript) to write a test of google.com This is because Selenium Core is pure DHTML/JavaScript, and so it is bound by JavaScript's security restrictions. Specifically, JavaScript enforces (This is a JavaScript security requirement. If we can't/won't modify the webserver we want to test, Selenium Core may not be the right tool for us; We may just want to use Selenium IDE or Selenium RC instead.  Limitation of  Selenium Core © Copyright 2008, Gateway Group of companies.
Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and allows us to record, edit, and debug tests. Selenium IDE includes the entire Selenium Core, allowing us to easily and quickly record and play back tests in the actual environment that they will run. Selenium IDE is not only recording tool: it is a complete IDE. We can choose to use its recording capability, or we may edit our scripts by hand. With  the autocomplete support and the ability to move commands around quickly, Selenium IDE is the ideal environment for creating Selenium tests no matter what style of tests we prefer.  Selenium IDE © Copyright 2008, Gateway Group of companies.
The root of web application you want to test The list of actions in the actual test case to execute The log of the events that were executed, including any errors or warning that have occurred
Execution Commands Try the test in the Web based TestRunner Reference of the currently selected command  Record test actions Specify commands, including asserts
Features: Easy record and playback Intelligent field selection will use IDs, names, or XPath as needed Autocomplete for all common Selenium commands Walk through tests Debug and set breakpoints Save tests as HTML, Ruby scripts, or any other format Support for Selenium user-extensions.js file Option to automatically assert the title of every page Selenium IDE.. © Copyright 2008, Gateway Group of companies.
How to create a test plan in Selenium IDE Install Selenium IDE 1.0-beta, a Firefox plugin. After installing Selenium we need to restart your Firefox browser for the    plugin to be activated. Now we should see a new added menu item named Selenium IDE under  the Firefox 'Tools' menu. We open / browse the site for which we want to prepare a test case. We start Selenium IDE from Firefox Tools->Selenium IDE. We browse some pages. We click red button to stop recording. Selenium IDE.. © Copyright 2008, Gateway Group of companies.
Creating a Test Suite A Test Suite in Selenium is just an HTML file that contains a table of links to tests <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;> <head>  <meta content=&quot;text/html; charset=UTF-8&quot; http-equiv=&quot;content-type&quot; /> <title>Test Suite</title></head> <body>  <table id=&quot;suiteTable&quot; cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; border=&quot;1&quot; class=&quot;selenium&quot;><tbody> <tr><td><b>Test Suite</b></td></tr> <tr><td><a href=&quot;hotel.html&quot;>hotel</a></td></tr> <tr><td> <a href=&quot;Restaurant.html&quot;>Restaurant</a></td> </tr><tr><td> <a href=&quot;Meeting.html&quot;>Meeting</a></td></tr> <tr><td> <a href=&quot;Vacancies.html&quot;>Vacancies</a></td></tr> </tbody></table> </body> </html>
Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser. Selenium tests run directly in a browser, just as real users do. These tests can be used for both acceptance testing  (by performing higher-level tests on the integrated system instead of just testing each unit of the system independently) and browser compatibility testing  (by testing the web application on different operating systems and browsers Selenium-Remote Control © Copyright 2008, Gateway Group of companies.
Selenium RC comes in two parts.  1  A server which automatically launches and kills browsers, and acts as a HTTP proxy for web requests from them. 2.  Client libraries for your favourite computer language. The RC server also bundles Selenium Core, and automatically loads it into the browser.   Selenium-Remote Control.. © Copyright 2008, Gateway Group of companies.
Selenium-Remote Control © Copyright 2008, Gateway Group of companies.
The Selenium Server is written in Java, and requires the Java Runtime Environment (JRE) version 1.5.0 or higher in order to start. You may already have it installed. Try running this from the command line: java -version You should see a brief message telling you what version of Java is installed, like this: java version &quot;1.5.0_07&quot; Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)‏ Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode)‏ If you see an error message instead, you may need to install the JRE, or you may need to add it to your PATH environment variable.  Selenium-Remote Control.. © Copyright 2008, Gateway Group of companies.
C:\Program Files\Java>d: D:\>cd jag* D:\jagdish>cd se* D:\jagdish\seleniumtool>cd se* D:\jagdish\seleniumtool\SELenium core>cd.. D:\jagdish\seleniumtool>cd seleniumrc D:\jagdish\seleniumtool\SeleniumRC>cd selenium-re* D:\jagdish\seleniumtool\SeleniumRC\selenium-remote-control-1.0-beta-1>cd  selenium-se* D:\jagdish\seleniumtool\SeleniumRC\selenium-remote-control-1.0-  beta-1\selenium-server-1.0-beta-1> D:\jagdish\seleniumtool\SeleniumRC\selenium-remote-control-1.0-  beta-1\selenium-server-1.0-beta-1>java -jar selenium-server.jar -htmlsuite  *firefox http://10.0.1.106/chagallhotel/ c:\testsuite\Chagallhotel.html  c:\testsuite\results.html Selenium-Remote Control.. © Copyright 2008, Gateway Group of companies.
Selenium-Remote Control.. © Copyright 2008, Gateway Group of companies.
(+) Java (JUnit)‏ import com.thoughtworks.selenium.*; import junit.framework.*; public class ChagallTest extends TestCase {  private Selenium browser; public void setUp() {  browser = new DefaultSelenium(&quot;localhost&quot;, 4444, &quot;*firefox&quot;, &quot;http://10.0.1.106/chagallhotel/&quot;); browser.start();  } public void testGoogle() {  browser.open(&quot;http://10.0.1.106/chagallhotel/admin&quot;); browser.type(&quot;q&quot;, &quot;ld&quot;); browser.click(&quot;btnG&quot;);  browser.waitForPageToLoad(&quot;5000&quot;); assertEquals(&quot; &quot;, browser.getTitle()); } public void tearDown() {  browser.stop(); } } Programming a Selenium RC Test © Copyright 2008, Gateway Group of companies.
(+) C# (NUnit)‏ using Selenium; using Nunit.Framework; namespace MyTests { [TestFixture] public class ChagallTest {  private ISelenium browser  public void SetUp() { browser = new DefaultSelenium(&quot;localhost&quot;, 4444,&quot;*firefox&quot;,&quot;http://http://10.0.1.106/chagallhotel/&quot;); browser.Start(); } public void testChagall() { browser.Open(&quot;http://10.0.1.106/chagallhotel/&quot;); browser.Type(&quot;q&quot;, &quot;ld&quot;);  browser.Click(&quot;btnG&quot;); browser.WaitForPageToLoad(&quot;5000&quot;); Assert.AreEqual(&quot; &quot;, browser.GetTitle()); }  public void TearDown() {  browser.Stop();  } } } Programming a Selenium RC Test © Copyright 2008, Gateway Group of companies.
(+) PHP (PHPUnit)‏ require_once 'Testing/Selenium.php'; require_once 'PHPUnit/Framework/TestCase.php'; class ChagallTest extends PHPUnit_Framework_TestCase { private $browser;  public function setUp() { $this->browser = new Testing_Selenium(&quot;*firefox&quot;, &quot;http://http://10.0.1.106/chagallhotel/&quot;); $this->browser->start();  } public function tearDown() {$this->browser->stop();} public function testChagall()‏ { $this->browser->open(&quot;/webhp?hl=en&quot;); $this->browser->type(&quot;q&quot;, &quot;ld&quot;); $this->browser->click(&quot;btnG&quot;); $this->browser->waitForPageToLoad(10000); $this->assertRegExp(&quot; &quot;, $this->browser->getTitle()); }  } Programming a Selenium RC Test © Copyright 2008, Gateway Group of companies.
Live Demo of an example © Copyright 2008, Gateway Group of companies.
Q&A © Copyright 2008, Gateway Group of companies.
Anand Tiwari Thanks to... © Copyright 2008, Gateway Group of companies.
Fulfilling  Customer Needs Describe the main attributes of the product Link the product attributes to customer needs
Cost Analysis Indicate the financial advantages for the customer Compare quality and price with those of the competition
Strengths and Advantages Summarize the special features and advantages of the product being introduced
Next Steps of Action Explain the steps that now need to be taken

More Related Content

What's hot (20)

ODP
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Yuriy Gerasimov
 
ODP
Integration Testing in Python
Panoptic Development, Inc.
 
PPT
Selenium
Kalyan ch
 
PPT
Selenium
shrialinda
 
PPT
Selenium (1)
onlinemindq
 
PPTX
Selenium WebDriver - Test automation for web applications
TSundberg
 
PPT
Web Test Automation with Selenium
vivek_prahlad
 
PDF
Selenium Ide Tutorial
metapix
 
DOCX
Selenium webdriver course content rakesh hansalia
Rakesh Hansalia
 
PDF
Automated Web Testing With Selenium
Deepak Mittal
 
ODP
Automated UI testing with Selenium
Yuriy Gerasimov
 
PPT
Selenium
Adam Goucher
 
PPT
Selenium
Daksh Sharma
 
DOCX
Selenium interview questions
girichinna27
 
PPTX
Introduction to Selenium Web Driver
Return on Intelligence
 
PDF
Automatic Functional Testing with Selenium and SauceLabs
Joseph Chiang
 
PPT
Automated Web Testing Using Selenium
Weifeng Zhang
 
PPTX
Selenium topic 1- Selenium Basic
ITProfessional Academy
 
PDF
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
Edureka!
 
PDF
Selenium IDE and Beyond
Samit Badle
 
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Yuriy Gerasimov
 
Integration Testing in Python
Panoptic Development, Inc.
 
Selenium
Kalyan ch
 
Selenium
shrialinda
 
Selenium (1)
onlinemindq
 
Selenium WebDriver - Test automation for web applications
TSundberg
 
Web Test Automation with Selenium
vivek_prahlad
 
Selenium Ide Tutorial
metapix
 
Selenium webdriver course content rakesh hansalia
Rakesh Hansalia
 
Automated Web Testing With Selenium
Deepak Mittal
 
Automated UI testing with Selenium
Yuriy Gerasimov
 
Selenium
Adam Goucher
 
Selenium
Daksh Sharma
 
Selenium interview questions
girichinna27
 
Introduction to Selenium Web Driver
Return on Intelligence
 
Automatic Functional Testing with Selenium and SauceLabs
Joseph Chiang
 
Automated Web Testing Using Selenium
Weifeng Zhang
 
Selenium topic 1- Selenium Basic
ITProfessional Academy
 
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
Edureka!
 
Selenium IDE and Beyond
Samit Badle
 

Similar to Selenium (20)

PPT
Selenium
conect2krish
 
PPT
Selenium Primer
gueste1e4db
 
PPT
Selenium By Pravin Mishra
Pravin Mishra
 
PPTX
Test Automation Using Selenium
Nikhil Kapoor
 
PPTX
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Simplilearn
 
PPT
Selenium Concepts
Swati Bansal
 
PPTX
Selenium Testing
Shreshtt Bhatt
 
PPT
Selenium
BugRaptors
 
PPT
BCS Selenium Workshop
Colin McDonald
 
PDF
Selenium Tutorial
prad_123
 
PPTX
Step by step instructions to execute selenium automation testing
Alisha Henderson
 
PPT
QSpiders - Automation using Selenium
Qspiders - Software Testing Training Institute
 
PDF
Selenium by using JAVA
mahirayavarapu
 
PPT
Selenium Introduction
Mayur Khairnar
 
PPTX
Selenium presentation
shivani thakur
 
PPT
Selenium Basics by Quontra Solutions
QUONTRASOLUTIONS
 
PPTX
Selenium- A Software Testing Tool
Zeba Tahseen
 
PPTX
Selenium Introduction and IDE
Murageppa-QA
 
PPTX
Selenium
Mayuresh Wadekar
 
PPTX
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
Simplilearn
 
Selenium
conect2krish
 
Selenium Primer
gueste1e4db
 
Selenium By Pravin Mishra
Pravin Mishra
 
Test Automation Using Selenium
Nikhil Kapoor
 
Selenium Tutorial For Beginners | Selenium Automation Testing Tutorial | Sele...
Simplilearn
 
Selenium Concepts
Swati Bansal
 
Selenium Testing
Shreshtt Bhatt
 
Selenium
BugRaptors
 
BCS Selenium Workshop
Colin McDonald
 
Selenium Tutorial
prad_123
 
Step by step instructions to execute selenium automation testing
Alisha Henderson
 
QSpiders - Automation using Selenium
Qspiders - Software Testing Training Institute
 
Selenium by using JAVA
mahirayavarapu
 
Selenium Introduction
Mayur Khairnar
 
Selenium presentation
shivani thakur
 
Selenium Basics by Quontra Solutions
QUONTRASOLUTIONS
 
Selenium- A Software Testing Tool
Zeba Tahseen
 
Selenium Introduction and IDE
Murageppa-QA
 
What Is Selenium? | Selenium Basics For Beginners | Introduction To Selenium ...
Simplilearn
 
Ad

Recently uploaded (20)

PDF
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
PPTX
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
PDF
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
PDF
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
PDF
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
PDF
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
PDF
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
PDF
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPT
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PPTX
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
PDF
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
PPTX
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
PDF
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
PPTX
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
PDF
Blockchain Transactions Explained For Everyone
CIFDAQ
 
PPTX
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Presentation - Vibe Coding The Future of Tech
yanuarsinggih1
 
OpenID AuthZEN - Analyst Briefing July 2025
David Brossard
 
NewMind AI - Journal 100 Insights After The 100th Issue
NewMind AI
 
Reverse Engineering of Security Products: Developing an Advanced Microsoft De...
nwbxhhcyjv
 
"AI Transformation: Directions and Challenges", Pavlo Shaternik
Fwdays
 
Log-Based Anomaly Detection: Enhancing System Reliability with Machine Learning
Mohammed BEKKOUCHE
 
Using FME to Develop Self-Service CAD Applications for a Major UK Police Force
Safe Software
 
SFWelly Summer 25 Release Highlights July 2025
Anna Loughnan Colquhoun
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Interview paper part 3, It is based on Interview Prep
SoumyadeepGhosh39
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Q2 FY26 Tableau User Group Leader Quarterly Call
lward7
 
CIFDAQ Weekly Market Wrap for 11th July 2025
CIFDAQ
 
Top iOS App Development Company in the USA for Innovative Apps
SynapseIndia
 
LLMs.txt: Easily Control How AI Crawls Your Site
Keploy
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
AUTOMATION AND ROBOTICS IN PHARMA INDUSTRY.pptx
sameeraaabegumm
 
Blockchain Transactions Explained For Everyone
CIFDAQ
 
UiPath Academic Alliance Educator Panels: Session 2 - Business Analyst Content
DianaGray10
 
Ad

Selenium

  • 1. Presentation @ selemium tool Jagdish Patel Sr. QA Engineer
  • 2. A brief overview of functional, regression and compatibility testing An introduction to Selenium tool Understanding various concepts related to Selenium Practical examples Q&A Topics for today's presentation © Copyright 2008, Gateway Group of companies.
  • 3. Measures the quality of the business components of the system. Verifies that the system behaves correctly from the user / business perspective. Verifies that each component or business event performs in accordance to the specifications, responds correctly to all conditions that may be presented by incoming events / data, moves data correctly from one business event to the next in the order required to meet the business objectives of the system. Functional testing © Copyright 2008: Gateway Group of companies.
  • 4. Testing of a program that has been modified in order to ensure that additional bugs have not been introduced. When a program is enhanced, testing is often done only for the newly added features. However, adding source code to a program often introduces errors in other routines. Hence the old and stable functions must be retested along with the new ones. Regression testing © Copyright 2008, Gateway Group of companies.
  • 5. Part of software non-functional testing, conducted on the application to evaluate the application's compatibility with the computing environment like: Browser compatibility (Firefox, Netscape, Internet Explorer,Safari, etc.)‏ Operating systems (MVS, UNIX, Windows, etc.)‏ Database (Oracle, Sybase, DB2, etc.)‏ Other System Software (Web server, networking/ messaging tool, etc.)‏ Computing capacity of Hardware Platform (IBM 360, HP 9000, etc.)‏ Bandwidth handling capacity of networking hardware Compatibility testing © Copyright 2008, Gateway Group of companies.
  • 6. A test case is a set of test data and test programs (test scripts) and their expected results. A test case validates one or more system requirements and generates a pass or fail. A test suite is collection of test scenarios and/or test cases that are related or that cooperate with each other. Test Case & Test Suite © Copyright 2008, Gateway Group of companies.
  • 7. Selenium is a portable software testing framework for web applications. The tests can be written as HTML tables or coded in a number of popular programming languages and can be run directly in most modern web browsers. Selenium can be deployed on Windows, Linux, and Macintosh. Selenium was developed by a team of programmers and testers at ThoughtWorks Inc . It is released under the Apache 2.0 license and can be downloaded and used without charge. What is Selenium? © Copyright 2008, Gateway Group of companies.
  • 8. Reduce the time in regression testing Platform independent Browser compatibility Open source Light weight Check periodically to see if the site is on-line and works correctly Why should we care? © Copyright 2008, Gateway Group of companies.
  • 9. Get everything at: www.openqa.org/selenium/ Additional requirements: JDK 1.5 or above: www.sun.com Ant 1.7: http://apache.mirrors.hoobly.com/ant/binaries/apache-ant-1.7.0-bin.zip Where to get Selenium © Copyright 2008, Gateway Group of companies.
  • 10. Selenium Core Selenium IDE Selenium Remote Control Selenium Grid Selenium core concepts © Copyright 2008, Gateway Group of companies.
  • 11. How Selenium Works © Copyright 2008, Gateway Group of companies.
  • 12. Browser support Platforms supported by Selenium © Copyright 2008, Gateway Group of companies. Browser Selenium IDE Selenium RC Selenium Core Firefox 3 Record and playback tests Start browser, run tests Run test Firefox 2 Record and playback tests Start browser, run tests Run test IE 6 not supported Start browser, run tests Run test IE 7 not supported Start browser, run tests Run test Safari 3 not supported Start browser, run tests Run test Safari 2 not supported Start browser, run tests Run test Opera 9 not supported Start browser, run tests Run test
  • 13. OS Support Platforms supported by Selenium.. © Copyright 2008, Gateway Group of companies. OS Selenium IDE Selenium RC Selenium Core Windows Works in Firefox 2+ Start browser, run tests Run test OS X Works in Firefox 2+ Start browser, run tests Run test Linux Works in Firefox 2+ Start browser, run tests Run test Solaris Works in Firefox 2+ Start browser, run tests Run test
  • 14. Programming Languages support Platforms supported by Selenium.. © Copyright 2008, Gateway Group of companies. Language Selenium IDE Selenium RC Selenium Core C# Generate code Library (&quot;driver&quot;) support n/a Java Generate code Library (&quot;driver&quot;) support n/a Perl Generate code Library (&quot;driver&quot;) support n/a PHP Generate code Library (&quot;driver&quot;) support n/a Python Generate code Library (&quot;driver&quot;) support n/a Ruby Generate code Library (&quot;driver&quot;) support n/a
  • 15. Selenium Core © Copyright 2008, Gateway Group of companies. Selenium Core is a test tool for web applications. Selenium Core tests run directly in a browser, just as real users do. The test cases/suites can be tested on various browsers like: IE, FireFox and Opera and also on multiple platforms like: Mac, Windows, Linux etc.
  • 16. Selenium Core uses a unique mechanism which allows it to run on so many platforms Written in pure JavaScript/DHTML We must have 'write' access to the machine our web application server is running on to install Selenium Core. Selenium Core.. © Copyright 2008, Gateway Group of companies.
  • 17. Platform and Browser Compatibility: Windows: Internet Explorer 6.0 and 7.0 Firefox 0.8 to 2.0 Mozilla Suite 1.6+, 1.7+ Seamonkey 1.0 Opera 8 & 9 Mac OS X: Safari 2.0.4+ Firefox 0.8 to 2.0 Camino 1.0a1 Mozilla Suite 1.6+, 1.7+ Seamonkey 1.0 Not yet supported: OmniWeb Selenium Core.. © Copyright 2008, Gateway Group of companies.
  • 18. Linux: Firefox 0.8 to 2.0 Mozilla Suite 1.6+, 1.7+ Konqueror Opera 8 & 9 Selenium Core.. © Copyright 2008, Gateway Group of companies.
  • 19. We need to extract the Selenium Core zip file into the 'DocumentRoot', 'htdocs', or 'webroot' folder of our webserver. We then try to open the TestRunner.html page on our website, which should be in the folder/directory. http://10.0.1.106/selenium core/core/TestRunner.html Installing Selenium Core © Copyright 2008, Gateway Group of companies.
  • 20. Selenium uses javascript and iframes to embed a test automation engine in your browser . This technique should work with any javascript-enabled browser . Because different browsers handle javascript somewhat differently, we usually have to tweak the engine to support a wide range of browsers on Windows, Mac OS X and Linux. How does Selenium Core Work © Copyright 2008, Gateway Group of companies.
  • 21. Running Selenium's Test Suite © Copyright 2008, Gateway Group of companies.
  • 22. Test Suite Application being tested Test Cases Steps of the test case Execution Control
  • 23. Run All Tests Run Selected Test Pause/Play Execution Step through Execution Control Speed of Execution Highlight Elements in the Execution View the DOM of the current Page being tested Summary of the Test View the log of the current execution
  • 24. To use Selenium Core, we need to make it available from the same web server as the application you want to test. That means that we can't use Selenium Core (pure DHTML/JavaScript) to write a test of google.com This is because Selenium Core is pure DHTML/JavaScript, and so it is bound by JavaScript's security restrictions. Specifically, JavaScript enforces (This is a JavaScript security requirement. If we can't/won't modify the webserver we want to test, Selenium Core may not be the right tool for us; We may just want to use Selenium IDE or Selenium RC instead. Limitation of Selenium Core © Copyright 2008, Gateway Group of companies.
  • 25. Selenium IDE is an integrated development environment for Selenium tests. It is implemented as a Firefox extension, and allows us to record, edit, and debug tests. Selenium IDE includes the entire Selenium Core, allowing us to easily and quickly record and play back tests in the actual environment that they will run. Selenium IDE is not only recording tool: it is a complete IDE. We can choose to use its recording capability, or we may edit our scripts by hand. With the autocomplete support and the ability to move commands around quickly, Selenium IDE is the ideal environment for creating Selenium tests no matter what style of tests we prefer. Selenium IDE © Copyright 2008, Gateway Group of companies.
  • 26. The root of web application you want to test The list of actions in the actual test case to execute The log of the events that were executed, including any errors or warning that have occurred
  • 27. Execution Commands Try the test in the Web based TestRunner Reference of the currently selected command Record test actions Specify commands, including asserts
  • 28. Features: Easy record and playback Intelligent field selection will use IDs, names, or XPath as needed Autocomplete for all common Selenium commands Walk through tests Debug and set breakpoints Save tests as HTML, Ruby scripts, or any other format Support for Selenium user-extensions.js file Option to automatically assert the title of every page Selenium IDE.. © Copyright 2008, Gateway Group of companies.
  • 29. How to create a test plan in Selenium IDE Install Selenium IDE 1.0-beta, a Firefox plugin. After installing Selenium we need to restart your Firefox browser for the plugin to be activated. Now we should see a new added menu item named Selenium IDE under the Firefox 'Tools' menu. We open / browse the site for which we want to prepare a test case. We start Selenium IDE from Firefox Tools->Selenium IDE. We browse some pages. We click red button to stop recording. Selenium IDE.. © Copyright 2008, Gateway Group of companies.
  • 30. Creating a Test Suite A Test Suite in Selenium is just an HTML file that contains a table of links to tests <html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; xml:lang=&quot;en&quot; lang=&quot;en&quot;> <head> <meta content=&quot;text/html; charset=UTF-8&quot; http-equiv=&quot;content-type&quot; /> <title>Test Suite</title></head> <body> <table id=&quot;suiteTable&quot; cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; border=&quot;1&quot; class=&quot;selenium&quot;><tbody> <tr><td><b>Test Suite</b></td></tr> <tr><td><a href=&quot;hotel.html&quot;>hotel</a></td></tr> <tr><td> <a href=&quot;Restaurant.html&quot;>Restaurant</a></td> </tr><tr><td> <a href=&quot;Meeting.html&quot;>Meeting</a></td></tr> <tr><td> <a href=&quot;Vacancies.html&quot;>Vacancies</a></td></tr> </tbody></table> </body> </html>
  • 31. Selenium Remote Control (RC) is a test tool that allows you to write automated web application UI tests in any programming language against any HTTP website using any mainstream JavaScript-enabled browser. Selenium tests run directly in a browser, just as real users do. These tests can be used for both acceptance testing (by performing higher-level tests on the integrated system instead of just testing each unit of the system independently) and browser compatibility testing (by testing the web application on different operating systems and browsers Selenium-Remote Control © Copyright 2008, Gateway Group of companies.
  • 32. Selenium RC comes in two parts. 1 A server which automatically launches and kills browsers, and acts as a HTTP proxy for web requests from them. 2. Client libraries for your favourite computer language. The RC server also bundles Selenium Core, and automatically loads it into the browser. Selenium-Remote Control.. © Copyright 2008, Gateway Group of companies.
  • 33. Selenium-Remote Control © Copyright 2008, Gateway Group of companies.
  • 34. The Selenium Server is written in Java, and requires the Java Runtime Environment (JRE) version 1.5.0 or higher in order to start. You may already have it installed. Try running this from the command line: java -version You should see a brief message telling you what version of Java is installed, like this: java version &quot;1.5.0_07&quot; Java(TM) 2 Runtime Environment, Standard Edition (build 1.5.0_07-b03)‏ Java HotSpot(TM) Client VM (build 1.5.0_07-b03, mixed mode)‏ If you see an error message instead, you may need to install the JRE, or you may need to add it to your PATH environment variable. Selenium-Remote Control.. © Copyright 2008, Gateway Group of companies.
  • 35. C:\Program Files\Java>d: D:\>cd jag* D:\jagdish>cd se* D:\jagdish\seleniumtool>cd se* D:\jagdish\seleniumtool\SELenium core>cd.. D:\jagdish\seleniumtool>cd seleniumrc D:\jagdish\seleniumtool\SeleniumRC>cd selenium-re* D:\jagdish\seleniumtool\SeleniumRC\selenium-remote-control-1.0-beta-1>cd selenium-se* D:\jagdish\seleniumtool\SeleniumRC\selenium-remote-control-1.0- beta-1\selenium-server-1.0-beta-1> D:\jagdish\seleniumtool\SeleniumRC\selenium-remote-control-1.0- beta-1\selenium-server-1.0-beta-1>java -jar selenium-server.jar -htmlsuite *firefox http://10.0.1.106/chagallhotel/ c:\testsuite\Chagallhotel.html c:\testsuite\results.html Selenium-Remote Control.. © Copyright 2008, Gateway Group of companies.
  • 36. Selenium-Remote Control.. © Copyright 2008, Gateway Group of companies.
  • 37. (+) Java (JUnit)‏ import com.thoughtworks.selenium.*; import junit.framework.*; public class ChagallTest extends TestCase { private Selenium browser; public void setUp() { browser = new DefaultSelenium(&quot;localhost&quot;, 4444, &quot;*firefox&quot;, &quot;http://10.0.1.106/chagallhotel/&quot;); browser.start(); } public void testGoogle() { browser.open(&quot;http://10.0.1.106/chagallhotel/admin&quot;); browser.type(&quot;q&quot;, &quot;ld&quot;); browser.click(&quot;btnG&quot;); browser.waitForPageToLoad(&quot;5000&quot;); assertEquals(&quot; &quot;, browser.getTitle()); } public void tearDown() { browser.stop(); } } Programming a Selenium RC Test © Copyright 2008, Gateway Group of companies.
  • 38. (+) C# (NUnit)‏ using Selenium; using Nunit.Framework; namespace MyTests { [TestFixture] public class ChagallTest { private ISelenium browser public void SetUp() { browser = new DefaultSelenium(&quot;localhost&quot;, 4444,&quot;*firefox&quot;,&quot;http://http://10.0.1.106/chagallhotel/&quot;); browser.Start(); } public void testChagall() { browser.Open(&quot;http://10.0.1.106/chagallhotel/&quot;); browser.Type(&quot;q&quot;, &quot;ld&quot;); browser.Click(&quot;btnG&quot;); browser.WaitForPageToLoad(&quot;5000&quot;); Assert.AreEqual(&quot; &quot;, browser.GetTitle()); } public void TearDown() { browser.Stop(); } } } Programming a Selenium RC Test © Copyright 2008, Gateway Group of companies.
  • 39. (+) PHP (PHPUnit)‏ require_once 'Testing/Selenium.php'; require_once 'PHPUnit/Framework/TestCase.php'; class ChagallTest extends PHPUnit_Framework_TestCase { private $browser; public function setUp() { $this->browser = new Testing_Selenium(&quot;*firefox&quot;, &quot;http://http://10.0.1.106/chagallhotel/&quot;); $this->browser->start(); } public function tearDown() {$this->browser->stop();} public function testChagall()‏ { $this->browser->open(&quot;/webhp?hl=en&quot;); $this->browser->type(&quot;q&quot;, &quot;ld&quot;); $this->browser->click(&quot;btnG&quot;); $this->browser->waitForPageToLoad(10000); $this->assertRegExp(&quot; &quot;, $this->browser->getTitle()); } } Programming a Selenium RC Test © Copyright 2008, Gateway Group of companies.
  • 40. Live Demo of an example © Copyright 2008, Gateway Group of companies.
  • 41. Q&A © Copyright 2008, Gateway Group of companies.
  • 42. Anand Tiwari Thanks to... © Copyright 2008, Gateway Group of companies.
  • 43. Fulfilling Customer Needs Describe the main attributes of the product Link the product attributes to customer needs
  • 44. Cost Analysis Indicate the financial advantages for the customer Compare quality and price with those of the competition
  • 45. Strengths and Advantages Summarize the special features and advantages of the product being introduced
  • 46. Next Steps of Action Explain the steps that now need to be taken