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
Selenium Overview
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);
Ad

More Related Content

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
Cuelogic Technologies Pvt. Ltd.
 
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 Concepts
Selenium ConceptsSelenium Concepts
Selenium Concepts
Swati Bansal
 
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 Automation
AgileEngine
 
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
 
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 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!
 
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 Automation
AgileEngine
 
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
 

Viewers also liked (7)

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
 
Test ng for testers
Test ng for testersTest ng for testers
Test ng for testers
Colombo Selenium Meetup
 
TestNG Framework
TestNG Framework TestNG Framework
TestNG Framework
Levon Apreyan
 
testng
testngtestng
testng
harithakannan
 
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!
 
Automation - web testing with selenium
Automation - web testing with seleniumAutomation - web testing with selenium
Automation - web testing with selenium
Tzirla Rozental
 
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!
 
Ad

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
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
 
Selenium Basics and Overview topics.pptx
Selenium Basics and Overview topics.pptxSelenium Basics and Overview topics.pptx
Selenium Basics and Overview topics.pptx
sountharyaravi010
 
Selenium Basics and Overview1233444.pptx
Selenium Basics and Overview1233444.pptxSelenium Basics and Overview1233444.pptx
Selenium Basics and Overview1233444.pptx
sountharyaravi010
 
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_Selenium
Jagdish 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 jain
Prashant 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
 
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-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
 
Selenium Basics and Overview topics.pptx
Selenium Basics and Overview topics.pptxSelenium Basics and Overview topics.pptx
Selenium Basics and Overview topics.pptx
sountharyaravi010
 
Selenium Basics and Overview1233444.pptx
Selenium Basics and Overview1233444.pptxSelenium Basics and Overview1233444.pptx
Selenium Basics and Overview1233444.pptx
sountharyaravi010
 
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
 
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_Selenium
Jagdish 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 jain
Prashant Gurav
 
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
 
Ad

Recently uploaded (20)

Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Electronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploitElectronic_Mail_Attacks-1-35.pdf by xploit
Electronic_Mail_Attacks-1-35.pdf by xploit
niftliyevhuseyn
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Semantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AISemantic Cultivators : The Critical Future Role to Enable AI
Semantic Cultivators : The Critical Future Role to Enable AI
artmondano
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 

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
  • 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);