SlideShare uma empresa Scribd logo
1 de 21
Baixar para ler offline
Improve Testing Efficiency With
Selenium WebDriver
Surendran Ethiraj
Xpanxion International Pvt. Ltd
Agenda

 Selenium – An Intro
 Selenium Tool’s Suite
 Selenium RC (Versus) Selenium WebDriver
 What’s new? - Selenium WebDriver
 Advanced concepts in WebDriver
 Demo
What is Selenium?
• Selenium is a set of different software tools for
  automating web applications.
• Can be used for most of the browser/platform
  combinations.
• Supports many languages including Ruby,
  Python, Java etc.
• Open source and free.
Selenium’s Tool Suite
•   Selenium IDE.
•   Selenium RC.
•   Selenium 2.0 (WebDriver).
•   Selenium Grid.
Selenium RC
Selenium WebDriver
Advantages of WebDriver
One should use WebDriver when requiring
 improved support for

 * Multi-browser testing including improved
 functionality for browsers not well-supported by
 Selenium-1.0.
 * Handling multiple frames, multiple browser
 windows, popups, and alerts.
 * Page navigation.
 * Drag-and-drop.
 * AJAX-based UI elements.
Advancing in WebDriver

   Using Java/JQuery scripts
   Retrieving Java script errors
   Identifying broken links
   Handling ‘Wait’ in WebDriver
   Reporting Server-client responses
   Reporting Page load timings
   Cross browser testing

                                        8
Using Java/JQuery Scripts
Selenium WebDriver 2.0 provides us an Interface
‘JavaScriptExecutor’ to execute JS/Jquery scripts
independent or within the application

JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("alert('Hello from Selenium!');");
Retrieving JavaScript Errors
Identifying JSErrors Cross Browser

For Firefox :
We have to add an plugin “JSErrorCollector.xpi” in
  Firefox profile which aids to identify the Java
  script errors on the page and the same could be
  retrieved using JavaScriptErrorCollector API.

List<JavaScriptError> jsErrors =
  JavaScriptError.readErrors(driver);
Other Browsers:
For Other Browsers:
We need to add the below code in our application
  and use JavaScript query to retrieving the details
  <script type="text/javascript">
  window.onerror=function(msg){
  var previous_errors =
    document.getElementsByTagName("body")
    [0].getAttribute("JSError");
  $("body").attr("JSError",previous_errors + 'n' + msg );
  }
  </script>
Broken Links
Handling ‘Wait’ in WebDriver

 Fluent Wait
  (withTimeOut,
  Polling mechanism)
 Implicit Wait
  (withTimeOut)
 Ajax load Wait
  (Developed through
  JQuery for verifying
  AJAX calls)
HAR (Http Archive Report)
• Exports HTTP tracing information for
  performance analytics
Data from HAR file

How long it takes to fetch the DNS information
How long each object takes to be requested
How long it takes to connect to the server
How long it takes to transfer from the server to
 the browser of each object
Whether the object is blocked or not
Cross Browser Testing with Grid 2.0
SikuliWebDriver




SikuliFirefoxDriver extends Selenium's FirefoxDriver by
  adding Sikuli's image search capability. It is useful for
  automating interactions with highly visual interfaces
  such as Google Map.
Indic threads pune12-improve testing efficiency with selenium webdriver
“Testing is an infinite process of comparing the invisible to the
ambiguous in order to avoid the unthinkable happening to the
anonymous.” - James Bach
For Queries write to me at
surenethiraj@gmail.com
Linked In: in.linkedin.com/pub/surendran-ethiraj/5/946/a11

Mais conteúdo relacionado

Mais procurados

XSS Defeating Concept - Part 2
XSS Defeating Concept - Part 2XSS Defeating Concept - Part 2
XSS Defeating Concept - Part 2Abhishek Kumar
 
Wroc.py #32: Microservices in flask
Wroc.py #32: Microservices in flaskWroc.py #32: Microservices in flask
Wroc.py #32: Microservices in flaskKrzysztof Żuraw
 
MarvelSoft SchoolAdmin Dev Framework
MarvelSoft SchoolAdmin Dev FrameworkMarvelSoft SchoolAdmin Dev Framework
MarvelSoft SchoolAdmin Dev FrameworkRanganath Shivaram
 
Web driver interface
Web driver interfaceWeb driver interface
Web driver interfaceDucat
 
Web application using c# Lab - Web Configuration file
Web application using c# Lab - Web Configuration fileWeb application using c# Lab - Web Configuration file
Web application using c# Lab - Web Configuration filepriya Nithya
 
Updated Resume_ram
Updated Resume_ramUpdated Resume_ram
Updated Resume_ramramudu k
 
Membangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.jsMembangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.jsFroyo Framework
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriverANKUR-BA
 
Angular workshop
Angular workshopAngular workshop
Angular workshophoa long
 
Indic threads pune12-using play2.0 for building an insurance website
Indic threads pune12-using play2.0 for building an insurance websiteIndic threads pune12-using play2.0 for building an insurance website
Indic threads pune12-using play2.0 for building an insurance websiteIndicThreads
 
Jquery
Jquery Jquery
Jquery eginni
 

Mais procurados (20)

XSS Defeating Concept - Part 2
XSS Defeating Concept - Part 2XSS Defeating Concept - Part 2
XSS Defeating Concept - Part 2
 
Wroc.py #32: Microservices in flask
Wroc.py #32: Microservices in flaskWroc.py #32: Microservices in flask
Wroc.py #32: Microservices in flask
 
MarvelSoft SchoolAdmin Dev Framework
MarvelSoft SchoolAdmin Dev FrameworkMarvelSoft SchoolAdmin Dev Framework
MarvelSoft SchoolAdmin Dev Framework
 
Web driver interface
Web driver interfaceWeb driver interface
Web driver interface
 
Pundit
PunditPundit
Pundit
 
Web application using c# Lab - Web Configuration file
Web application using c# Lab - Web Configuration fileWeb application using c# Lab - Web Configuration file
Web application using c# Lab - Web Configuration file
 
Updated Resume_ram
Updated Resume_ramUpdated Resume_ram
Updated Resume_ram
 
Membangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.jsMembangun Moderen UI dengan Vue.js
Membangun Moderen UI dengan Vue.js
 
Devise and Rails
Devise and RailsDevise and Rails
Devise and Rails
 
AngularJS at PyVo
AngularJS at PyVoAngularJS at PyVo
AngularJS at PyVo
 
Let's react - Meetup
Let's react - MeetupLet's react - Meetup
Let's react - Meetup
 
ASP.NET Web Security
ASP.NET Web SecurityASP.NET Web Security
ASP.NET Web Security
 
Selenium WebDriver
Selenium WebDriverSelenium WebDriver
Selenium WebDriver
 
Angular workshop
Angular workshopAngular workshop
Angular workshop
 
Backbone.js
Backbone.jsBackbone.js
Backbone.js
 
Java script
Java scriptJava script
Java script
 
Reporting Defects
Reporting DefectsReporting Defects
Reporting Defects
 
Single Page Application
Single Page ApplicationSingle Page Application
Single Page Application
 
Indic threads pune12-using play2.0 for building an insurance website
Indic threads pune12-using play2.0 for building an insurance websiteIndic threads pune12-using play2.0 for building an insurance website
Indic threads pune12-using play2.0 for building an insurance website
 
Jquery
Jquery Jquery
Jquery
 

Destaque

“Comparative and Competitive study of the corporate identity of the domestic ...
“Comparative and Competitive study of the corporate identity of the domestic ...“Comparative and Competitive study of the corporate identity of the domestic ...
“Comparative and Competitive study of the corporate identity of the domestic ...Parvesh Taneja
 
Pre Placement Interview Presentation on Mechanical Design
Pre Placement Interview Presentation on Mechanical DesignPre Placement Interview Presentation on Mechanical Design
Pre Placement Interview Presentation on Mechanical DesignParvesh Taneja
 
Connecting morse key to pc using an optical mouse.
Connecting morse key to pc using an optical mouse.Connecting morse key to pc using an optical mouse.
Connecting morse key to pc using an optical mouse.Parvesh Taneja
 
Supervisory Control and Data Acquisition (SCADA) system for Greenhouse Farm w...
Supervisory Control and Data Acquisition (SCADA) system for Greenhouse Farm w...Supervisory Control and Data Acquisition (SCADA) system for Greenhouse Farm w...
Supervisory Control and Data Acquisition (SCADA) system for Greenhouse Farm w...Parvesh Taneja
 
Autodesk maya presentation
Autodesk maya presentationAutodesk maya presentation
Autodesk maya presentationParvesh Taneja
 
3D modelling and animation using Autodesk maya
3D modelling and animation using Autodesk maya3D modelling and animation using Autodesk maya
3D modelling and animation using Autodesk mayaParvesh Taneja
 
Rebranding Campaign Proposal
Rebranding Campaign ProposalRebranding Campaign Proposal
Rebranding Campaign Proposalcmnicoloff
 
Arduino based intelligent greenhouse Project
Arduino based intelligent greenhouse ProjectArduino based intelligent greenhouse Project
Arduino based intelligent greenhouse ProjectAmit Saini
 
W-LAN (Wireless Local Area Network)
W-LAN (Wireless Local Area Network)W-LAN (Wireless Local Area Network)
W-LAN (Wireless Local Area Network)Parvesh Taneja
 

Destaque (9)

“Comparative and Competitive study of the corporate identity of the domestic ...
“Comparative and Competitive study of the corporate identity of the domestic ...“Comparative and Competitive study of the corporate identity of the domestic ...
“Comparative and Competitive study of the corporate identity of the domestic ...
 
Pre Placement Interview Presentation on Mechanical Design
Pre Placement Interview Presentation on Mechanical DesignPre Placement Interview Presentation on Mechanical Design
Pre Placement Interview Presentation on Mechanical Design
 
Connecting morse key to pc using an optical mouse.
Connecting morse key to pc using an optical mouse.Connecting morse key to pc using an optical mouse.
Connecting morse key to pc using an optical mouse.
 
Supervisory Control and Data Acquisition (SCADA) system for Greenhouse Farm w...
Supervisory Control and Data Acquisition (SCADA) system for Greenhouse Farm w...Supervisory Control and Data Acquisition (SCADA) system for Greenhouse Farm w...
Supervisory Control and Data Acquisition (SCADA) system for Greenhouse Farm w...
 
Autodesk maya presentation
Autodesk maya presentationAutodesk maya presentation
Autodesk maya presentation
 
3D modelling and animation using Autodesk maya
3D modelling and animation using Autodesk maya3D modelling and animation using Autodesk maya
3D modelling and animation using Autodesk maya
 
Rebranding Campaign Proposal
Rebranding Campaign ProposalRebranding Campaign Proposal
Rebranding Campaign Proposal
 
Arduino based intelligent greenhouse Project
Arduino based intelligent greenhouse ProjectArduino based intelligent greenhouse Project
Arduino based intelligent greenhouse Project
 
W-LAN (Wireless Local Area Network)
W-LAN (Wireless Local Area Network)W-LAN (Wireless Local Area Network)
W-LAN (Wireless Local Area Network)
 

Semelhante a Indic threads pune12-improve testing efficiency with selenium webdriver

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
 
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 SolutionsQuontra 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.pdfAnanthReddy38
 
Getting started with Selenium 2
Getting started with Selenium 2Getting started with Selenium 2
Getting started with Selenium 2Sebastiano Armeli
 
selenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfselenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfAnuragMourya8
 
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.pptxMatthew Allen
 
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 SuccessfullySpringPeople
 
Best Selenium Online Training
Best Selenium Online TrainingBest Selenium Online Training
Best Selenium Online TrainingSamatha Kamuni
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using JavaF K
 

Semelhante a Indic threads pune12-improve testing efficiency with selenium webdriver (20)

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...
 
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
 
Web driver training
Web driver trainingWeb driver training
Web driver training
 
Selenium web driver
Selenium web driverSelenium web driver
Selenium web driver
 
Selenium WebDriver FAQ's
Selenium WebDriver FAQ'sSelenium WebDriver FAQ's
Selenium WebDriver FAQ's
 
Introduction to Selenium Web Driver
Introduction to Selenium Web DriverIntroduction to Selenium Web Driver
Introduction to Selenium Web Driver
 
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
 
selenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdfselenium-webdriver-interview-questions.pdf
selenium-webdriver-interview-questions.pdf
 
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
 
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
 
Best Selenium Online Training
Best Selenium Online TrainingBest Selenium Online Training
Best Selenium Online Training
 
Selenium using Java
Selenium using JavaSelenium using Java
Selenium using Java
 
Selenium (1) (1)
Selenium (1) (1)Selenium (1) (1)
Selenium (1) (1)
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 
Selenium
SeleniumSelenium
Selenium
 

Mais de IndicThreads

Http2 is here! And why the web needs it
Http2 is here! And why the web needs itHttp2 is here! And why the web needs it
Http2 is here! And why the web needs itIndicThreads
 
Understanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
Understanding Bitcoin (Blockchain) and its Potential for Disruptive ApplicationsUnderstanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
Understanding Bitcoin (Blockchain) and its Potential for Disruptive ApplicationsIndicThreads
 
Go Programming Language - Learning The Go Lang way
Go Programming Language - Learning The Go Lang wayGo Programming Language - Learning The Go Lang way
Go Programming Language - Learning The Go Lang wayIndicThreads
 
Building Resilient Microservices
Building Resilient Microservices Building Resilient Microservices
Building Resilient Microservices IndicThreads
 
App using golang indicthreads
App using golang  indicthreadsApp using golang  indicthreads
App using golang indicthreadsIndicThreads
 
Building on quicksand microservices indicthreads
Building on quicksand microservices  indicthreadsBuilding on quicksand microservices  indicthreads
Building on quicksand microservices indicthreadsIndicThreads
 
How to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingHow to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingIndicThreads
 
Iot secure connected devices indicthreads
Iot secure connected devices indicthreadsIot secure connected devices indicthreads
Iot secure connected devices indicthreadsIndicThreads
 
Real world IoT for enterprises
Real world IoT for enterprisesReal world IoT for enterprises
Real world IoT for enterprisesIndicThreads
 
IoT testing and quality assurance indicthreads
IoT testing and quality assurance indicthreadsIoT testing and quality assurance indicthreads
IoT testing and quality assurance indicthreadsIndicThreads
 
Functional Programming Past Present Future
Functional Programming Past Present FutureFunctional Programming Past Present Future
Functional Programming Past Present FutureIndicThreads
 
Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams IndicThreads
 
Building & scaling a live streaming mobile platform - Gr8 road to fame
Building & scaling a live streaming mobile platform - Gr8 road to fameBuilding & scaling a live streaming mobile platform - Gr8 road to fame
Building & scaling a live streaming mobile platform - Gr8 road to fameIndicThreads
 
Internet of things architecture perspective - IndicThreads Conference
Internet of things architecture perspective - IndicThreads ConferenceInternet of things architecture perspective - IndicThreads Conference
Internet of things architecture perspective - IndicThreads ConferenceIndicThreads
 
Cars and Computers: Building a Java Carputer
 Cars and Computers: Building a Java Carputer Cars and Computers: Building a Java Carputer
Cars and Computers: Building a Java CarputerIndicThreads
 
Scrap Your MapReduce - Apache Spark
 Scrap Your MapReduce - Apache Spark Scrap Your MapReduce - Apache Spark
Scrap Your MapReduce - Apache SparkIndicThreads
 
Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
 Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & DockerIndicThreads
 
Speed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedbackSpeed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedbackIndicThreads
 
Unraveling OpenStack Clouds
 Unraveling OpenStack Clouds Unraveling OpenStack Clouds
Unraveling OpenStack CloudsIndicThreads
 
Digital Transformation of the Enterprise. What IT leaders need to know!
Digital Transformation of the Enterprise. What IT  leaders need to know!Digital Transformation of the Enterprise. What IT  leaders need to know!
Digital Transformation of the Enterprise. What IT leaders need to know!IndicThreads
 

Mais de IndicThreads (20)

Http2 is here! And why the web needs it
Http2 is here! And why the web needs itHttp2 is here! And why the web needs it
Http2 is here! And why the web needs it
 
Understanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
Understanding Bitcoin (Blockchain) and its Potential for Disruptive ApplicationsUnderstanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
Understanding Bitcoin (Blockchain) and its Potential for Disruptive Applications
 
Go Programming Language - Learning The Go Lang way
Go Programming Language - Learning The Go Lang wayGo Programming Language - Learning The Go Lang way
Go Programming Language - Learning The Go Lang way
 
Building Resilient Microservices
Building Resilient Microservices Building Resilient Microservices
Building Resilient Microservices
 
App using golang indicthreads
App using golang  indicthreadsApp using golang  indicthreads
App using golang indicthreads
 
Building on quicksand microservices indicthreads
Building on quicksand microservices  indicthreadsBuilding on quicksand microservices  indicthreads
Building on quicksand microservices indicthreads
 
How to Think in RxJava Before Reacting
How to Think in RxJava Before ReactingHow to Think in RxJava Before Reacting
How to Think in RxJava Before Reacting
 
Iot secure connected devices indicthreads
Iot secure connected devices indicthreadsIot secure connected devices indicthreads
Iot secure connected devices indicthreads
 
Real world IoT for enterprises
Real world IoT for enterprisesReal world IoT for enterprises
Real world IoT for enterprises
 
IoT testing and quality assurance indicthreads
IoT testing and quality assurance indicthreadsIoT testing and quality assurance indicthreads
IoT testing and quality assurance indicthreads
 
Functional Programming Past Present Future
Functional Programming Past Present FutureFunctional Programming Past Present Future
Functional Programming Past Present Future
 
Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams Harnessing the Power of Java 8 Streams
Harnessing the Power of Java 8 Streams
 
Building & scaling a live streaming mobile platform - Gr8 road to fame
Building & scaling a live streaming mobile platform - Gr8 road to fameBuilding & scaling a live streaming mobile platform - Gr8 road to fame
Building & scaling a live streaming mobile platform - Gr8 road to fame
 
Internet of things architecture perspective - IndicThreads Conference
Internet of things architecture perspective - IndicThreads ConferenceInternet of things architecture perspective - IndicThreads Conference
Internet of things architecture perspective - IndicThreads Conference
 
Cars and Computers: Building a Java Carputer
 Cars and Computers: Building a Java Carputer Cars and Computers: Building a Java Carputer
Cars and Computers: Building a Java Carputer
 
Scrap Your MapReduce - Apache Spark
 Scrap Your MapReduce - Apache Spark Scrap Your MapReduce - Apache Spark
Scrap Your MapReduce - Apache Spark
 
Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
 Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
Continuous Integration (CI) and Continuous Delivery (CD) using Jenkins & Docker
 
Speed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedbackSpeed up your build pipeline for faster feedback
Speed up your build pipeline for faster feedback
 
Unraveling OpenStack Clouds
 Unraveling OpenStack Clouds Unraveling OpenStack Clouds
Unraveling OpenStack Clouds
 
Digital Transformation of the Enterprise. What IT leaders need to know!
Digital Transformation of the Enterprise. What IT  leaders need to know!Digital Transformation of the Enterprise. What IT  leaders need to know!
Digital Transformation of the Enterprise. What IT leaders need to know!
 

Indic threads pune12-improve testing efficiency with selenium webdriver

  • 1. Improve Testing Efficiency With Selenium WebDriver Surendran Ethiraj Xpanxion International Pvt. Ltd
  • 2. Agenda  Selenium – An Intro  Selenium Tool’s Suite  Selenium RC (Versus) Selenium WebDriver  What’s new? - Selenium WebDriver  Advanced concepts in WebDriver  Demo
  • 3. What is Selenium? • Selenium is a set of different software tools for automating web applications. • Can be used for most of the browser/platform combinations. • Supports many languages including Ruby, Python, Java etc. • Open source and free.
  • 4. Selenium’s Tool Suite • Selenium IDE. • Selenium RC. • Selenium 2.0 (WebDriver). • Selenium Grid.
  • 7. Advantages of WebDriver One should use WebDriver when requiring improved support for * Multi-browser testing including improved functionality for browsers not well-supported by Selenium-1.0. * Handling multiple frames, multiple browser windows, popups, and alerts. * Page navigation. * Drag-and-drop. * AJAX-based UI elements.
  • 8. Advancing in WebDriver  Using Java/JQuery scripts  Retrieving Java script errors  Identifying broken links  Handling ‘Wait’ in WebDriver  Reporting Server-client responses  Reporting Page load timings  Cross browser testing 8
  • 9. Using Java/JQuery Scripts Selenium WebDriver 2.0 provides us an Interface ‘JavaScriptExecutor’ to execute JS/Jquery scripts independent or within the application JavascriptExecutor js = (JavascriptExecutor) driver; js.executeScript("alert('Hello from Selenium!');");
  • 11. Identifying JSErrors Cross Browser For Firefox : We have to add an plugin “JSErrorCollector.xpi” in Firefox profile which aids to identify the Java script errors on the page and the same could be retrieved using JavaScriptErrorCollector API. List<JavaScriptError> jsErrors = JavaScriptError.readErrors(driver);
  • 12. Other Browsers: For Other Browsers: We need to add the below code in our application and use JavaScript query to retrieving the details <script type="text/javascript"> window.onerror=function(msg){ var previous_errors = document.getElementsByTagName("body") [0].getAttribute("JSError"); $("body").attr("JSError",previous_errors + 'n' + msg ); } </script>
  • 14. Handling ‘Wait’ in WebDriver Fluent Wait (withTimeOut, Polling mechanism) Implicit Wait (withTimeOut) Ajax load Wait (Developed through JQuery for verifying AJAX calls)
  • 15. HAR (Http Archive Report) • Exports HTTP tracing information for performance analytics
  • 16. Data from HAR file How long it takes to fetch the DNS information How long each object takes to be requested How long it takes to connect to the server How long it takes to transfer from the server to the browser of each object Whether the object is blocked or not
  • 17. Cross Browser Testing with Grid 2.0
  • 18. SikuliWebDriver SikuliFirefoxDriver extends Selenium's FirefoxDriver by adding Sikuli's image search capability. It is useful for automating interactions with highly visual interfaces such as Google Map.
  • 20. “Testing is an infinite process of comparing the invisible to the ambiguous in order to avoid the unthinkable happening to the anonymous.” - James Bach
  • 21. For Queries write to me at surenethiraj@gmail.com Linked In: in.linkedin.com/pub/surendran-ethiraj/5/946/a11

Notas do Editor

  1. When to Use WebDriver? One should use WebDriver when requiring improved support for * Multi-browser testing including improved functionality for browsers not well-supported by Selenium-1.0. * Handling multiple frames, multiple browser windows, popups, and alerts. * Page navigation. * Drag-and-drop. * AJAX-based UI elements.
  2. When testing JavaScript-heavy websites, at some point you may reach Selenium limits. A simple use case will fail. You will getElementNotVisibleException, even though you can clearly see that element. Other times the same selector will return different results depending on the type of the browser. Fortunately, a simple solution exists …. Selenium WebDriver 2.0 provides us an Interface ‘JavaScriptExecutor’ to execute JS/Jquery scripts independent or within the application Sample: JavascriptExecutor je = (JavascriptExecutor) webDriver();     String script =&quot;document.getElementById(&apos;&quot; + elementId + &quot;&apos;).value = &apos;&quot; + textToEnter + &quot;&apos;;&quot;;     je.executeScript(script);
  3. It works by retrieving the “href” attribute of the link and get the http status code for that link. If the links are accessible then http return codes like 200, 201 and 202 Else if the links are broken then http return codes like 4XX, 5XX From the Http codes we could decide whether a specific link is broken or not.
  4. Firebug wanted to have a export in its Net panel, which lead them to team up with HTTPWatch to produce a common format named ‘HAR’.
  5. The data is stored as a JSON document and extracting meaning from the low level data is not always easy, but with practice, a HAR file can quickly help you identify the key performance problems with a web page, which in turn will help you efficiently target your development towards the areas that will deliver the greatest return on your efforts.