• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Indic threads pune12-improve testing efficiency with selenium webdriver
 

Indic threads pune12-improve testing efficiency with selenium webdriver

on

  • 1,815 views

The 7th Annual IndicThreads Pune Conference was held on 14-15 December 2012. http://pune12.indicthreads.com/

The 7th Annual IndicThreads Pune Conference was held on 14-15 December 2012. http://pune12.indicthreads.com/

Statistics

Views

Total Views
1,815
Views on SlideShare
1,815
Embed Views
0

Actions

Likes
0
Downloads
45
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment
  • 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.
  • 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 ="document.getElementById('" + elementId + "').value = '" + textToEnter + "';";     je.executeScript(script);
  • 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.
  • 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’.
  • 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.

Indic threads pune12-improve testing efficiency with selenium webdriver Indic threads pune12-improve testing efficiency with selenium webdriver Presentation Transcript

  • Improve Testing Efficiency WithSelenium WebDriverSurendran EthirajXpanxion 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 WebDriverOne 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 ScriptsSelenium WebDriver 2.0 provides us an Interface‘JavaScriptExecutor’ to execute JS/Jquery scriptsindependent or within the applicationJavascriptExecutor js = (JavascriptExecutor) driver;js.executeScript("alert(Hello from Selenium!);");
  • Retrieving JavaScript Errors
  • Identifying JSErrors Cross BrowserFor 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
  • SikuliWebDriverSikuliFirefoxDriver extends Seleniums FirefoxDriver by adding Sikulis image search capability. It is useful for automating interactions with highly visual interfaces such as Google Map.
  • “Testing is an infinite process of comparing the invisible to theambiguous in order to avoid the unthinkable happening to theanonymous.” - James Bach
  • For Queries write to me atsurenethiraj@gmail.comLinked In: in.linkedin.com/pub/surendran-ethiraj/5/946/a11