Your SlideShare is downloading. ×
0
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 WebDri...
What is Selenium?• Selenium is a set of different software tools for  automating web applications.• Can be used for most o...
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 impr...
Advancing in WebDriver   Using Java/JQuery scripts   Retrieving Java script errors   Identifying broken links   Handli...
Using Java/JQuery ScriptsSelenium WebDriver 2.0 provides us an Interface‘JavaScriptExecutor’ to execute JS/Jquery scriptsi...
Retrieving JavaScript Errors
Identifying JSErrors Cross BrowserFor Firefox :We have to add an plugin “JSErrorCollector.xpi” in  Firefox profile which a...
Other Browsers:For Other Browsers:We need to add the below code in our application  and use JavaScript query to retrieving...
Broken Links
Handling ‘Wait’ in WebDriver Fluent Wait  (withTimeOut,  Polling mechanism) Implicit Wait  (withTimeOut) Ajax load Wait...
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 t...
Cross Browser Testing with Grid 2.0
SikuliWebDriverSikuliFirefoxDriver extends Seleniums FirefoxDriver by  adding Sikulis image search capability. It is usefu...
“Testing is an infinite process of comparing the invisible to theambiguous in order to avoid the unthinkable happening to ...
For Queries write to me atsurenethiraj@gmail.comLinked In: in.linkedin.com/pub/surendran-ethiraj/5/946/a11
Indic threads pune12-improve testing efficiency with selenium webdriver
Upcoming SlideShare
Loading in...5
×

Indic threads pune12-improve testing efficiency with selenium webdriver

1,478

Published on

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

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,478
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
51
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • 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.
  • Transcript of "Indic threads pune12-improve testing efficiency with selenium webdriver"

    1. 1. Improve Testing Efficiency WithSelenium WebDriverSurendran EthirajXpanxion International Pvt. Ltd
    2. 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. 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. 4. Selenium’s Tool Suite• Selenium IDE.• Selenium RC.• Selenium 2.0 (WebDriver).• Selenium Grid.
    5. 5. Selenium RC
    6. 6. Selenium WebDriver
    7. 7. 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.
    8. 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. 9. 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!);");
    10. 10. Retrieving JavaScript Errors
    11. 11. 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);
    12. 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>
    13. 13. Broken Links
    14. 14. Handling ‘Wait’ in WebDriver Fluent Wait (withTimeOut, Polling mechanism) Implicit Wait (withTimeOut) Ajax load Wait (Developed through JQuery for verifying AJAX calls)
    15. 15. HAR (Http Archive Report)• Exports HTTP tracing information for performance analytics
    16. 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. 17. Cross Browser Testing with Grid 2.0
    18. 18. SikuliWebDriverSikuliFirefoxDriver extends Seleniums FirefoxDriver by adding Sikulis image search capability. It is useful for automating interactions with highly visual interfaces such as Google Map.
    19. 19. “Testing is an infinite process of comparing the invisible to theambiguous in order to avoid the unthinkable happening to theanonymous.” - James Bach
    20. 20. For Queries write to me atsurenethiraj@gmail.comLinked In: in.linkedin.com/pub/surendran-ethiraj/5/946/a11
    1. A particular slide catching your eye?

      Clipping is a handy way to collect important slides you want to go back to later.

    ×