- Thank Camelot, Bernie, Alan, Team & Komal- Image reference http://thenextweb.com/shareables/2012/03/04/geek-love-10-reasons-to-date-a-geek/
Start simple and small steps towards improvements based on our current knowledge.Improvements and increased knowledge will expose new limitationsEvolution is in respond to changeSet expectation – will start from IDE and move to a decent framework by taking one step at a time.Image from http://grunty.files.wordpress.com/2010/08/human-evolution-21c.jpg
- Problem statement
Selenium IDERecord & PlaybackInstant gratificationBut important to understand it’s limitations and move on.
Export processExplain Script / benefits and ease of exporting scriptxUnit – how it’s used by WebDriverLimitations
Slightly modified and improved scriptCan perform thorough checks such as DB checks, network checks etcGenerate unique names
Explain tight coupling & it’s problems in the existing script.Coupling makes everything complicated as everything depends on everything
Benefits of decouplingIndividual parts are easier to manage and changeFaster development – changes are containedAbstraction – manage complexityStep towards more readable, maintainable test
Decouple physical world - Page ObjectsChanges in IDs will not affect the test now
Test still aware of page and so real implementation.Abstraction not at right level – registration is pretty much exposed and will be copy pasted Explain annotations & factory method
Intelligent page object - Registration logic is now moved to the page objectProblemsTest is aware of the appTest should be at the conceptual levelDependencies should be avoided from both directions.
- Discrete functionality or a piece of work which user can perform.User completes registrationIf there is any change in how user is registered on site – test will still remain the same.What if we decide to add more fields for user?
Be aware of data and convert it into domain when make sense.Benefits of domain objectExplain problems
Final test scriptClose to businessChanges and how they will be contained @ specific places and how test will remain intact.
Conceptual model of app, work and interfaceBig picture – what problem app is solving, who are the actors – help in modelling and refactoring
Questions to askHow tests are looking? Are they abstracted at the right level?What is page changes?What if feature consume or display more data then before?What if checks are enhanced / introduced?What if presentation changes?http://www.gembapantarei.com/2009/04/12_leader_standard_work_questions_to_ask_on_the_ge.html
ProgressTests which were aware of low level details on the page & registration process toHigher level tests which are aware of business domainWork and Checks are abstractedI know everything – sign of a bad code.Image from - http://www.sodahead.com/fun/makes-everything-easy-for-dummies-have-you-ever-used-one-of-the-books-from-the-for-dummies-series/question-2162751/?link=ibaf&q=i+know+everything&imgurl=http://images.sodahead.com/polls/002162751/4452224133_I_know_everything_answer_2_xlarge.jpeg
Transcript of "Selenium conference 2012 - One Step At A Time"
One Step At A Time Anand Ramdeo @testinggeek
Firefox Plugin Sequential easy to install execution Record & Not easy to Playback data drive Easy execution No Basic Programming constructs Help @ Hand Can not go beyond pages Export asWebDriver Script Crawling is fun but weExcellent First Step don’t crawl anymore
Power of xUnitDifferent FrameworkBrowsers Java, C#,Python, Ruby etc Step in right direction - but miles to go..
Clear is hiddenGuaranteed Username Checks are hidden