SlideShare a Scribd company logo
SELENIUM
Introduction:
Selenium is an open source tool for web application testing. Selenium
tests run directly in a browser, just like real users do. It runs in Internet Explorer,
Mozilla Firefox on Windows, Linux, and Macintosh, Safari on the Mac.
But there are certain things the automation engineer needs to be aware of before he
jumps into
understanding selenium. The automation engineer needs to have a basic knowledge of
the
following things:
1. HTML
2. XML
3. Xpaths
4. Document Object Model(DOM)
5. JavaScript (only a basic knowledge on how events are triggered etc.)
6. Any one of the following language to build a full-fledged test suite – Perl, Python,
Ruby,
Java, C#, PHP.
7. Basic object oriented programming concepts.
What is Selenium?
Acceptance Testing tool for web-apps
 Tests run directly in browser
 Selenium can be deployed on Windows, Linux, and Macintosh.
 Implemented entirely using browser technologies -
o JavaScript
o DHTML
o Frames
Selenium Types:
There are 4 types in Selenium, each for a specific purpose. They are as follows:
1. Selenium IDE
2. Selenium Remote Control
3. Selenium Core
4. Selenium Grid
Selenium IDE :
Selenium IDE is a Firefox plugin which is a record replay tool of Selenium. User can
record the
actions performed on the browser and replay it. User also has an option to write his own
scripts,
save the scripts and develop test suites using Selenium IDE.
Selenium Remote Control :
Selenium Remote Control on the other hand is used when more robust scripts are to be
developed. Using any of the languages listed previously user can build test suites which
are
robust and can run on different platforms, unlike IDE which can run scripts only on
Firefox.
Selenium Core :
Selenium Core usage is similar to Selenium RC except that the scripts which use
selenium core
can only be run on the server where the web application is deployed.
Selenium Grid :
Selenium Grid as the name suggests, is used to organize several Selenium RC's and
run the
scripts on different machines from a central location where Selenium Grid is available.
Features of Selenium IDE:
 Record and playback
 Intelligent field selection will use IDs, names, or XPath as needed
 Auto complete for all common Selenium commands
 Walk through test cases and test suites.
 Debug and set breakpoints
 Save tests as HTML, Ruby scripts, or other formats
 Support for Selenium user-extensions.js file
 Option to automatically assert the title of every page
 Rollup common commands
Selenium IDE Installation Steps:
 To install Selenium IDE just goto http://seleniumhq.org/projects/ide/ click
on download Selenium.
 It will be added to your Firefox add-on list.
Commands in Selenium:
 clicking a link - click or clickAndWait commands
 entering values - type command
 selecting options from a drop-down listbox - select command
 clicking checkboxes or radio buttons - click command
Test Runner:
Test Runner allows you to run the test case in a browser loaded with the Selenium-
Core TestRunner. Test runner is invoked by clicking the below Shown button in the
IDE.
Running Options:
 Run a Test Case: Click the Run button to run the currently displayed test case.
 Run a Test Suite: Click the Run All button to run all the test cases in the currently
loaded test suite.
 Stop and Start: The Pause button can be used to stop the test case while it is
running. The icon of this button then changes to indicate the Resume button. To
continue click Resume.
 Stop in the Middle: Set a breakpoint in the test case to cause it to stop on a
particular command. This is useful for debugging your test case. To set a
breakpoint, select a command, right-click, and from the context menu select
Toggle Breakpoint.
 Start from the Middle: We can set the IDE to begin running from a specific
command in the middle of the test case. This also is used for debugging. To set a
start point, select a command, right-click, and from the context menu select
Set/Clear Start Point.
 Run Any Single Command: Double-click any single command to run it by itself.
This is useful when writing a single command. It lets you immediately test a
command you are constructing, when you are not sure if it is correct. You can
double-click it to see if it runs correctly. This is also available from the context
menu.
Assertion Statements:
 assertTextPresent : This will assert if the text is present in the page.
 assertText: This will assert if a particular element is having the particular text.
 assertTitle: This will assert if the page is having a proper title.
 assertValue: This will assert if a Text box or check box has a particular value
 assertElementPresent: This will assert if a particular UI Element is present in the
page.
Explain Selenium WaitForCommands ?
 waitForPageToLoad : This command will make the script to wait till the page
loads.Syntax is waitForPageToLoad(timeout); Time out is the maximum time the
script will wait for the page to load.
 waitForAlert : This command will wait for the alert message to appear
 waitForTable: This command will wait for the Web table to completely load in the
page
 waitForTitle: This command will for the page Title to appear on the browser.
 Other waitForcommands : Selenium has several other wait command
like waitForText,waitForPopup and so on. These commands are generically
called Synchronization commands
Advantages:
 Supports C#, Java, PHP, Perl, Phython
 Supported on Windows, Linux and Mac OS
 Highly active developer community - backed by Google
 Powerful methods to locate elements (Xpath, CSS, DOM)
Disadvantages
 Challenges running on browsers other than Firefox
 Difficulty to automate AJAX
 Limitations to automate Applets, MS and Desktop Applications

More Related Content

What's hot

Selenium IDE
Selenium IDESelenium IDE
Selenium IDE
b4usolution .
 
Selenium
SeleniumSelenium
Selenium
nil65
 
Test automation using selenium presented by Quontra Solutions
Test automation using selenium presented by Quontra SolutionsTest automation using selenium presented by Quontra Solutions
Test automation using selenium presented by Quontra Solutions
QUONTRASOLUTIONS
 
Selenium IDE
Selenium IDESelenium IDE
Selenium IDE
brendon_jag
 
Selenium Ide Tutorials
Selenium Ide TutorialsSelenium Ide Tutorials
Selenium Ide Tutorials
gueste1e4db
 
Sel
SelSel
Selenium IDE and Extensions
Selenium IDE and ExtensionsSelenium IDE and Extensions
Selenium IDE and Extensions
Yana Altunyan
 
First steps with selenium rc
First steps with selenium rcFirst steps with selenium rc
First steps with selenium rc
Dang Nguyen
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
mindqqa
 
Selenium Primer
Selenium PrimerSelenium Primer
Selenium Primer
gueste1e4db
 
Selenium Test Automation - Challenges
Selenium Test Automation - ChallengesSelenium Test Automation - Challenges
Selenium Test Automation - Challenges
Arul Selvan
 
Selenium
SeleniumSelenium
Selenium
shrialinda
 
Learn Test Automation using Selenium - Lesson 1
Learn Test Automation using Selenium - Lesson 1Learn Test Automation using Selenium - Lesson 1
Learn Test Automation using Selenium - Lesson 1
Furqan Ud Din
 
Automating with selenium2
Automating with selenium2Automating with selenium2
Automating with selenium2
mindqqa
 
Selenium
SeleniumSelenium
Selenium
BugRaptors
 
Learn SELENIUM at ASIT
Learn SELENIUM at ASITLearn SELENIUM at ASIT
Learn SELENIUM at ASIT
ASIT
 
Selenium Tutorial
Selenium TutorialSelenium Tutorial
Selenium Tutorial
prad_123
 
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
Agile Testing Alliance
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
Kerry Buckley
 
Selenium Installation
Selenium  InstallationSelenium  Installation
Selenium Installation
ANKUR-BA
 

What's hot (20)

Selenium IDE
Selenium IDESelenium IDE
Selenium IDE
 
Selenium
SeleniumSelenium
Selenium
 
Test automation using selenium presented by Quontra Solutions
Test automation using selenium presented by Quontra SolutionsTest automation using selenium presented by Quontra Solutions
Test automation using selenium presented by Quontra Solutions
 
Selenium IDE
Selenium IDESelenium IDE
Selenium IDE
 
Selenium Ide Tutorials
Selenium Ide TutorialsSelenium Ide Tutorials
Selenium Ide Tutorials
 
Sel
SelSel
Sel
 
Selenium IDE and Extensions
Selenium IDE and ExtensionsSelenium IDE and Extensions
Selenium IDE and Extensions
 
First steps with selenium rc
First steps with selenium rcFirst steps with selenium rc
First steps with selenium rc
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Selenium Primer
Selenium PrimerSelenium Primer
Selenium Primer
 
Selenium Test Automation - Challenges
Selenium Test Automation - ChallengesSelenium Test Automation - Challenges
Selenium Test Automation - Challenges
 
Selenium
SeleniumSelenium
Selenium
 
Learn Test Automation using Selenium - Lesson 1
Learn Test Automation using Selenium - Lesson 1Learn Test Automation using Selenium - Lesson 1
Learn Test Automation using Selenium - Lesson 1
 
Automating with selenium2
Automating with selenium2Automating with selenium2
Automating with selenium2
 
Selenium
SeleniumSelenium
Selenium
 
Learn SELENIUM at ASIT
Learn SELENIUM at ASITLearn SELENIUM at ASIT
Learn SELENIUM at ASIT
 
Selenium Tutorial
Selenium TutorialSelenium Tutorial
Selenium Tutorial
 
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
#ATAGTR2021 Presentation - "Selenium 4 Observability – a 90 Min Hands on Lab"
 
Web application testing with Selenium
Web application testing with SeleniumWeb application testing with Selenium
Web application testing with Selenium
 
Selenium Installation
Selenium  InstallationSelenium  Installation
Selenium Installation
 

Similar to Selenium introduction and some feautures

What is selenium
What is seleniumWhat is selenium
What is selenium
Pesara Swamy
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
Aneesh Rangarajan
 
Selenium
SeleniumSelenium
Selenium
Kalyan ch
 
Selenium by using JAVA
Selenium by using JAVASelenium by using JAVA
Selenium by using JAVA
mahirayavarapu
 
Selenium Testing
Selenium Testing Selenium Testing
Selenium Testing
Shreshtt Bhatt
 
Selenium tutorial
Selenium tutorialSelenium tutorial
Selenium tutorial
Mayank Pande
 
Selenium
SeleniumSelenium
Selenium
conect2krish
 
Selenium training
Selenium trainingSelenium training
Selenium training
Robin0590
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
jayeshvaghelaqa
 
Selenium Basics by Quontra Solutions
Selenium Basics by Quontra SolutionsSelenium Basics by Quontra Solutions
Selenium Basics by Quontra Solutions
QUONTRASOLUTIONS
 
Selenium
SeleniumSelenium
Selenium with testng and eclipse ide
Selenium with testng and eclipse ideSelenium with testng and eclipse ide
Selenium with testng and eclipse ide
Testertester Jaipur
 
Selenium
SeleniumSelenium
Steps to write Selenium
Steps to write Selenium  Steps to write Selenium
Steps to write Selenium
Rohit Thakur
 
Selenium (1) (1)
Selenium (1) (1)Selenium (1) (1)
Selenium (1) (1)
Vishwan Aranha
 
Selenium
SeleniumSelenium
Selenium
Batch2016
 
Selenium
SeleniumSelenium
Selenium
SeleniumSelenium
Selenium
Batch2016
 
Selenium
SeleniumSelenium
Selenium
Ivan Aranha
 
Selenium
SeleniumSelenium
Selenium
Batch2016
 

Similar to Selenium introduction and some feautures (20)

What is selenium
What is seleniumWhat is selenium
What is selenium
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Selenium
SeleniumSelenium
Selenium
 
Selenium by using JAVA
Selenium by using JAVASelenium by using JAVA
Selenium by using JAVA
 
Selenium Testing
Selenium Testing Selenium Testing
Selenium Testing
 
Selenium tutorial
Selenium tutorialSelenium tutorial
Selenium tutorial
 
Selenium
SeleniumSelenium
Selenium
 
Selenium training
Selenium trainingSelenium training
Selenium training
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Selenium Basics by Quontra Solutions
Selenium Basics by Quontra SolutionsSelenium Basics by Quontra Solutions
Selenium Basics by Quontra Solutions
 
Selenium
SeleniumSelenium
Selenium
 
Selenium with testng and eclipse ide
Selenium with testng and eclipse ideSelenium with testng and eclipse ide
Selenium with testng and eclipse ide
 
Selenium
SeleniumSelenium
Selenium
 
Steps to write Selenium
Steps to write Selenium  Steps to write Selenium
Steps to write Selenium
 
Selenium (1) (1)
Selenium (1) (1)Selenium (1) (1)
Selenium (1) (1)
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 

Recently uploaded

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
Claudio Di Ciccio
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
James Anderson
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
TIPNGVN2
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
Matthew Sinclair
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
Rohit Gautam
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
DianaGray10
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
Quotidiano Piemontese
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
Edge AI and Vision Alliance
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
Zilliz
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Zilliz
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
Matthew Sinclair
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Malak Abu Hammad
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Albert Hoitingh
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
Neo4j
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
Neo4j
 

Recently uploaded (20)

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”“I’m still / I’m still / Chaining from the Block”
“I’m still / I’m still / Chaining from the Block”
 
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
Alt. GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using ...
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 
Data structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdfData structures and Algorithms in Python.pdf
Data structures and Algorithms in Python.pdf
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
20240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 202420240607 QFM018 Elixir Reading List May 2024
20240607 QFM018 Elixir Reading List May 2024
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
Large Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial ApplicationsLarge Language Model (LLM) and it’s Geospatial Applications
Large Language Model (LLM) and it’s Geospatial Applications
 
Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1Communications Mining Series - Zero to Hero - Session 1
Communications Mining Series - Zero to Hero - Session 1
 
National Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practicesNational Security Agency - NSA mobile device best practices
National Security Agency - NSA mobile device best practices
 
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
“Building and Scaling AI Applications with the Nx AI Manager,” a Presentation...
 
Full-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalizationFull-RAG: A modern architecture for hyper-personalization
Full-RAG: A modern architecture for hyper-personalization
 
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
Introducing Milvus Lite: Easy-to-Install, Easy-to-Use vector database for you...
 
20240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 202420240605 QFM017 Machine Intelligence Reading List May 2024
20240605 QFM017 Machine Intelligence Reading List May 2024
 
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdfUnlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
Unlock the Future of Search with MongoDB Atlas_ Vector Search Unleashed.pdf
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
Encryption in Microsoft 365 - ExpertsLive Netherlands 2024
 
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
GraphSummit Singapore | Graphing Success: Revolutionising Organisational Stru...
 
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
GraphSummit Singapore | Neo4j Product Vision & Roadmap - Q2 2024
 

Selenium introduction and some feautures

  • 1. SELENIUM Introduction: Selenium is an open source tool for web application testing. Selenium tests run directly in a browser, just like real users do. It runs in Internet Explorer, Mozilla Firefox on Windows, Linux, and Macintosh, Safari on the Mac. But there are certain things the automation engineer needs to be aware of before he jumps into understanding selenium. The automation engineer needs to have a basic knowledge of the following things: 1. HTML 2. XML 3. Xpaths 4. Document Object Model(DOM) 5. JavaScript (only a basic knowledge on how events are triggered etc.) 6. Any one of the following language to build a full-fledged test suite – Perl, Python, Ruby, Java, C#, PHP. 7. Basic object oriented programming concepts. What is Selenium? Acceptance Testing tool for web-apps  Tests run directly in browser  Selenium can be deployed on Windows, Linux, and Macintosh.  Implemented entirely using browser technologies - o JavaScript o DHTML o Frames Selenium Types: There are 4 types in Selenium, each for a specific purpose. They are as follows: 1. Selenium IDE 2. Selenium Remote Control 3. Selenium Core 4. Selenium Grid Selenium IDE : Selenium IDE is a Firefox plugin which is a record replay tool of Selenium. User can record the
  • 2. actions performed on the browser and replay it. User also has an option to write his own scripts, save the scripts and develop test suites using Selenium IDE. Selenium Remote Control : Selenium Remote Control on the other hand is used when more robust scripts are to be developed. Using any of the languages listed previously user can build test suites which are robust and can run on different platforms, unlike IDE which can run scripts only on Firefox. Selenium Core : Selenium Core usage is similar to Selenium RC except that the scripts which use selenium core can only be run on the server where the web application is deployed. Selenium Grid : Selenium Grid as the name suggests, is used to organize several Selenium RC's and run the scripts on different machines from a central location where Selenium Grid is available. Features of Selenium IDE:  Record and playback  Intelligent field selection will use IDs, names, or XPath as needed  Auto complete for all common Selenium commands  Walk through test cases and test suites.  Debug and set breakpoints  Save tests as HTML, Ruby scripts, or other formats  Support for Selenium user-extensions.js file  Option to automatically assert the title of every page  Rollup common commands Selenium IDE Installation Steps:  To install Selenium IDE just goto http://seleniumhq.org/projects/ide/ click on download Selenium.  It will be added to your Firefox add-on list. Commands in Selenium:  clicking a link - click or clickAndWait commands  entering values - type command  selecting options from a drop-down listbox - select command  clicking checkboxes or radio buttons - click command
  • 3. Test Runner: Test Runner allows you to run the test case in a browser loaded with the Selenium- Core TestRunner. Test runner is invoked by clicking the below Shown button in the IDE. Running Options:  Run a Test Case: Click the Run button to run the currently displayed test case.  Run a Test Suite: Click the Run All button to run all the test cases in the currently loaded test suite.  Stop and Start: The Pause button can be used to stop the test case while it is running. The icon of this button then changes to indicate the Resume button. To continue click Resume.  Stop in the Middle: Set a breakpoint in the test case to cause it to stop on a particular command. This is useful for debugging your test case. To set a breakpoint, select a command, right-click, and from the context menu select Toggle Breakpoint.  Start from the Middle: We can set the IDE to begin running from a specific command in the middle of the test case. This also is used for debugging. To set a start point, select a command, right-click, and from the context menu select Set/Clear Start Point.  Run Any Single Command: Double-click any single command to run it by itself. This is useful when writing a single command. It lets you immediately test a command you are constructing, when you are not sure if it is correct. You can double-click it to see if it runs correctly. This is also available from the context menu. Assertion Statements:  assertTextPresent : This will assert if the text is present in the page.  assertText: This will assert if a particular element is having the particular text.  assertTitle: This will assert if the page is having a proper title.  assertValue: This will assert if a Text box or check box has a particular value  assertElementPresent: This will assert if a particular UI Element is present in the page.
  • 4. Explain Selenium WaitForCommands ?  waitForPageToLoad : This command will make the script to wait till the page loads.Syntax is waitForPageToLoad(timeout); Time out is the maximum time the script will wait for the page to load.  waitForAlert : This command will wait for the alert message to appear  waitForTable: This command will wait for the Web table to completely load in the page  waitForTitle: This command will for the page Title to appear on the browser.  Other waitForcommands : Selenium has several other wait command like waitForText,waitForPopup and so on. These commands are generically called Synchronization commands Advantages:  Supports C#, Java, PHP, Perl, Phython  Supported on Windows, Linux and Mac OS  Highly active developer community - backed by Google  Powerful methods to locate elements (Xpath, CSS, DOM) Disadvantages  Challenges running on browsers other than Firefox  Difficulty to automate AJAX  Limitations to automate Applets, MS and Desktop Applications