Smarter ways to do selenium automation @ work, Selenium, automation


Published on

No Downloads
Total views
On SlideShare
From Embeds
Number of Embeds
Embeds 0
No embeds

No notes for slide
  • Knowledge is free, it’s the experience which is priceless !I am here to share with you facts/experience of mine discovering Selenium Test Automation.
  • My inspiration, reason why I am here.
  • Introduction about myselfRuturaj – explored 6 yrs of Technical testing , worked on Agile models using XP/Scrum.Worked on Product testing like embedded, E-commerce, SAAS based ERP applications. Picture represent different stages of my life, current one being top left.
  • I wish to reduce pain of every one who wish to learn functional test automation, hence Selenium automation in better way.
  • Here to share facts – answer to question – ‘What’ is automation, ‘How’ to automate.FTA = Views , expectation from different roles in project.Selenium offering = Core, IDE, RC.Basics of Test automation.Learning from classic mistakes of test automation.Blue print of Selenium RC Test Automation framework.
  • Selenium automation is self exploration activity,There are no exact standards,Hence thoughts expressed here are just one of the better ways of doing things.
  • FTA in our context - In Short Automating functionality provided by Web application.I am trying to define ‘What’ it means when we do functional Test automation, so defining ‘What’.B – Agile/iterative/faster software development, hence tester role is far more critical in verifying software works.Multitasking – communication bridge, software police, Test coder, domain expert in team.Why Automation – quick, accurate, precise feedback for software development.
  • A - Fastest feedback for Agile development.B – If test verifications are not dynamic, they are of lesser use for feedback for development.C – Wrong Philosophy = ‘Test code written should have minimal bugs(practically zero)’
  • L Change is persistent nothing else !Its never too late for anything good, positive, changeable.Soul Tester is negative which is fine(Its in genes !), but They are not agile*. They are aware of technology, but they are not ‘on’ to it !BBT - Applying cream from outside to cure internal disease.BTM –Logical tester with in depth Technical skills.
  • Automation Test Strategy / Automation Plan – only if its updated as per execution cycle.
  • Selenium for functional or system testing of web applications. These tests are also sometimes called acceptance, customer, or integration tests.Selenium is not meant for unit testing
  • Issues with Selenium Core
  • Selenium IDEWalk through testsDebug and set breakpointsSave test in .java, .py filesSupport for Selenium user-extensions.js file
  • Selenium IDEWalk through testsDebug and set breakpointsSave test in .java, .py filesSupport for Selenium user-extensions.js file
  • Selenium IDEWalk through testsDebug and set breakpointsSave test in .java, .py filesSupport for Selenium user-extensions.js file
  • Smarter ways to do selenium automation @ work, Selenium, automation

    1. 1. 29-01-2011<br />Selenium Learning Ruturaj 1.0<br />1<br />
    2. 2. 2<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />Knowledge is free, it’s the experience which make’s it priceless - Ruturaj<br />
    3. 3. 3<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    4. 4. 4<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    5. 5. Selenium @ Work<br />“Smarter ways of doing Selenium Automation”<br />Ruturaj<br /><br />Make Technology available for masses, to bottom of pyramid, you will see how life will change after this !<br />
    6. 6. Objective<br />Take away Thought’s from talk<br />Functional Test automation views, expectations and preparation. <br />Understanding Selenium offering.<br />Pointers towards basic for Test automation for tester to start automation.<br />Learning what not to do in Test automation.<br /> Selenium RC Automation Framework what’s generic what’s specific.<br />6<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    7. 7. Context Driven Learning<br />Disclaimer – These are my views based on my experience, hence think of background(Context) before using them directly.<br />Context Driven<br />Selenium Learning<br />One Size Doesn’t Fit All.<br />7<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    8. 8. Functional Test Automation<br />Background ,views ,Thought process, Expectation<br />
    9. 9. Automation from different Perspective<br />Product Managers/Test Manager Perspective.<br />Automation must for ‘Early cycle Testing ‘ in Agile/Iterative development.<br />Accuracy of verification in Automated ‘test cases’ is important as They would be fully replaced by “automated test script”.<br /> Can’t afford if tester/automation engineers makes ‘any mistake’.<br />9<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    10. 10. Tester’s perspective – Bugs in Testers approach for technology<br />Lazy, ‘why should I Change’ Approach.<br />Tester’s are less adaptive to technologies(less agile*).<br />After Realizing mistake, feeling of ‘missed the bus of opportunity’.<br />Black Box Testing – a mystery for me.<br />Big time missing = = Technical tester.<br />10<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    11. 11. Tester’s perspective – what can be done better(Ideally !) <br />Gel Well with Developers until you learn technology, if not at least learn Technology on your own.<br />Understand What people do when they automate(that’s Montessori). How to automate(as per me) is PH. D .<br />Learn basics of Web technology – HTML, java script, how browser works, what goes underline when we click something ?<br />11<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    12. 12. Defining What to automate, what not to, when to automate.<br />Automation Test Strategy / Automation Plan – only if its updated as per execution cycle.<br />Selenium is one of the better tool I come across to automate web application(flow in website’s). <br />Gradual approach to automation, do it in bits and pieces, do it perfect, gradually build it up.<br />Experienced Tester must do automation or something in Non functional Requirement Testing (E.g. Security testing, Usability, Performance, …)<br />12<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    13. 13. Selenium for Functional Test Automation(Web Apps)<br />
    14. 14. Selenium Learning Pyramid<br />14<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    15. 15. What you can automate using Selenium (Learning 0.1.0)<br />Selenium - functional testing tool for web based application.<br /><ul><li>Multi Browser support.
    16. 16. Support to write test cases in many OO languages(java, C#, Perl, Python, Ruby).
    17. 17. Simple API/functions for interaction with HTML Elements.
    18. 18. Easy to use Selenium IDE(recorder) for those who want to start automation, just for Start. </li></ul>15<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    19. 19. Selenium Offering – what do we have to consume ;)<br />Selenium Core<br /><ul><li> Selenese languages(looks very similar to html).
    20. 20. Selenium is bundled with all further offering like IDE, RC, Grid.</li></ul>Selenium IDE (Recorderfor Firefox).<br />Selenium RC (allow you to run test written in programming language to run from anywhere.)<br />Selenium Grid (Multiple RC server running on same/different machine for parallel test run.)<br />16<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    21. 21. Simple Selenium Core Action<br />17<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    22. 22. Selenium Core References<br />What not to do with while starting with Selenium Core.<br />Trying to automate website which is not following Same origin policy.<br /><br />18<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    23. 23. Selenium IDE- Recorder for Firefox<br />Firefox plug-in for easy record and playback of tests.<br />Intelligent field selection will use IDs, names, or XPath as needed<br />Helpful for simple HTML script development and execution(provides auto complete for common Selenium commands, debugging test execution , addition of custom extension) <br />Save tests as HTML scripts, or any other language script.<br />Option to automatically assert the title of every page<br />19<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    24. 24. 20<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    25. 25. Selenium IDE- Limitations<br />Record and playback of IDE tests is possible only on fire fox browser.<br />Selenium IDE can execute script created in Selenese (HTML like) only.<br />It’s difficult to use Selenium IDE for checking complex test cases involving dynamic contents.<br />No direct support for condition statements, iteration, error handling, particularly unexpected errors, test case grouping,<br />Execution report not customizable to more extent.<br />21<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    26. 26. Where/When to use IDE then ?<br />Selenium IDE is best suited for simple happy path verification with least time to test script development.<br />To make Tester’s life easier - faster sanity check, regression verification provided test script you have recorded have enough valid verification’s. <br />In Agile team for quick and dirty automation(to start with..).<br />22<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    27. 27. SeleniumRemoteControl<br />A proxy server written in java, which automatically launches and kills browsers.<br />Allows to write test code in your favorite language<br />Java<br />Python <br />C# (.NET )<br />Ruby<br />Perl<br />Multi browser support by providing browser mode as *iehta, *firefox or *chrome in selenium object initialization. <br />Selenium RC supports HTTP and HTTPS based sites.<br />23<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    28. 28. Selenium RC Through my eye’s(Architecture)<br />24<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    29. 29. Selenium RC Setup<br />Download the latest version of Selenium RC jar.<br />Selenium RC gives freedom to run test/suites from your own machine by starting Selenium server on your machine.<br />Start Selenium Server(open command prompt, go to directory where selenium-server.jar exist, type in below command.<br />java -jar selenium-server.jar<br />25<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    30. 30. Selenium RC setup 2<br />Download the selenium-client driver, add the jar to your automation project’s library folder.<br />Your automation project should have a base class where selenium object is to be initiated.<br />Eg. There are various ways in which you can get selenium object initialized, but its nice to do in common place.<br />selenium = new DefaultSelenium(“localhost”, “4444″, “*firefox”, “”);<br />26<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    31. 31. Choosing right ingredients<br />27<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    32. 32. Language for Selenium automation, Owners of Script maintenance<br />Thumb rule – Use same language as that of application development language.<br />Also Keep in mind skill set possessed by team whose going to work on it(QA’s – Test Developers).<br />Define owners for test script maintenance, in shorter teams, developer’s owns acceptance test script, QA’s own regression suites.<br />28<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    33. 33. Problems I faced using Selenium <br />When there were Ajax request/responses everywhere on page, writing custom waitFor method was painful.<br />Few API doesn’t work on specific version of IE/FFX.<br />Slowness of IE test execution due to wrong usages of locators.<br />Working on element involving recursive java script calls on ‘onClick’ event.<br />29<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    34. 34. What is tough to automate using Selenium<br />If your website has lots of Flash/Flex component, Selenium automation is tricky.<br />Similarly if test needs to interact with any non native object in html like calendar, Rich Text FCK Editor, it is tougher to do so.<br />Automation of web page involving multiple frames.<br />Testing functionality provided by third party tools – outside scope of test automation tool.<br />30<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    35. 35. Generic subsets of Automation Frameworks<br />31<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    36. 36. 32<br />Selenium Learning Ruturaj 1.0<br />29-01-2011<br />
    37. 37. Selenium Learning Ruturaj 1.0<br />The Pareto Principle<br />33<br />29-01-2011<br />