• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

Like this presentation? Why not share!

Advanced Selenium Workshop

on

  • 3,436 views

The Advanced Selenium Workshop demonstrates how organizations and test teams succeed with Selenium and Open Source Test (OST) technology and methodology as a more affordable and flexible option to the ...

The Advanced Selenium Workshop demonstrates how organizations and test teams succeed with Selenium and Open Source Test (OST) technology and methodology as a more affordable and flexible option to the proprietary test vendors. Watch how to:
Use Selenium in Java, Python, Ruby
Data enable Selenium scripts
Selenium target locators for Ajax applications
How To Work with TinyMCE (and other Ajax components) in Selenium
Writing Selenium-based Test Object Libraries

Statistics

Views

Total Views
3,436
Views on SlideShare
3,430
Embed Views
6

Actions

Likes
1
Downloads
161
Comments
0

3 Embeds 6

http://www.scoop.it 3
https://si0.twimg.com 2
http://a0.twimg.com 1

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

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

    Advanced Selenium Workshop Advanced Selenium Workshop Presentation Transcript

    • Advanced Selenium WorkshopFrank Cohen, +01 (408) 871-0122, fcohen@pushtotest.com March 31, 2011
    • Open Source Test AutomationAbout PushToTest‣ Our Mission: We Test, For A More Reliable World‣ Make It Easier To Move From Manual To Automated Testing‣ Support Advanced Testing, including Agile, Load, Integration‣ Open Source Testing (OST) For Everyone2
    • Open Source Test AutomationAgenda‣ Using Selenium in Java, Python, Ruby‣ Data enabling Selenium scripts‣ Selenium target locators for Ajax applications‣ How To Work with TinyMCE (and other Ajax components) in Selenium‣ Writing Selenium-based Test Object Libraries3
    • Open Source Test AutomationSelenium Browser Automation‣ Selenium Core‣ Selenium RC‣ Selenium Grid‣ Selenium IDE‣ Selenium Domain Specific Language (DSL)4
    • Open Source Test AutomationWhat Is Selenium Missing?‣ Selenium Core and RC Require A Browser‣ SeleniumEnablement In Firefox Only, Coding Required To Be Useful, No Data IDE Record‣ Selenium Grid for Functional Testing Only‣ No Reports or Results Analysis‣ No Cloud or Grid Deployment‣ No CI or QC Integration‣ RIA Testing using Ajax, Flex, Flash5
    • Open Source Test AutomationSelenium Language Basics‣ Page Commands‣ Element Commands‣ Validation Commands‣ Assertion Commands‣ Storage Commands6
    • Open Source Test AutomationSelenium Locators‣ Identifiers ‣ loginForm ‣ id=loginForm ‣ name=loginForm‣ XPath (1.0 from W3C, no support of 2.0 and XQuery)‣ Link Locator ‣ link=Continue <a href=”mypage”>Continue</a>‣ DOM APIs ‣ dom=document.getElementById(loginForm)‣ CSS Selectors7 ‣ css=input.required[type="text"]
    • Open Source Test AutomationFun With XPath‣ /html/body/table/tr/td/a -> //table/tr/td/a‣ //div[@id=manage_messages_iterator] ‣ <div id=”manage_messages_iterator”> blah </div>‣ //tr[@class=’SelectedRow’]/td[1] ‣ <table><tr class=”SelectedRow”><td>me 1</td><td>me 2</td></ tr></table>‣ //td[child::text()=’myemail@me.com’] ‣ <table><tr><td>myemail@me.com</td</tr></table>‣ //td[contains(child::text(),’@’)]8
    • Open Source Test AutomationMiscellaneous‣ <a href=”continue.html”>Continue</a> ‣ link=Continue‣ RFC 1738 example ‣ http://myusername:myuserpassword@myexample.com/blah/blah/blah9
    • Open Source Test AutomationString Pattern Matches‣ glob:pattern ‣ * represents any sequence of characters ‣ ? represents any single character ‣ Matches against the entire string‣ regexp:regexp ‣ Match a string using a regular-expression ‣ Includes JavaScript regular-expressions‣ exact:string ‣ Equals‣ No pattern prefix means use "glob" pattern10
    • Open Source Test AutomationEvent Handling and Ajax‣ Selenium Tests Are Event Oriented ‣ Not Timing Oriented‣ Ajax Web Objects ‣ Complicated Structures ‣ Dynamic Values ‣ Asynchronous Events ‣ No Standards‣ Ajax Example11
    • Open Source Test AutomationFun With JavaScript‣ selenium.type("id", "frank");‣ selenium.type(“id”, “javascript{ new Date().getTime();}”);‣ Class Persistence Within A Page <tr> <td>assertEval</td> <td>myfunc = function ( myfile ) { alert(myfile); return 1 }; 1;</td> <td>1</td> </tr> <tr> <td>assertEval</td> <td>myfunc(&quot;frankolo&quot;)</td> <td>1</td>12 </tr>
    • Open Source Test AutomationLooping And Conditionals‣ Great For Ajax Asynchronous Events <tr> <td>waitForCondition</td> <td>selenium.browserbot.getCurrentWindow().document. getElementById(login_button).disabled == false</td> <td>10000</td> </tr>13
    • Open Source Test AutomationTinyMCE Editor API Access‣ http://tinymce.moxiecode.com/ selenium.browserbot.getCurrentWindow(). document.tinyMCE.execCommand (mceInsertContent,false,<b>Hello world!!</b>);14
    • Open Source Test AutomationDistributed Test Deployment Application Under Test TestNode Selenium RC SeleniumHtmlUnit Selenese Table Format Interpreter Selenium API Selenese Test TestMaker Console15
    • Open Source Test AutomationScript Runners ScriptRunner Type Sahi Sahi Test Tool HAR HTTP Archive Designer Script Designer Script Selenium HtmlUnit Browser Selenium RC IE, Firefox, Chrome SoapUI SOAP and REST TestGen4Web Web 1.0 Tests Mozmill Mozilla XUL Tests Unit Tests jUnit TestCase DotNet .NET Tests Visual Basic VB tests16 Command Line Desktop and utils
    • Open Source Test AutomationComponent Approach TestScenario Component Application Log-In Load Test 100 Users 500 Users 1000 Users setUp Data runTest Test Use Case Database Production tearDown Development RDBMS DPL Log-In Database CSV DPL Product Search Component QA Regression Order Product Custom DPL Database Confirm Order Component Load Test Log-Out Database Production17
    • Open Source Test AutomationTestMaker Object Designer‣ Point-and-Click Functional Test Record/Playback‣ Record Tests In IE, Chrome, Firefox, Safari, Opera‣ Automatic Ajax Synchronization‣ Drag-and-Drop Data Driven Testing‣ Creates Selenium, Sahi, and Flex Tests Demo18
    • Open Source Test Automation Next let’s talk about Performance Anxiety ‣ The Perfect Storm: IE 7, Selenium, Appcelerator ‣ Mitigation Research Prepared By Luis Carlos Lara, llara@pushtotest.com19 William Martinez, william@pushtotest.com
    • Open Source Test AutomationThe Problem 30 s Ajax App, Selenium RC, TestMaker, Firefox 3 30 m Ajax App, Selenium RC, TestMaker, Internet Explorer 720
    • Open Source Test AutomationHow Bad?‣ The IE 7 JavaScript engine runs up 8-times slower than Firefox 3‣ Appcelerator’s page compiler does not appear to be optimized for IE 7 performance. ‣ We observed 30% performance difference in the way Appcelerator runs text fields between IE 7 and Firefox 3.‣ Some commonly used Selenium functions are not optimized for performance. ‣ We observed a 1798% performance difference by using different Selenium element locator techniques.21
    • Open Source Test AutomationTest 1: No JavaScript‣ Simple (almost no JavaScript) page (Google)‣ The total for IE. of the tests were similar. 3800 ms for Firefox and 4000 ms results22
    • Open Source Test AutomationCaching Impact‣ Firefox Caches JavaScript Objects‣ Repeat for 1 Minute:‣ Plus IE7/Selenium Exceptions (8 times): Permission Denied23
    • Open Source Test AutomationTest 2: Ajax Application‣ Javascript heavy site ‣ Appcelerator’s Calendar sample that ships with PushToTest TestMaker 5.2.324
    • Open Source Test AutomationResource Utilization Firefox 3 IE 725
    • Open Source Test AutomationElement Locator‣ Selenium Type Command using various element locator functions‣ This may be because of: ‣ Slow JavaScript engine in IE. ‣ Selenium not optimized for IE.26 ‣ Slow xpath system engine (if any) in IE.
    • Open Source Test AutomationMitigation‣ Run functionaltimes.in Selenium RC with IE 7 and expect very long functional test tests ‣ The test will complete eventually. ‣ Do not compare the performance to the same test running on other browsers.‣ Run functional tests using HTMLUnit with an Internet Explorer profile. ‣ Simulates IE functionality while using the faster Rhino JavaScript engine provided in HTMLUnit.‣ Details on PushToTest support for Selenium are found at http://selenium.pushtotest.com.27
    • Open Source Test AutomationBest Practices‣ Build Test Components ‣ Treat your tests as software ‣ Easier to maintain ‣ Resilient to application changes‣ Apply JUnit-style Test Techniques ‣ Set-up, Run-test, Tear-down methods ‣ Write Stateless Test Components ‣ Test puts application into the correct state28
    • Open Source Test AutomationWe Recommend Do Don’t Components Pause Record -> Script Use Static Values Dynamic Locators Storage Values Work With Devs Test and Trash Events Expect The Same29
    • Open Source Test AutomationResources‣ http://www.pushtotest.com/download-testmaker6-preview‣ http://seleniumhq.org‣ http://selenium.pushtotest.com‣ http://refcardz.dzone.com/refcardz/getting-started-selenium‣ http://refcardz.dzone.com/refcardz/getting-started-selenium-20‣ http://www.pushtotest.com/products-comparison30
    • Open Source Test AutomationWhere To Go From Here‣ Please Complete The Evaluation Form ‣ And We Will Send You The Slides‣ Watch A Screencast and Tutorial ‣ http://www.pushtotest.com/screencastcentral‣ Attend An Open Source Test Workshop ‣ http://workshop.pushtotest.com‣ Ask For A Proposal on Licenses, Training, Support, Consulting ‣ Troy Amyett, +01 512-750-8769 (USA, Texas), troy@pushtotest.com31