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

PDF
Basics of Selenium IDE,Core, Remote Control
ODP
Mastering selenium for automated acceptance tests
PPTX
Smarter ways to do selenium automation @ work, Selenium, automation
PPS
Selenium Demo
PPTX
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
PPT
Selenium
PDF
Selenium 2 - PyCon 2011
PDF
Selenium IDE Introduction, Installation and Working
Basics of Selenium IDE,Core, Remote Control
Mastering selenium for automated acceptance tests
Smarter ways to do selenium automation @ work, Selenium, automation
Selenium Demo
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
Selenium
Selenium 2 - PyCon 2011
Selenium IDE Introduction, Installation and Working

What's hot (20)

ODP
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
ODP
Integration Testing in Python
PPT
Selenium
PPT
Selenium
PPT
Selenium (1)
PPTX
Selenium WebDriver - Test automation for web applications
PPT
Web Test Automation with Selenium
PDF
Selenium Ide Tutorial
DOCX
Selenium webdriver course content rakesh hansalia
PDF
Automated Web Testing With Selenium
ODP
Automated UI testing with Selenium
PPT
Selenium
PPT
Selenium
DOCX
Selenium interview questions
PPTX
Introduction to Selenium Web Driver
PDF
Automatic Functional Testing with Selenium and SauceLabs
PPT
Automated Web Testing Using Selenium
PPTX
Selenium topic 1- Selenium Basic
PDF
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
PDF
Selenium IDE and Beyond
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Integration Testing in Python
Selenium
Selenium
Selenium (1)
Selenium WebDriver - Test automation for web applications
Web Test Automation with Selenium
Selenium Ide Tutorial
Selenium webdriver course content rakesh hansalia
Automated Web Testing With Selenium
Automated UI testing with Selenium
Selenium
Selenium
Selenium interview questions
Introduction to Selenium Web Driver
Automatic Functional Testing with Selenium and SauceLabs
Automated Web Testing Using Selenium
Selenium topic 1- Selenium Basic
Selenium Interview Questions and Answers For Freshers And Experienced | Edureka
Selenium IDE and Beyond
Ad

Similar to Selenium (20)

PPT
Selenium Primer
PPT
BCS Selenium Workshop
PPT
QSpiders - Automation using Selenium
PPT
Selenium Primer
PPTX
test-automation-selenium-160216124839.pptx
PPTX
Selenium test automation
PDF
International journal of applied sciences and innovation vol 2015 - no 1 - ...
PPT
Steps to write Selenium
DOCX
What is selenium
PPTX
What is Selenium Introduction to Selenium Testing.pptx
PDF
Module-1_Getting-Started_with_selenium_and_Java_basics.pdf
PDF
Selenium by using JAVA
PDF
Learn Selenium - Online Guide
PPT
Selenium Basics by Quontra Solutions
PPTX
Test Automation and Selenium
PPTX
Automated Web Testing With Selenium
PPTX
Test Automation Using Selenium
PPT
Selenium
DOC
Selenium Primer
BCS Selenium Workshop
QSpiders - Automation using Selenium
Selenium Primer
test-automation-selenium-160216124839.pptx
Selenium test automation
International journal of applied sciences and innovation vol 2015 - no 1 - ...
Steps to write Selenium
What is selenium
What is Selenium Introduction to Selenium Testing.pptx
Module-1_Getting-Started_with_selenium_and_Java_basics.pdf
Selenium by using JAVA
Learn Selenium - Online Guide
Selenium Basics by Quontra Solutions
Test Automation and Selenium
Automated Web Testing With Selenium
Test Automation Using Selenium
Selenium
Ad

Recently uploaded (20)

PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
cuic standard and advanced reporting.pdf
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
Spectroscopy.pptx food analysis technology
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Empathic Computing: Creating Shared Understanding
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Machine learning based COVID-19 study performance prediction
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
KodekX | Application Modernization Development
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
Chapter 3 Spatial Domain Image Processing.pdf
Dropbox Q2 2025 Financial Results & Investor Presentation
Digital-Transformation-Roadmap-for-Companies.pptx
cuic standard and advanced reporting.pdf
Programs and apps: productivity, graphics, security and other tools
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
Spectroscopy.pptx food analysis technology
“AI and Expert System Decision Support & Business Intelligence Systems”
Review of recent advances in non-invasive hemoglobin estimation
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Empathic Computing: Creating Shared Understanding
The Rise and Fall of 3GPP – Time for a Sabbatical?
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
Understanding_Digital_Forensics_Presentation.pptx
20250228 LYD VKU AI Blended-Learning.pptx
Machine learning based COVID-19 study performance prediction
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Agricultural_Statistics_at_a_Glance_2022_0.pdf
KodekX | Application Modernization Development
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf

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