SlideShare a Scribd company logo
1 of 22
Selenium WorkshopSelenium Workshop
By Atirek GuptaBy Atirek Gupta
Out of scopeOut of scope
 When and why to do functional test automation.
 Test specification.
 Test data management.
 Detailed architecture of Browser.
 Going deeper into Java Script
 Build tools, CI and VCS
AgendaAgenda
 Origin of Selenium
 Understanding same origin policy
 Interacting with HTML using JavaScript
 How Selenium-RC and WebDriver works
 Locators
 More about Selenium and WebDriver
 Overview of how browser works
 Exploring WebDriver API’s with examples
 Building test automation framework using Java and WebDriver
Origin of SeleniumOrigin of Selenium
 Selenium first came to life in 2004.
 Selenium was written in pure JavaScript.
 These scripts are injected into the web page, thus
simulating user activity.
 Limitations due to browser security policy called
SOP(Same origin policy).
HTML DOM Tree of ObjectsHTML DOM Tree of Objects
Interacting with HTML using JavaScriptInteracting with HTML using JavaScript
 JavaScript is a scripting language designed primarily
for adding interactivity to Web pages.
 Some JavaScript methods and interaction with browser
e.g.
 document.getElementById(“id”).innerHtml = “Some
text”
 document.getElementById(“id”).click
 Let’s do some hands on.
Understanding same origin policyUnderstanding same origin policy
How Selenium RC worksHow Selenium RC works
How WebDriverHow WebDriver
worksworks
• It uses the browser’s native
support for automation (different
for each browser)
Browser SupportBrowser Support
Selenium-WebDriver supports the following browsers along with the
operating systems these browsers are compatible with.
Google Chrome
Internet Explorer 6, 7, 8, 9, 10 - 32 and 64-bit where applicable
Firefox: latest ESR, previous ESR, current release, one previous release
Safari,Opera
HtmlUnit, Phantomjs
Android (with Selendroid or appium), iOS (with ios-driver or appium)
How Browser WorksHow Browser Works
LocatorsLocators
CSS
XPath
More about Selenium-More about Selenium-
WebDriverWebDriver
How does WebDriver know if the page is completely loaded?
When document.readyState is “complete”
More about Selenium-More about Selenium-
WebDriverWebDriver
 What is StaleElementReferenceException
 What causes them?
 Page Refresh
 JavaScript MVC frameworks
 Elements being re-rendered
More about Selenium-More about Selenium-
WebDriverWebDriver
 Can WebDriver execute javascript commands on DOM?
 WebElement element = driver.findElement(By.id("gbqfd"));
 JavascriptExecutor executor = (JavascriptExecutor)driver;
 executor.executeScript("arguments[0].click();", element);
More about Selenium-More about Selenium-
WebDriverWebDriver
 Handling : Explicit and Implicit Waits.
 driver.manage().timeouts().implicitlyWait(10,TimeUnit.SEC
ONDS)
 driver.manage().timeouts().pageLoadTimeout(10,
TimeUnit.SECONDS);
 WebElement element = (new WebDriverWait(driver,10))
.
until(ExpectedConditions.elementToBeClickable(By.Id(“id”))
).click
Hands on with WebDriverHands on with WebDriver
API’sAPI’s
Reference -
http://selenium.googlecode.com/git/docs/api/java/index.html
Key principle for designing /Key principle for designing /
building an Automationbuilding an Automation
Framework?Framework?
 Readable
 Re-Usable
 Maintainable
 Well Abstracted
 Scalable
 Browser support?
 Tests to be run in distributed environment or on one machine?
 …
Components of frameworkComponents of framework
Let’s codeLet’s code
Thank YouThank You
Atirek Gupta
atirekg@gmail.com, agupta@thoughtworks.com

More Related Content

What's hot

selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...
Nancy Thomas
 

What's hot (20)

Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium WebDriver with Java
Selenium WebDriver with JavaSelenium WebDriver with Java
Selenium WebDriver with Java
 
Selenium presentation
Selenium presentationSelenium presentation
Selenium presentation
 
Automated Web Testing With Selenium
Automated Web Testing With SeleniumAutomated Web Testing With Selenium
Automated Web Testing With Selenium
 
Selenium WebDriver FAQ's
Selenium WebDriver FAQ'sSelenium WebDriver FAQ's
Selenium WebDriver FAQ's
 
selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...selenium training | selenium course | selenium video tutorial | selenium for ...
selenium training | selenium course | selenium video tutorial | selenium for ...
 
Selenium - Introduction
Selenium - IntroductionSelenium - Introduction
Selenium - Introduction
 
Selenium
SeleniumSelenium
Selenium
 
Designing keyword and Data Driven Automation framework with Selenium
Designing keyword and Data Driven Automation framework with SeleniumDesigning keyword and Data Driven Automation framework with Selenium
Designing keyword and Data Driven Automation framework with Selenium
 
Selenium Framework using Java | Selenium Tutorial | Selenium Training Online ...
Selenium Framework using Java | Selenium Tutorial | Selenium Training Online ...Selenium Framework using Java | Selenium Tutorial | Selenium Training Online ...
Selenium Framework using Java | Selenium Tutorial | Selenium Training Online ...
 
Selenium By Pravin Mishra
Selenium By Pravin MishraSelenium By Pravin Mishra
Selenium By Pravin Mishra
 
Selenium IDE LOCATORS
Selenium IDE LOCATORSSelenium IDE LOCATORS
Selenium IDE LOCATORS
 
How to Configure Selenium WebDriver (java)
How to Configure Selenium WebDriver (java)How to Configure Selenium WebDriver (java)
How to Configure Selenium WebDriver (java)
 
Selenium 2 - PyCon 2011
Selenium 2 - PyCon 2011Selenium 2 - PyCon 2011
Selenium 2 - PyCon 2011
 
Selenium WebDriver training
Selenium WebDriver trainingSelenium WebDriver training
Selenium WebDriver training
 
Selenium
SeleniumSelenium
Selenium
 
Get Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 GridGet Started With Selenium 3 and Selenium 3 Grid
Get Started With Selenium 3 and Selenium 3 Grid
 
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
Introduction to Selenium | Selenium Tutorial for Beginners | Selenium Trainin...
 
Selenium WebDriver with C#
Selenium WebDriver with C#Selenium WebDriver with C#
Selenium WebDriver with C#
 

Viewers also liked

Viewers also liked (20)

Selenium Architecture
Selenium ArchitectureSelenium Architecture
Selenium Architecture
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Automation Testing using Selenium
Automation Testing using SeleniumAutomation Testing using Selenium
Automation Testing using Selenium
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
Selenium Basics Tutorial
Selenium Basics TutorialSelenium Basics Tutorial
Selenium Basics Tutorial
 
Web Test Automation with Selenium
Web Test Automation with SeleniumWeb Test Automation with Selenium
Web Test Automation with Selenium
 
Selenium Concepts
Selenium ConceptsSelenium Concepts
Selenium Concepts
 
Difference between selenium WebDriver and Selenium RC
Difference between selenium WebDriver and Selenium RCDifference between selenium WebDriver and Selenium RC
Difference between selenium WebDriver and Selenium RC
 
Selenium ppt
Selenium pptSelenium ppt
Selenium ppt
 
Selenium grid workshop london 2016
Selenium grid workshop london 2016Selenium grid workshop london 2016
Selenium grid workshop london 2016
 
Continuous Delivery With Selenium Grid And Docker
Continuous Delivery With Selenium Grid And DockerContinuous Delivery With Selenium Grid And Docker
Continuous Delivery With Selenium Grid And Docker
 
Selenium - The page object pattern
Selenium - The page object patternSelenium - The page object pattern
Selenium - The page object pattern
 
Keyword-driven Test Automation Framework
Keyword-driven Test Automation FrameworkKeyword-driven Test Automation Framework
Keyword-driven Test Automation Framework
 
Test Automation - Principles and Practices
Test Automation - Principles and PracticesTest Automation - Principles and Practices
Test Automation - Principles and Practices
 
Test Automation Framework Designs
Test Automation Framework DesignsTest Automation Framework Designs
Test Automation Framework Designs
 
Same origin policy
Same origin policySame origin policy
Same origin policy
 
Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”
Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”
Cross-Site Request Forgery Vulnerability: “A Sleeping Giant”
 
Same Origin Policy Weaknesses
Same Origin Policy WeaknessesSame Origin Policy Weaknesses
Same Origin Policy Weaknesses
 
Browser Internals-Same Origin Policy
Browser Internals-Same Origin PolicyBrowser Internals-Same Origin Policy
Browser Internals-Same Origin Policy
 
Weightlifting at SimplySocial
Weightlifting at SimplySocialWeightlifting at SimplySocial
Weightlifting at SimplySocial
 

Similar to Understanding Selenium/RC, Webdriver Architecture and developing the page object test automation framework

Best Selenium Online Training
Best Selenium Online TrainingBest Selenium Online Training
Best Selenium Online Training
Samatha Kamuni
 
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
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using Selenium
Nikhil Kapoor
 

Similar to Understanding Selenium/RC, Webdriver Architecture and developing the page object test automation framework (20)

Selenium -Test automation for web applications
Selenium -Test automation for web applicationsSelenium -Test automation for web applications
Selenium -Test automation for web applications
 
selenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfselenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdf
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Indic threads pune12-improve testing efficiency with selenium webdriver
Indic threads pune12-improve testing efficiency with selenium webdriverIndic threads pune12-improve testing efficiency with selenium webdriver
Indic threads pune12-improve testing efficiency with selenium webdriver
 
Best Selenium Online Training
Best Selenium Online TrainingBest Selenium Online Training
Best Selenium Online Training
 
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
 
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
 
Getting started with Selenium 2
Getting started with Selenium 2Getting started with Selenium 2
Getting started with Selenium 2
 
Protractor overview
Protractor overviewProtractor overview
Protractor overview
 
Web driver training
Web driver trainingWeb driver training
Web driver training
 
前端網頁自動測試
前端網頁自動測試 前端網頁自動測試
前端網頁自動測試
 
Test Automation Using Selenium
Test Automation Using SeleniumTest Automation Using Selenium
Test Automation Using Selenium
 
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptxA Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
A Definitive Guide to Mastering Selenium WebDriver Automation Effectively.pptx
 
An overview of selenium webdriver
An overview of selenium webdriverAn overview of selenium webdriver
An overview of selenium webdriver
 
Selenium
SeleniumSelenium
Selenium
 
anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdf
anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdfanoverviewofseleniumwebdriver-160407055026 (pdf.io).pdf
anoverviewofseleniumwebdriver-160407055026 (pdf.io).pdf
 
Web UI Tests: Introduce UI tests using Selenium
Web UI Tests: Introduce UI tests using Selenium Web UI Tests: Introduce UI tests using Selenium
Web UI Tests: Introduce UI tests using Selenium
 
Selenium.pptx
Selenium.pptxSelenium.pptx
Selenium.pptx
 
Selenium Web Driver Tutorial for Cross Browser Testing
Selenium Web Driver Tutorial for Cross Browser TestingSelenium Web Driver Tutorial for Cross Browser Testing
Selenium Web Driver Tutorial for Cross Browser Testing
 
Step by step - Selenium 3 web-driver - From Scratch
Step by step - Selenium 3 web-driver - From Scratch  Step by step - Selenium 3 web-driver - From Scratch
Step by step - Selenium 3 web-driver - From Scratch
 

Recently uploaded

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
shinachiaurasa2
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
VishalKumarJha10
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
masabamasaba
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
masabamasaba
 

Recently uploaded (20)

CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdfThe Top App Development Trends Shaping the Industry in 2024-25 .pdf
The Top App Development Trends Shaping the Industry in 2024-25 .pdf
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
10 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 202410 Trends Likely to Shape Enterprise Technology in 2024
10 Trends Likely to Shape Enterprise Technology in 2024
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
SHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions PresentationSHRMPro HRMS Software Solutions Presentation
SHRMPro HRMS Software Solutions Presentation
 
The title is not connected to what is inside
The title is not connected to what is insideThe title is not connected to what is inside
The title is not connected to what is inside
 
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdfintroduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
introduction-to-automotive Andoid os-csimmonds-ndctechtown-2021.pdf
 
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
Direct Style Effect Systems -The Print[A] Example- A Comprehension AidDirect Style Effect Systems -The Print[A] Example- A Comprehension Aid
Direct Style Effect Systems - The Print[A] Example - A Comprehension Aid
 
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
Crypto Cloud Review - How To Earn Up To $500 Per DAY Of Bitcoin 100% On AutoP...
 
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
%in Lydenburg+277-882-255-28 abortion pills for sale in Lydenburg
 
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
%+27788225528 love spells in Atlanta Psychic Readings, Attraction spells,Brin...
 
8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students8257 interfacing 2 in microprocessor for btech students
8257 interfacing 2 in microprocessor for btech students
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa%in tembisa+277-882-255-28 abortion pills for sale in tembisa
%in tembisa+277-882-255-28 abortion pills for sale in tembisa
 
Announcing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK SoftwareAnnouncing Codolex 2.0 from GDK Software
Announcing Codolex 2.0 from GDK Software
 
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park %in ivory park+277-882-255-28 abortion pills for sale in ivory park
%in ivory park+277-882-255-28 abortion pills for sale in ivory park
 
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
%+27788225528 love spells in Colorado Springs Psychic Readings, Attraction sp...
 
%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban%in Durban+277-882-255-28 abortion pills for sale in Durban
%in Durban+277-882-255-28 abortion pills for sale in Durban
 

Understanding Selenium/RC, Webdriver Architecture and developing the page object test automation framework

  • 1. Selenium WorkshopSelenium Workshop By Atirek GuptaBy Atirek Gupta
  • 2. Out of scopeOut of scope  When and why to do functional test automation.  Test specification.  Test data management.  Detailed architecture of Browser.  Going deeper into Java Script  Build tools, CI and VCS
  • 3. AgendaAgenda  Origin of Selenium  Understanding same origin policy  Interacting with HTML using JavaScript  How Selenium-RC and WebDriver works  Locators  More about Selenium and WebDriver  Overview of how browser works  Exploring WebDriver API’s with examples  Building test automation framework using Java and WebDriver
  • 4. Origin of SeleniumOrigin of Selenium  Selenium first came to life in 2004.  Selenium was written in pure JavaScript.  These scripts are injected into the web page, thus simulating user activity.  Limitations due to browser security policy called SOP(Same origin policy).
  • 5. HTML DOM Tree of ObjectsHTML DOM Tree of Objects
  • 6. Interacting with HTML using JavaScriptInteracting with HTML using JavaScript  JavaScript is a scripting language designed primarily for adding interactivity to Web pages.  Some JavaScript methods and interaction with browser e.g.  document.getElementById(“id”).innerHtml = “Some text”  document.getElementById(“id”).click  Let’s do some hands on.
  • 7. Understanding same origin policyUnderstanding same origin policy
  • 8. How Selenium RC worksHow Selenium RC works
  • 9. How WebDriverHow WebDriver worksworks • It uses the browser’s native support for automation (different for each browser)
  • 10. Browser SupportBrowser Support Selenium-WebDriver supports the following browsers along with the operating systems these browsers are compatible with. Google Chrome Internet Explorer 6, 7, 8, 9, 10 - 32 and 64-bit where applicable Firefox: latest ESR, previous ESR, current release, one previous release Safari,Opera HtmlUnit, Phantomjs Android (with Selendroid or appium), iOS (with ios-driver or appium)
  • 11. How Browser WorksHow Browser Works
  • 13. More about Selenium-More about Selenium- WebDriverWebDriver How does WebDriver know if the page is completely loaded? When document.readyState is “complete”
  • 14. More about Selenium-More about Selenium- WebDriverWebDriver  What is StaleElementReferenceException  What causes them?  Page Refresh  JavaScript MVC frameworks  Elements being re-rendered
  • 15. More about Selenium-More about Selenium- WebDriverWebDriver  Can WebDriver execute javascript commands on DOM?  WebElement element = driver.findElement(By.id("gbqfd"));  JavascriptExecutor executor = (JavascriptExecutor)driver;  executor.executeScript("arguments[0].click();", element);
  • 16. More about Selenium-More about Selenium- WebDriverWebDriver  Handling : Explicit and Implicit Waits.  driver.manage().timeouts().implicitlyWait(10,TimeUnit.SEC ONDS)  driver.manage().timeouts().pageLoadTimeout(10, TimeUnit.SECONDS);  WebElement element = (new WebDriverWait(driver,10)) . until(ExpectedConditions.elementToBeClickable(By.Id(“id”)) ).click
  • 17. Hands on with WebDriverHands on with WebDriver API’sAPI’s Reference - http://selenium.googlecode.com/git/docs/api/java/index.html
  • 18. Key principle for designing /Key principle for designing / building an Automationbuilding an Automation Framework?Framework?  Readable  Re-Usable  Maintainable  Well Abstracted  Scalable  Browser support?  Tests to be run in distributed environment or on one machine?  …
  • 21.
  • 22. Thank YouThank You Atirek Gupta atirekg@gmail.com, agupta@thoughtworks.com

Editor's Notes

  1. 1. Selenium was a tremendous tool, it wasn’t without its drawbacks. Because of its Javascript based automation engine and the security limitations browsers apply to Javascript, different things became impossible to do. 2. Because Selenium was written in pure Javascript, its initial design required developers to host Core and their tests on the same server as the application under test (AUT). 3. There is a java script security restriction (same origin policy) which lets you modify html of page using js only if js also originates from the same domain as html.
  2. JavaScript can change all the HTML elements in the page JavaScript can change all the HTML attributes in the page JavaScript can change all the CSS styles in the page JavaScript can remove existing HTML elements and attributes JavaScript can add new HTML elements and attributes JavaScript can react to all existing HTML events in the page JavaScript can create new HTML events in the page
  3. Lets understand SOP with some live example.
  4. Selenium RC Server acts as a "middleman” Selenium RC Server "injects" a Javascript program called Selenium Core into the browser. Once injected, Selenium Core will start receiving instructions relayed by the RC Server from your test program. Then the instructions are received, Selenium Core will execute them as Javascript commands. The browser will obey the instructions of Selenium Core, and will relay its response to the RC Server. The RC Server will receive the response of the browser and then display the results to you. RC Server will fetch the next instruction from your test script to repeat the whole cycle.
  5. user interface: this includes the address bar browser engine: marshals actions between the UI and the rendering engine. rendering engine : responsible for displaying requested content. Internet Explorer uses Trident, Firefox uses Gecko, Safari uses WebKit. Chrome and Opera (from version 15) use Blink, a fork of WebKit. Networking: for network calls such as HTTP requests, UI backend: used for drawing basic widgets like combo boxes JavaScript interpreter. Used to parse and execute JavaScript code. Data Storage: Browsers also support storage mechanisms such as localStorage, IndexedDB, WebSQL and FileSystem. Think of the areas where you need to retest your app in different browsers based on the information you know about different rendering engines
  6. Many JavaScript MVC frameworks can update contents of a list or a control by rapidly tearing down and recreating the same element.
  7. Build tool: follows a standard design and development process Well-defined process should be established for Team communication, Library versioning and Artifacts creation