SlideShare a Scribd company logo
Testing With Selenium - Open source Test Automation Tool
Agenda Selenium Origin What is Selenium? Platform and Browser compatibility Selenium IDE How to work with Selenium IDE? Selenium CORE How to work with Selenium IDE? Testing Application with IDE/CORE? Selenium-RC Way to Test Application in IE  Test IE application with PHPUnit DATA-Driven QMetry- Live Example
Selenium Origin Selenium is a chemical element in the periodic table that has the symbol Se and atomic number 34 Selenium was developed by team of Programmers and testers at ThoughtWorks to test their web based time and expenses system. Javascript Functional Test Runner  was written by Jason Huggins, Paul Gross and Jie Tina Wang, in 2004.
What is Selenium and whats it for? Selenium tests run directly in a browser, just as real users do  A java Script Based Open Source Web Testing Tool That Support web 2.0 Application On Multiple Browser And multiple OS No other test tool covers such a wide array of platforms
Contd.. Selenium is not meant for unit testing Its used for Functional or system   Testing But Not for Performance Testing
Platform and Browser compatibility Supported Platforms:  Windows: Internet Explorer 6.0 Firefox 0.8 to 1.5 Mozilla Suite 1.6+, 1.7+ Seamonkey 1.0 Opera 8 Mac OS X:  Safari 1.3+  Firefox 0.8 to 1.5 Camino 1.0a1  Mozilla Suite 1.6+, 1.7+  Seamonkey 1.0  Linux:  Firefox 0.8 to 1.5  Mozilla Suite 1.6+, 1.7+  Konqueror
Introduction Driven Mode. Test Case in different Language Selenium IDE CORE RC Record Mode Bot Mode: HTML tables
Selenium IDE Selenium IDE is an integrated development environment for Selenium tests It is implemented as a Firefox extension. (Note no IE Extension Available) It allows us to record, edit, and debug tests Selenium IDE includes the entire Selenium Core, allowing you 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 You can choose to use its recording capability, or you may edit your scripts by hand
How to Start work with Selenium IDE? Download from  http://www.openqa.org/selenium-ide/download.action When you will download selenium IDE with firefox, it should automatically ask you to install the plugin. In case if we downloaded the file with Opera or IE. No problem:
Contd.. Open firefox from the menu: Tools ->Add-ons--> Extensions now drag-n-drop the xpi file to the extensions window restart firefox You can see a 'Selenium IDE' entry from your tools menu Note:  First, Always we have to record test in IDE with Fire fox, then we could playback in IE using seleniumTest runner and also for Phpunit(RC)
IDE
Features:  Easy record and playback Debug and set breakpoints Autocomplete for all common Selenium commands  Save tests as HTML, PHP scripts, or any other format Support for Selenium user-extensions.js file Option to automatically assert the title of every page
Selenium-CORE Selenium core is a test tool for web For  Web application Selenium core tests run directly In a browser Just as real users do !!  Written in Pure JAVAScript And DHTML
How to Start work with Selenium CORE? To use Selenium Core, you need to make it available from the same web server as the application you want to test  Normally, this is as simple as extracting the Selenium Core zip file into the Document Root, htdocs, or webroot of your webserver.  Then, try to open the TestRunner.html page on your website, which should be in the core/ directory.
 
Live Example Testing Google/QMetry Application with IDE and Core
HTA Mode Selenium Core provides an additional mechanism for running automated tests called "HTA mode.“ An hta file is simply an html file but the extension “. hta” means that when we navigated to IE, it will apply same strict security measure Window+Selenium core+IE To run Selenium Core in HTA mode, just double-click on TestRunner.hta, in the /core directory of your Selenium installation.
Selenium RC Allow us to  write automated web application in any programming language  (Java,  .NET,  Perl,  Python,  Ruby,  PHP) Selenium Remote Control provides a Selenium Server, which cans automatically start/stop/control, any supported browser  The Selenium Server communicates directly with  browser using AJAX Selenium Server acts as a client-configured HTTP proxy, to stand in between the browser and your website.
RC Architecture
How to Start Selenium Server 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 Once you've got Java installed and ready to go, you can start the Selenium Server from the command line like this: Go to /selenium directory/server/ java -jar selenium-server.jar -interactive
Contd.. That will start the Selenium Server and allow you to type commands in the command window. After a number of log messages, you should see the following message:  Entering interactive mode... type Selenium commands here (e.g: cmd=open&1=http://www.yahoo.com)  Let's begin by using Selenium Server to open up a browser. If you're on Windows and want to run your Selenium commands using Internet Explorer, try typing this: cmd=getNewBrowserSession&1=*iexplore&2=http://www.google.com
Contd.. If all goes well, you should see a new browser window starting with the browser of your choice. Back in the Selenium Server command window, you should see the following message: Got result: OK, 260113 on session 260113
How I Solved this Error?? When I  Test Remote Site through PHPUnit then I was getting following error  Error: Testing_Selenium_Exception: could not get response form RC  I have started My server through following command Java –jar selenium-server.jar -proxyInjectionMode
ProxyInjectionMode "Proxy injection" mode is a new highly experimental feature for 0.9.0 Normal Mode ProxyInjectionMode Mode They Keep two automated test windows   1.Selenium 2.Your Application
ProxyInjectionMode They eliminate the separate Selenium window, in favor of "injecting" Selenium into every HTML page  By injecting ourselves into the HTML, They have increased control over our application To use PI mode, you need to start the Selenium Server with a special command line argument, like this java -jar selenium-server.jar –proxyInjectionMode cmd=getNewBrowserSession&1=*pifirefox&2=http://www.google.com
Test Application in IE Two way to Test Application in IE Directly click on .hta file Through PHPUnit Elevated Security Privilege The two experimental "elevated security privilege" browser launchers are: *iehta: Launches Internet Explorer as an  HTML Application (HTA) .  *chrome: Launches Firefox using a  chrome URL .
Test IE Application with PHPUnit CASE I: If Selenium Server is in Proxy InjectionMode Start server in Proxy Injection Mode Run Selenium IDE and record step with firefox Go to Options  Format  PHP-selenium RC Copy that PHP code and paste in PHPUnit Folder PHPUnit will be in C:\Program Files\xampp\php\pear\PHPUnit Make xyz.php file (you could give different Name) Open that PHP file and change following line from  $this-  Selenium= new Testing_Selenium (“*firefox”, http://localhost:4444/ ); to  $this-  Selenium= new Testing_Selenium(“*iexplore”, http://localhost:4444/ ); Now type command phpunit xyz.php It will open IE browser for you and Test the application
CASE II: If Selenium Server isn’t in Proxy InjectionMode Start server in Proxy Injection Mode Run Selenium IDE and record step with firefox Go to Options  Format  PHP-selenium RC Copy that PHP code and paste in PHPUnit Folder PHPUnit will be in C:\Program Files\xampp\php\pear\PHPUnit Make xyz.php file (you could give different Name) Open that PHP file and change following line from  $this-  Selenium= new Testing_Selenium (“*firefox”, http://localhost:4444/ ); to  $this-  Selenium= new Testing_Selenium(“*iehta”, http://localhost:4444/ );
DATA-Driven Code to Fetch Data from Excel Sheet //code added by Niranjan  $arr=array(1=>'a','b','c','d','e'); $filename  =  &quot;c:\Info1.xls&quot;; $sheet1  =  &quot;sheet1&quot;; $excel_app  =  new COM(&quot;Excel.application&quot;)  or  Die  (&quot;Did  not  connect&quot;); $Workbook  =  $excel_app->Workbooks->Open($filename)  or  Die(&quot;Did  not  open  $filename  $Workbook&quot;); $Worksheet  =  $Workbook->Worksheets($sheet1); $Worksheet->activate; //$excel_cell  =  $Worksheet->Range(&quot;A1&quot;); $excel_cell->activate; for($i=1; $i<5;$i++) { for($j=1; $j<5;$j++) { $excel_cell  =  $Worksheet->Range($arr[$i].$j); print &quot;The  value  is  $arr[$i].$j  => \n&quot;  .$excel_cell->value; } }
QMetry- Live Example Add User into Qmetry-UPM module without Repository Add User with Repository
Question !!!
www.openqa.org/selenium www.nealford.com For more Information about Selenium Use my following Blog Address http://seleniumtest.wordpress.com Thank You Niranjan Limbachiya [email_address]

More Related Content

PPTX
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
PPS
Selenium Demo
PDF
Selenium Tutorial
PPT
Automated Web Testing Using Selenium
PDF
Selenium Ide Tutorial
PPTX
Selenium test automation
DOC
PPT
Selenium ppt
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
Selenium Demo
Selenium Tutorial
Automated Web Testing Using Selenium
Selenium Ide Tutorial
Selenium test automation
Selenium ppt

What's hot (20)

PPT
Selenium ppt
PPT
Selenium Primer
PPT
Selenium
PPT
Selenium
PDF
Web application testing with Selenium
PPT
Test automation using selenium
PPTX
Selenium ppt
PPTX
Selenium- A Software Testing Tool
PPT
Selenium (1)
PPTX
Selenium
ODP
Mastering selenium for automated acceptance tests
PPTX
Introduction to Selenium Web Driver
PPTX
Selenium introduction
PPTX
Smarter ways to do selenium automation @ work, Selenium, automation
PDF
Basics of Selenium IDE,Core, Remote Control
DOCX
Selenium webdriver course content rakesh hansalia
DOCX
Selenium interview questions
PDF
First steps with selenium rc
PPT
Selenium Presentation at Engineering Colleges
ODP
Introduction to Selenium
Selenium ppt
Selenium Primer
Selenium
Selenium
Web application testing with Selenium
Test automation using selenium
Selenium ppt
Selenium- A Software Testing Tool
Selenium (1)
Selenium
Mastering selenium for automated acceptance tests
Introduction to Selenium Web Driver
Selenium introduction
Smarter ways to do selenium automation @ work, Selenium, automation
Basics of Selenium IDE,Core, Remote Control
Selenium webdriver course content rakesh hansalia
Selenium interview questions
First steps with selenium rc
Selenium Presentation at Engineering Colleges
Introduction to Selenium
Ad

Viewers also liked (12)

PPTX
Selenium Training
PPT
Sakai10 Selenium Workshop
PPTX
Selenium IDE and Extensions
PDF
Automated User Tests with Apache Flex
PPT
Steps to write Selenium
PDF
Selenium IDE and Beyond
PDF
Efficient Automated Test Creation With Selenium IDE Plugins
PPT
Selenium Ide Tutorials
PPT
Selenium
DOCX
Selenium WebDriver FAQ's
PDF
Jmeter Performance Testing
PPT
Java Basics for selenium
Selenium Training
Sakai10 Selenium Workshop
Selenium IDE and Extensions
Automated User Tests with Apache Flex
Steps to write Selenium
Selenium IDE and Beyond
Efficient Automated Test Creation With Selenium IDE Plugins
Selenium Ide Tutorials
Selenium
Selenium WebDriver FAQ's
Jmeter Performance Testing
Java Basics for selenium
Ad

Similar to Selenium (20)

PDF
Selenium by using JAVA
PPT
Selenium
PPTX
Selenium Testing
PPT
Selenium Basics by Quontra Solutions
PPT
BCS Selenium Workshop
PPTX
Learn SELENIUM at ASIT
PPT
Selenium By Pravin Mishra
ODP
Automated UI testing with Selenium
ODP
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
PPTX
Selenium IDE
DOC
Selenium Automation Using Ruby
PDF
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
PPTX
Automated Web Testing With Selenium
PDF
Selenium with testng and eclipse ide
PDF
Creating selenium remote control tests
PPTX
Codeception
PPT
Selenium
PPT
Tanvir Afzal: Selenium
Selenium by using JAVA
Selenium
Selenium Testing
Selenium Basics by Quontra Solutions
BCS Selenium Workshop
Learn SELENIUM at ASIT
Selenium By Pravin Mishra
Automated UI testing with Selenium
Automated UI testing. Selenium. DrupalCamp Kyiv 2011
Selenium IDE
Selenium Automation Using Ruby
Automated UI testing.Selenium.DrupalCamp Kyiv 2011
Automated Web Testing With Selenium
Selenium with testng and eclipse ide
Creating selenium remote control tests
Codeception
Selenium
Tanvir Afzal: Selenium

Recently uploaded (20)

PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Machine learning based COVID-19 study performance prediction
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Spectral efficient network and resource selection model in 5G networks
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Cloud computing and distributed systems.
PDF
CIFDAQ's Market Insight: SEC Turns Pro Crypto
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PDF
Modernizing your data center with Dell and AMD
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation theory and applications.pdf
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
NewMind AI Monthly Chronicles - July 2025
Reach Out and Touch Someone: Haptics and Empathic Computing
Machine learning based COVID-19 study performance prediction
20250228 LYD VKU AI Blended-Learning.pptx
Unlocking AI with Model Context Protocol (MCP)
Spectral efficient network and resource selection model in 5G networks
Review of recent advances in non-invasive hemoglobin estimation
Cloud computing and distributed systems.
CIFDAQ's Market Insight: SEC Turns Pro Crypto
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
Modernizing your data center with Dell and AMD
Chapter 3 Spatial Domain Image Processing.pdf
Blue Purple Modern Animated Computer Science Presentation.pdf.pdf
NewMind AI Weekly Chronicles - August'25 Week I
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation theory and applications.pdf
Per capita expenditure prediction using model stacking based on satellite ima...
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf

Selenium

  • 1. Testing With Selenium - Open source Test Automation Tool
  • 2. Agenda Selenium Origin What is Selenium? Platform and Browser compatibility Selenium IDE How to work with Selenium IDE? Selenium CORE How to work with Selenium IDE? Testing Application with IDE/CORE? Selenium-RC Way to Test Application in IE Test IE application with PHPUnit DATA-Driven QMetry- Live Example
  • 3. Selenium Origin Selenium is a chemical element in the periodic table that has the symbol Se and atomic number 34 Selenium was developed by team of Programmers and testers at ThoughtWorks to test their web based time and expenses system. Javascript Functional Test Runner was written by Jason Huggins, Paul Gross and Jie Tina Wang, in 2004.
  • 4. What is Selenium and whats it for? Selenium tests run directly in a browser, just as real users do A java Script Based Open Source Web Testing Tool That Support web 2.0 Application On Multiple Browser And multiple OS No other test tool covers such a wide array of platforms
  • 5. Contd.. Selenium is not meant for unit testing Its used for Functional or system Testing But Not for Performance Testing
  • 6. Platform and Browser compatibility Supported Platforms: Windows: Internet Explorer 6.0 Firefox 0.8 to 1.5 Mozilla Suite 1.6+, 1.7+ Seamonkey 1.0 Opera 8 Mac OS X: Safari 1.3+ Firefox 0.8 to 1.5 Camino 1.0a1 Mozilla Suite 1.6+, 1.7+ Seamonkey 1.0 Linux: Firefox 0.8 to 1.5 Mozilla Suite 1.6+, 1.7+ Konqueror
  • 7. Introduction Driven Mode. Test Case in different Language Selenium IDE CORE RC Record Mode Bot Mode: HTML tables
  • 8. Selenium IDE Selenium IDE is an integrated development environment for Selenium tests It is implemented as a Firefox extension. (Note no IE Extension Available) It allows us to record, edit, and debug tests Selenium IDE includes the entire Selenium Core, allowing you 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 You can choose to use its recording capability, or you may edit your scripts by hand
  • 9. How to Start work with Selenium IDE? Download from http://www.openqa.org/selenium-ide/download.action When you will download selenium IDE with firefox, it should automatically ask you to install the plugin. In case if we downloaded the file with Opera or IE. No problem:
  • 10. Contd.. Open firefox from the menu: Tools ->Add-ons--> Extensions now drag-n-drop the xpi file to the extensions window restart firefox You can see a 'Selenium IDE' entry from your tools menu Note: First, Always we have to record test in IDE with Fire fox, then we could playback in IE using seleniumTest runner and also for Phpunit(RC)
  • 11. IDE
  • 12. Features: Easy record and playback Debug and set breakpoints Autocomplete for all common Selenium commands Save tests as HTML, PHP scripts, or any other format Support for Selenium user-extensions.js file Option to automatically assert the title of every page
  • 13. Selenium-CORE Selenium core is a test tool for web For Web application Selenium core tests run directly In a browser Just as real users do !! Written in Pure JAVAScript And DHTML
  • 14. How to Start work with Selenium CORE? To use Selenium Core, you need to make it available from the same web server as the application you want to test Normally, this is as simple as extracting the Selenium Core zip file into the Document Root, htdocs, or webroot of your webserver. Then, try to open the TestRunner.html page on your website, which should be in the core/ directory.
  • 15.  
  • 16. Live Example Testing Google/QMetry Application with IDE and Core
  • 17. HTA Mode Selenium Core provides an additional mechanism for running automated tests called &quot;HTA mode.“ An hta file is simply an html file but the extension “. hta” means that when we navigated to IE, it will apply same strict security measure Window+Selenium core+IE To run Selenium Core in HTA mode, just double-click on TestRunner.hta, in the /core directory of your Selenium installation.
  • 18. Selenium RC Allow us to write automated web application in any programming language (Java, .NET, Perl, Python, Ruby, PHP) Selenium Remote Control provides a Selenium Server, which cans automatically start/stop/control, any supported browser The Selenium Server communicates directly with browser using AJAX Selenium Server acts as a client-configured HTTP proxy, to stand in between the browser and your website.
  • 20. How to Start Selenium Server 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 Once you've got Java installed and ready to go, you can start the Selenium Server from the command line like this: Go to /selenium directory/server/ java -jar selenium-server.jar -interactive
  • 21. Contd.. That will start the Selenium Server and allow you to type commands in the command window. After a number of log messages, you should see the following message: Entering interactive mode... type Selenium commands here (e.g: cmd=open&1=http://www.yahoo.com)  Let's begin by using Selenium Server to open up a browser. If you're on Windows and want to run your Selenium commands using Internet Explorer, try typing this: cmd=getNewBrowserSession&1=*iexplore&2=http://www.google.com
  • 22. Contd.. If all goes well, you should see a new browser window starting with the browser of your choice. Back in the Selenium Server command window, you should see the following message: Got result: OK, 260113 on session 260113
  • 23. How I Solved this Error?? When I Test Remote Site through PHPUnit then I was getting following error Error: Testing_Selenium_Exception: could not get response form RC I have started My server through following command Java –jar selenium-server.jar -proxyInjectionMode
  • 24. ProxyInjectionMode &quot;Proxy injection&quot; mode is a new highly experimental feature for 0.9.0 Normal Mode ProxyInjectionMode Mode They Keep two automated test windows 1.Selenium 2.Your Application
  • 25. ProxyInjectionMode They eliminate the separate Selenium window, in favor of &quot;injecting&quot; Selenium into every HTML page By injecting ourselves into the HTML, They have increased control over our application To use PI mode, you need to start the Selenium Server with a special command line argument, like this java -jar selenium-server.jar –proxyInjectionMode cmd=getNewBrowserSession&1=*pifirefox&2=http://www.google.com
  • 26. Test Application in IE Two way to Test Application in IE Directly click on .hta file Through PHPUnit Elevated Security Privilege The two experimental &quot;elevated security privilege&quot; browser launchers are: *iehta: Launches Internet Explorer as an HTML Application (HTA) . *chrome: Launches Firefox using a chrome URL .
  • 27. Test IE Application with PHPUnit CASE I: If Selenium Server is in Proxy InjectionMode Start server in Proxy Injection Mode Run Selenium IDE and record step with firefox Go to Options  Format  PHP-selenium RC Copy that PHP code and paste in PHPUnit Folder PHPUnit will be in C:\Program Files\xampp\php\pear\PHPUnit Make xyz.php file (you could give different Name) Open that PHP file and change following line from $this-  Selenium= new Testing_Selenium (“*firefox”, http://localhost:4444/ ); to $this-  Selenium= new Testing_Selenium(“*iexplore”, http://localhost:4444/ ); Now type command phpunit xyz.php It will open IE browser for you and Test the application
  • 28. CASE II: If Selenium Server isn’t in Proxy InjectionMode Start server in Proxy Injection Mode Run Selenium IDE and record step with firefox Go to Options  Format  PHP-selenium RC Copy that PHP code and paste in PHPUnit Folder PHPUnit will be in C:\Program Files\xampp\php\pear\PHPUnit Make xyz.php file (you could give different Name) Open that PHP file and change following line from $this-  Selenium= new Testing_Selenium (“*firefox”, http://localhost:4444/ ); to $this-  Selenium= new Testing_Selenium(“*iehta”, http://localhost:4444/ );
  • 29. DATA-Driven Code to Fetch Data from Excel Sheet //code added by Niranjan $arr=array(1=>'a','b','c','d','e'); $filename = &quot;c:\Info1.xls&quot;; $sheet1 = &quot;sheet1&quot;; $excel_app = new COM(&quot;Excel.application&quot;) or Die (&quot;Did not connect&quot;); $Workbook = $excel_app->Workbooks->Open($filename) or Die(&quot;Did not open $filename $Workbook&quot;); $Worksheet = $Workbook->Worksheets($sheet1); $Worksheet->activate; //$excel_cell = $Worksheet->Range(&quot;A1&quot;); $excel_cell->activate; for($i=1; $i<5;$i++) { for($j=1; $j<5;$j++) { $excel_cell = $Worksheet->Range($arr[$i].$j); print &quot;The value is $arr[$i].$j => \n&quot; .$excel_cell->value; } }
  • 30. QMetry- Live Example Add User into Qmetry-UPM module without Repository Add User with Repository
  • 32. www.openqa.org/selenium www.nealford.com For more Information about Selenium Use my following Blog Address http://seleniumtest.wordpress.com Thank You Niranjan Limbachiya [email_address]

Editor's Notes