SlideShare a Scribd company logo
SELENIUM
Test Automation and much more!
TESTAUTOMATIONTODAY
Web UI Test Automation
Selenium, Watir, PhantomJS, CasperJS, Sahi, QTP, SauceLabs
Native Desktop UI Automation
AutoIt, Sikuli, QTP, TestComplete
Mobile App Test Automation
MonkeyTalk, Calabash, Selendroid, Appium, EggPlant
Performance Test Automation
JMeter, Load Runner, NeoLoad, HttPerf
SAYHELLOTOSELENIUM!
Who am I?
A set of open source tools to interact with browser application in an automated way.
What are my tools?
Selenium IDE, Selenium 1 (RC), Selenium 2 (WebDriver)
Who are my creators?
Selenium 1 - Jason Huggins, Selenium 2 - Simon Stewart
SELENIUMROCKS!SAYHOW?
Limitless possibilities of using Selenium
Possible interesting uses:
Test Automation, ofcourse!
Web data scraping
Performing CRUDs on a webpage repetitively (Bulk data
creation from the UI)
As a content downloader!
Automated reply to Facebook posts?
HOWWASSELENIUMEARLIER??
Called as Selenium RC (Remote Control), had a server which
launches, stops and interacts with the browser.
Selenium Commands from code -> RC Server -> Javascript
commands to browser
Client libraries used HTTP GET / POST to interact with the
selenium server
Selenium Server used Selenium Core which was a set of JS
programs that were injected into the browser for executing the
commands sent.
Client libraries were in Python, Ruby, Java, .NET, PHP, Perl
SELENIUMRCARCHITECTURE
WHYEVERYBODYMOVINGTO
SELENIUM2???
Problems with Selenium RC
Explicitly start the server
No good organized API
Used Javascript Injection
Slower execution
No new enhancements. Deprecation!!
Same origin policy problem
WEBDRIVER
Binds natively to the browser. No Javascript injection in browser's JS Sandbox
Better object oriented API
Bindings for Java, Python, C#, Ruby, Perl, Php, JS
Significantly fewer calls than Selenium RC
Variants: ChromeDriver, FireFoxDriver, InternetExplorerDriver, OperaDriver, AndroidDriver,
IPhoneDriver, HtmlUnitDriver
Overcomes same origin policy problem
Self-contained library. No server to start explicitly.
WEBDRIVERARCHITECTURE
LEARNINGTHESEWILLMAKEUSING
SELENIUMEASIER!
HTML, CSS and Javascript from
andCodeacademy HTMLDog
THEDOM!!
Cross-platform, language-independent convention for representing and interacting with
objects in HTML, XHTML and XML documents.
HTML is structured according to DOM and DOM of the webpage is accessed by Selenium
THEC#SELENIUMNAMESPACE
DRIVINGTHEDRIVER
Interface - IWebDriver; Implements - ISearchContext, IDisposable
Functionality - Controls the browser, Finds elements, Helps in debugging
Usage - Creating instance of a flavor of webdriver class that implements this interface
Commonly used methods - FindElement, FindElements, Manage, Navigate, Quit, Close
Commonly used properties - Title, URL
WEBELEMENT
Interface - IWebElement; Implements - ISearchContext
Functionality - Provides methods to identify and interact with DOM
elements on web page. Instance of it represents a HTML element.
Usage: Created using FindElement / FindElements method on driver
instance or another webelement object.
Commonly used methods: Click, SendKeys, Clear, Submit,
GetAttribute, GetCssValue
Commonly used properties: Displayed, Text, Enabled, Selected,
TagName
ELEMENTLOCATING
Use By class to locate elements
By class provides following static member methods:
CssSelector
ClassName
Id
XPath
TagName
LinkText
PartialLinkText
Name
Subclass the By class to build your own locating mechanism. Eg: ByIdOrName
LOCATINGBYID
Id is the King!
W3C standards state Ids should be unique.
Independent from the type of element.
Developers usually give ids to elements which contain dynamic
elements. Benefit!
If your developer doesn't add ids, convince him to do so!
LOCATINGBYCSS/XPATHSELECTORS
css prefered over xpath.
xpath engines different for different browsers.
xpath tend to become complex and difficult to read.
xpath useful when you want to fetch parent element or
find element by text.
USEFULLINKSFORXPATHANDCSS
SELECTORS
Xpath to Css Cheat Sheet
Elemental Selenium Blog on performance benchmarks for
CSS and XPATH selectors
A stackoverflow post
"A good way to start a CSS or Xpath locator is to start with an
element that you know is not likely to change much and use it
as an ‘anchor’ in your locator. It may have an ID or stable location
but not be the element you need to locate but is a reliable position to
search from. Your anchoring element can be above or below the
current element in the HTML tree, but most often it’s above."
How do I find the <li> ??
INDEXANDDESCENDANTLOCATORS
Index locators
nth-child(), nth-of-type()
Use when finding element in a list, by index
Nth-child example: p:nth-child(2)
Nth-of-type: p:nth-of-type(2)
Descendant Locators
Use when finding direct child elements of parent
CSS example: div > div > ul > li > span
Xpath example: //div/div/ul/li/span
COMPONENTOBJECTPATTERN
Create a single class for interacting with a widget/complex
control present frequently on different pages of the website
YOUNEEDTOWAITFORMR.AJAX!
AJAX (Asynchronous Javascript & XML)
Dynamic content rendered and updated with the help of
AJAX and Javascript
This calls for the need to test dynamic UI which has time
uncertainty
WebDriver handles this using Implict and Explict waiting mechanism
Link: WebDriver Wait Commands
COMMONEXCEPTIONS
ElementNotVisibleException : Use Javascript to make element visible
IllegalLocatorException: when By.className() is used with a compound class name.
NoSuchElementException: Use waits OR verify your locator
StaleElementReferenceException: Happens if a DOM operation happening on the page is
temporarily causing the element to be inaccessible.
public boolean retryFindClick(By by) {
boolean result = false;
int attempts = 0;
while(attempts < 2) {
try {
driver.findElement(by).click();
result = true;
break;
} catch(StaleElementException e) {
}
attempts++;
}
return result;
IJAVASCRIPTEXECUTOR
Used to execute javascript on webpage.
Can be used for finding elements
Performing actions like click or selecting control
Syntax:
IJavaScriptExecutor jsExec = (IJavaScriptExecutor)_driver;
_searchTextField = (IWebElement)jsExec.ExecuteScript("return document.getElementBy
_searchTextField.SendKeys(searchString);

More Related Content

What's hot

Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
Pankaj Biswas
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala Project
Knoldus Inc.
 
Mobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason HugginsMobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason Huggins
Sauce Labs
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriver
Anuraj S.L
 
Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
P.V.G'S COET, PUNE - 09
 
Selenium WebDriver FAQ's
Selenium WebDriver FAQ'sSelenium WebDriver FAQ's
Selenium WebDriver FAQ's
Praveen Gorantla
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
Cynoteck Technology Solutions Private Limited
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using Java
F K
 
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Edureka!
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
Return on Intelligence
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.ppt
Ana Sarbescu
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics Tutorial
Clever Moe
 
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Codemotion
 
UI Testing Automation
UI Testing AutomationUI Testing Automation
UI Testing AutomationAgileEngine
 
Automated Smoke Tests with Protractor
Automated Smoke Tests with ProtractorAutomated Smoke Tests with Protractor
Automated Smoke Tests with Protractor
🌱 Dale Spoonemore
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
Seth McLaughlin
 
UI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected JourneyUI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected Journey
Oren Farhi
 
Selenium - The page object pattern
Selenium - The page object patternSelenium - The page object pattern
Selenium - The page object pattern
Michael Palotas
 

What's hot (20)

Automation Testing by Selenium Web Driver
Automation Testing by Selenium Web DriverAutomation Testing by Selenium Web Driver
Automation Testing by Selenium Web Driver
 
Automation Testing using Selenium Webdriver
Automation Testing using Selenium WebdriverAutomation Testing using Selenium Webdriver
Automation Testing using Selenium Webdriver
 
Integrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala ProjectIntegrating Selenium testing infrastructure into Scala Project
Integrating Selenium testing infrastructure into Scala Project
 
Mobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason HugginsMobile Testing with Selenium 2 by Jason Huggins
Mobile Testing with Selenium 2 by Jason Huggins
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriver
 
Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
 
Selenium WebDriver FAQ's
Selenium WebDriver FAQ'sSelenium WebDriver FAQ's
Selenium WebDriver FAQ's
 
Test automation using selenium
Test automation using seleniumTest automation using selenium
Test automation using selenium
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using Java
 
Selenium Concepts
Selenium ConceptsSelenium Concepts
Selenium Concepts
 
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
Selenium WebDriver Tutorial For Beginners | What Is Selenium WebDriver | Sele...
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
Web automation using selenium.ppt
Web automation using selenium.pptWeb automation using selenium.ppt
Web automation using selenium.ppt
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics Tutorial
 
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
Carmen Popoviciu - Protractor styleguide | Codemotion Milan 2015
 
UI Testing Automation
UI Testing AutomationUI Testing Automation
UI Testing Automation
 
Automated Smoke Tests with Protractor
Automated Smoke Tests with ProtractorAutomated Smoke Tests with Protractor
Automated Smoke Tests with Protractor
 
Join the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.jsJoin the darkside: Selenium testing with Nightwatch.js
Join the darkside: Selenium testing with Nightwatch.js
 
UI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected JourneyUI Testing Best Practices - An Expected Journey
UI Testing Best Practices - An Expected Journey
 
Selenium - The page object pattern
Selenium - The page object patternSelenium - The page object pattern
Selenium - The page object pattern
 

Viewers also liked

Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
Tzirla Rozental
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
Abhijeet Vaikar
 
TestNG Framework
TestNG Framework TestNG Framework
TestNG Framework
Levon Apreyan
 
testng
testngtestng
Selenium Tips & Tricks
Selenium Tips & TricksSelenium Tips & Tricks
Selenium Tips & Tricks
Dave Haeffner
 
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Edureka!
 

Viewers also liked (7)

Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
 
Mongo DB 102
Mongo DB 102Mongo DB 102
Mongo DB 102
 
Test ng for testers
Test ng for testersTest ng for testers
Test ng for testers
 
TestNG Framework
TestNG Framework TestNG Framework
TestNG Framework
 
testng
testngtestng
testng
 
Selenium Tips & Tricks
Selenium Tips & TricksSelenium Tips & Tricks
Selenium Tips & Tricks
 
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
Selenium Tutorial For Beginners | What Is Selenium? | Selenium Automation Tes...
 

Similar to Selenium Overview

Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsAutomation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra Solutions
Quontra Solutions
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
SpringPeople
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
Sun Technlogies
 
selenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfselenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdf
AnuragMourya8
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And Answers
Ajit Jadhav
 
Escape from the automation hell
Escape from the automation hellEscape from the automation hell
Escape from the automation hell
Nikita Simonovets
 
Introduction to Selenium and Test Automation
Introduction to Selenium and Test AutomationIntroduction to Selenium and Test Automation
Introduction to Selenium and Test Automation
Ahmed Mubbashir Khan
 
Selenium Webdriver Interview Questions
Selenium Webdriver Interview QuestionsSelenium Webdriver Interview Questions
Selenium Webdriver Interview Questions
Jai Singh
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
orbitprojects
 
How to use selenium locators effectively for web automation.pdf
How to use selenium locators effectively for web automation.pdfHow to use selenium locators effectively for web automation.pdf
How to use selenium locators effectively for web automation.pdf
pcloudy2
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
Agile Testing Alliance
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Puneet Kala
 
Selenium interview-questions-freshers
Selenium interview-questions-freshersSelenium interview-questions-freshers
Selenium interview-questions-freshers
Naga Mani
 
Automated_Testing_Selenium
Automated_Testing_SeleniumAutomated_Testing_Selenium
Automated_Testing_SeleniumJagdish Kaushal
 
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Atirek Gupta
 
Automatedtestingwithselenium shubham jain
Automatedtestingwithselenium shubham jainAutomatedtestingwithselenium shubham jain
Automatedtestingwithselenium shubham jainPrashant Gurav
 
Selenium WebDriver training
Selenium WebDriver trainingSelenium WebDriver training
Selenium WebDriver training
Vijay Krishnan Ramaswamy
 
Selenium locators: ID, Name, xpath, CSS Selector advance methods
Selenium locators: ID, Name,  xpath, CSS Selector advance methodsSelenium locators: ID, Name,  xpath, CSS Selector advance methods
Selenium locators: ID, Name, xpath, CSS Selector advance methods
Pankaj Dubey
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Ondřej Machulda
 
Top 15 Selenium WebDriver Interview Questions and Answers.pdf
Top 15 Selenium WebDriver Interview Questions and Answers.pdfTop 15 Selenium WebDriver Interview Questions and Answers.pdf
Top 15 Selenium WebDriver Interview Questions and Answers.pdf
AnanthReddy38
 

Similar to Selenium Overview (20)

Automation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra SolutionsAutomation with Selenium Presented by Quontra Solutions
Automation with Selenium Presented by Quontra Solutions
 
Mastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium SuccessfullyMastering Test Automation: How To Use Selenium Successfully
Mastering Test Automation: How To Use Selenium Successfully
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
selenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfselenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdf
 
Selenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And AnswersSelenium Automation Testing Interview Questions And Answers
Selenium Automation Testing Interview Questions And Answers
 
Escape from the automation hell
Escape from the automation hellEscape from the automation hell
Escape from the automation hell
 
Introduction to Selenium and Test Automation
Introduction to Selenium and Test AutomationIntroduction to Selenium and Test Automation
Introduction to Selenium and Test Automation
 
Selenium Webdriver Interview Questions
Selenium Webdriver Interview QuestionsSelenium Webdriver Interview Questions
Selenium Webdriver Interview Questions
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
How to use selenium locators effectively for web automation.pdf
How to use selenium locators effectively for web automation.pdfHow to use selenium locators effectively for web automation.pdf
How to use selenium locators effectively for web automation.pdf
 
Session on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh GundechaSession on Selenium Powertools by Unmesh Gundecha
Session on Selenium Powertools by Unmesh Gundecha
 
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
Selenium-Webdriver With PHPUnit Automation test for Joomla CMS!
 
Selenium interview-questions-freshers
Selenium interview-questions-freshersSelenium interview-questions-freshers
Selenium interview-questions-freshers
 
Automated_Testing_Selenium
Automated_Testing_SeleniumAutomated_Testing_Selenium
Automated_Testing_Selenium
 
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
Understanding Selenium/RC, Webdriver Architecture and developing the page obj...
 
Automatedtestingwithselenium shubham jain
Automatedtestingwithselenium shubham jainAutomatedtestingwithselenium shubham jain
Automatedtestingwithselenium shubham jain
 
Selenium WebDriver training
Selenium WebDriver trainingSelenium WebDriver training
Selenium WebDriver training
 
Selenium locators: ID, Name, xpath, CSS Selector advance methods
Selenium locators: ID, Name,  xpath, CSS Selector advance methodsSelenium locators: ID, Name,  xpath, CSS Selector advance methods
Selenium locators: ID, Name, xpath, CSS Selector advance methods
 
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
Selenium & PHPUnit made easy with Steward (Berlin, April 2017)
 
Top 15 Selenium WebDriver Interview Questions and Answers.pdf
Top 15 Selenium WebDriver Interview Questions and Answers.pdfTop 15 Selenium WebDriver Interview Questions and Answers.pdf
Top 15 Selenium WebDriver Interview Questions and Answers.pdf
 

Recently uploaded

RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
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
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
Pierluigi Pugliese
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
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
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
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
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
Alpen-Adria-Universität
 
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
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
Kari Kakkonen
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
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
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
James Anderson
 

Recently uploaded (20)

RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
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
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024By Design, not by Accident - Agile Venture Bolzano 2024
By Design, not by Accident - Agile Venture Bolzano 2024
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
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
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
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...
 
Video Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the FutureVideo Streaming: Then, Now, and in the Future
Video Streaming: Then, Now, and in the Future
 
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
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
DevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA ConnectDevOps and Testing slides at DASA Connect
DevOps and Testing slides at DASA Connect
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 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...
 
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
GDG Cloud Southlake #33: Boule & Rebala: Effective AppSec in SDLC using Deplo...
 

Selenium Overview

  • 2. TESTAUTOMATIONTODAY Web UI Test Automation Selenium, Watir, PhantomJS, CasperJS, Sahi, QTP, SauceLabs Native Desktop UI Automation AutoIt, Sikuli, QTP, TestComplete Mobile App Test Automation MonkeyTalk, Calabash, Selendroid, Appium, EggPlant Performance Test Automation JMeter, Load Runner, NeoLoad, HttPerf
  • 3. SAYHELLOTOSELENIUM! Who am I? A set of open source tools to interact with browser application in an automated way. What are my tools? Selenium IDE, Selenium 1 (RC), Selenium 2 (WebDriver) Who are my creators? Selenium 1 - Jason Huggins, Selenium 2 - Simon Stewart
  • 4. SELENIUMROCKS!SAYHOW? Limitless possibilities of using Selenium Possible interesting uses: Test Automation, ofcourse! Web data scraping Performing CRUDs on a webpage repetitively (Bulk data creation from the UI) As a content downloader! Automated reply to Facebook posts?
  • 5. HOWWASSELENIUMEARLIER?? Called as Selenium RC (Remote Control), had a server which launches, stops and interacts with the browser. Selenium Commands from code -> RC Server -> Javascript commands to browser Client libraries used HTTP GET / POST to interact with the selenium server Selenium Server used Selenium Core which was a set of JS programs that were injected into the browser for executing the commands sent. Client libraries were in Python, Ruby, Java, .NET, PHP, Perl
  • 7. WHYEVERYBODYMOVINGTO SELENIUM2??? Problems with Selenium RC Explicitly start the server No good organized API Used Javascript Injection Slower execution No new enhancements. Deprecation!! Same origin policy problem
  • 8. WEBDRIVER Binds natively to the browser. No Javascript injection in browser's JS Sandbox Better object oriented API Bindings for Java, Python, C#, Ruby, Perl, Php, JS Significantly fewer calls than Selenium RC Variants: ChromeDriver, FireFoxDriver, InternetExplorerDriver, OperaDriver, AndroidDriver, IPhoneDriver, HtmlUnitDriver Overcomes same origin policy problem Self-contained library. No server to start explicitly.
  • 10. LEARNINGTHESEWILLMAKEUSING SELENIUMEASIER! HTML, CSS and Javascript from andCodeacademy HTMLDog
  • 11. THEDOM!! Cross-platform, language-independent convention for representing and interacting with objects in HTML, XHTML and XML documents. HTML is structured according to DOM and DOM of the webpage is accessed by Selenium
  • 13. DRIVINGTHEDRIVER Interface - IWebDriver; Implements - ISearchContext, IDisposable Functionality - Controls the browser, Finds elements, Helps in debugging Usage - Creating instance of a flavor of webdriver class that implements this interface Commonly used methods - FindElement, FindElements, Manage, Navigate, Quit, Close Commonly used properties - Title, URL
  • 14. WEBELEMENT Interface - IWebElement; Implements - ISearchContext Functionality - Provides methods to identify and interact with DOM elements on web page. Instance of it represents a HTML element. Usage: Created using FindElement / FindElements method on driver instance or another webelement object. Commonly used methods: Click, SendKeys, Clear, Submit, GetAttribute, GetCssValue Commonly used properties: Displayed, Text, Enabled, Selected, TagName
  • 15.
  • 16. ELEMENTLOCATING Use By class to locate elements By class provides following static member methods: CssSelector ClassName Id XPath TagName LinkText PartialLinkText Name Subclass the By class to build your own locating mechanism. Eg: ByIdOrName
  • 17. LOCATINGBYID Id is the King! W3C standards state Ids should be unique. Independent from the type of element. Developers usually give ids to elements which contain dynamic elements. Benefit! If your developer doesn't add ids, convince him to do so!
  • 18. LOCATINGBYCSS/XPATHSELECTORS css prefered over xpath. xpath engines different for different browsers. xpath tend to become complex and difficult to read. xpath useful when you want to fetch parent element or find element by text.
  • 19. USEFULLINKSFORXPATHANDCSS SELECTORS Xpath to Css Cheat Sheet Elemental Selenium Blog on performance benchmarks for CSS and XPATH selectors A stackoverflow post
  • 20. "A good way to start a CSS or Xpath locator is to start with an element that you know is not likely to change much and use it as an ‘anchor’ in your locator. It may have an ID or stable location but not be the element you need to locate but is a reliable position to search from. Your anchoring element can be above or below the current element in the HTML tree, but most often it’s above." How do I find the <li> ??
  • 21. INDEXANDDESCENDANTLOCATORS Index locators nth-child(), nth-of-type() Use when finding element in a list, by index Nth-child example: p:nth-child(2) Nth-of-type: p:nth-of-type(2) Descendant Locators Use when finding direct child elements of parent CSS example: div > div > ul > li > span Xpath example: //div/div/ul/li/span
  • 22. COMPONENTOBJECTPATTERN Create a single class for interacting with a widget/complex control present frequently on different pages of the website
  • 23. YOUNEEDTOWAITFORMR.AJAX! AJAX (Asynchronous Javascript & XML) Dynamic content rendered and updated with the help of AJAX and Javascript This calls for the need to test dynamic UI which has time uncertainty WebDriver handles this using Implict and Explict waiting mechanism Link: WebDriver Wait Commands
  • 24. COMMONEXCEPTIONS ElementNotVisibleException : Use Javascript to make element visible IllegalLocatorException: when By.className() is used with a compound class name. NoSuchElementException: Use waits OR verify your locator StaleElementReferenceException: Happens if a DOM operation happening on the page is temporarily causing the element to be inaccessible. public boolean retryFindClick(By by) { boolean result = false; int attempts = 0; while(attempts < 2) { try { driver.findElement(by).click(); result = true; break; } catch(StaleElementException e) { } attempts++; } return result;
  • 25. IJAVASCRIPTEXECUTOR Used to execute javascript on webpage. Can be used for finding elements Performing actions like click or selecting control Syntax: IJavaScriptExecutor jsExec = (IJavaScriptExecutor)_driver; _searchTextField = (IWebElement)jsExec.ExecuteScript("return document.getElementBy _searchTextField.SendKeys(searchString);