Test Automation Framework Overview and Strategy Manjula Perera
- Slides: 34
Test Automation Framework Overview and Strategy Manjula Perera, 24. 05. 2012
Contents 1. 2. 3. 4. 5. 3 Software Framework The Easy Way The Better Way Introduction Page. Object Pattern Automation Framework Approaches Data/Table Driven Framework Keyword Driven Framework Hybrid Framework Generic Architecture Guidelines and Lessons Learnt Test Organization Test Writing Style Browser Updates Test Automation Framework l 24/05/2012
Software Framework What is a software framework? 4 Test Automation Framework l 24/05/2012 1
Software Framework The definition and key components A software framework is a universal, reusable software platform used to develop applications, products and solutions (Wikipedia, 2012). Software Frameworks include, 5 ○ Support Programs ○ Compilers ○ Code Libraries ○ APIs ○ A tool set to integrate different components Test Automation Framework l 24/05/2012
Software Framework properties A Software framework contain key distinguishing features that separate them from normal libraries. They are, 6 ○ Inversion of Control (IOC) the overall program's flow of control is not dictated by the caller, but by the framework. ○ Default behaviour must actually be some useful behavior and not a series of instructions. ○ Extensibility can be extended by the user usually by selective overriding or specialized by user code providing specific functionality. ○ Non modifiable framework code is not allowed to be modified. Test Automation Framework l 24/05/2012
The Easy Way What is the easy way to automate? 7 Test Automation Framework l 24/05/2012 2
The easy way Records all user activities and play back Typically a software testing suite will allow the tester to use the SUT as a user would, through the browser. In the background the testing suite records all of the clicks and key presses and discards any context. Later, the recorded events are played back and various assertions are made to ensure the output matches that which is expected. 8 Test Automation Framework l 24/05/2012
The easy way Pros and Cons Pros Easy and does not required highly skilled software developers Large portions of the application can be covered quickly • • Cons Small changes to the SUT cause massive disruption in the tests • Entire suites of tests can be rendered useless resulting in reduce testing coverage for extended periods of time • Test maintenance becomes hard • Tests begin to stagnate • Team confidence, in the tests, is reduced. • 9 Test Automation Framework l 24/05/2012
The Better Way What could be a better way of automating? 10 Test Automation Framework l 24/05/2012 3
The better way Introduction Treat automated testing as software development. Tests should be created with the same concern for software design principles such as, • Reduced coupling • High cohesion • Proper separation of concerns • Maintainability • Reusability 11 Test Automation Framework l 24/05/2012
The better way Page. Object pattern The Page Client view of the page 12 Test Automation Framework l 24/05/2012 Page. Objects Extracted page objects
The better way Page. Object class 13 Test Automation Framework l 24/05/2012
The better way Dos and Don’ts In Page. Objects, • The public methods represent the services that the page offers • Try not to expose the internals of the page • Generally don't make assertions • Methods return other Page. Objects • Need not represent an entire page • Different results for the same action are modeled as different methods 14 Test Automation Framework l 24/05/2012
The better way Pros and Cons Pros • Selenium Web. Driver supports • Increased maintainability • Increase test stability • Readable tests • Tests are easy to author Cons • Larger up-front cost for creating Page. Objects • More skill is required to create Page. Objects 15 Test Automation Framework l 24/05/2012
Automation Framework Approaches What are the available automation frameworks? 16 Test Automation Framework l 24/05/2012 4
Automation Framework Approaches Data/Table Driven Framework Data driven is the design of possible inputs what may given by the end user. This would cover maximum probabilities of an input data. It can be a spread sheet or a DB. We have to connect and pass the values to the respective field or element. • Take advantage of tester’s familiarity with test case creation using tables and matrices • Accommodate localization projects • Recognize the importance of patterns in test cases • Enable testers to catalog test cases with Excel spreadsheets • Enable testers to specify expected results in spreadsheets 17 Test Automation Framework l 24/05/2012
Automation Framework Approaches Data/Table Driven Framework 18 Test Automation Framework l 24/05/2012
Automation Framework Approaches Keyword Driven Framework Keyword driven framework is an action based test method used in planning and implementation of automation. 19 Test Automation Framework l 24/05/2012
Automation Framework Approaches Hybrid Framework A mix of Data driven and Keyword driven frameworks. 20 Test Automation Framework l 24/05/2012
Automation Framework Approaches Generic Architecture A Test Automation Framework should have a multi -tiered architecture. It should consists of the following tiers. • • Domain This tier is meant to contain only page objects that work against the engine. • Utils This tier is meant to contain very generic, reusable functionality across all the other tiers. • Functional Tests This tier will contain tests that are built on top of MSTest to create actual test scenarios by using page objects in the Domain. 21 Test Automation Framework l 24/05/2012 (MSTest) Test Execution Engine Functional Tests Domain Engine Selenium Web Driver API Utils Engine Components in this tier are completely responsible for interacting with the Web. Driver interfaces. Test Automation Framework
Guidelines and Lessons Learnt Some important points to keep in mind 22 Test Automation Framework l 24/05/2012 5
Automation Framework Approaches Guidelines for Automation framework design • Selection of a framework • Don’t reinvent the wheel - Make use of Selenium Web. Driver functionalities • Reusability • Support of different application versions • Support of script versioning • Different environment for development and production • Externally Configurable • Minimal changes required for any object changes • Execution - Individual, batch, only failed etc • Status monitoring • Reporting • Minimum dependency on Automation tool for changes 23 Test Automation Framework l 24/05/2012
Automation Framework Approaches Guidelines for Automation framework design • Easy debugging • Logging - Errors, warnings, etc • Easy to Use • Flexible - Should not impact existing test if changes are required • Performance impacts • Coding Standards 24 Test Automation Framework l 24/05/2012
Functional test organization Physical file organization Test script files (. cs files) are organized into a folder structure much similar to the web application’s page structure. Reasons to select this approach: – Easy access to tests – Testing a section of the application is easy 25 Test Automation Framework l 24/05/2012
Functional test organization Test class naming convention Test class name should start with the containing folder name. Reasons to select this approach: – Easy to group tests based on test class – Testing a section of the application is easy 26 Test Automation Framework l 24/05/2012
Functional test writing style Behavior Driven Development Style Tests It is important to be able to break down a test scenario into the components of a behavior driven test to ensure clarity. Very concisely the test writer should be able to dictate a test scenario as: Given <a precondition> When <an action takes place> Then <expected outcome should be present> 27 Test Automation Framework l 24/05/2012
Functional test writing style Behavior Driven Development Style Tests 28 Test Automation Framework l 24/05/2012
Functional test writing style Behavior Driven Development Style Tests Reasons for selecting this approach: – This style of test writing allows for a test case to be easily verbalized and comparable to the system requirements being validated. – Since this effort is heavily focused on UI automation, it makes sense to capture test cases dictating every behavior of the system and the user. 29 Test Automation Framework l 24/05/2012
Browser Upgrades What if the browser upgrades automatically? Have a portable version of the browser – Package it with your framework – Starts when the test suite starts – 30 Test Automation Framework l 24/05/2012
A Possible Approach Can we automate the automation tests? 31 Test Automation Framework l 24/05/2012
Summary – Automation should be considered as a development project and not just record and playback of events. Starting automated testing with a good framework ensures low maintenance. Guidelines discussed in this paper can be used as input for developing requirements for a framework. 32 Test Automation Framework l 24/05/2012
References http: //code. google. com/p/selenium/wiki/Page. Objects http: //knowledgeinbox. com/articles/automation/frameworks/guideline s-for-automation-framework-design/ http: //qaselenium. blogspot. com/2010/11/selenium-automationframework-design. html http: //en. wikipedia. org/wiki/Software_framework 33 Test Automation Framework l 24/05/2012
Thank You
- Behavior driven development
- Fabiana sofia perera
- Graciela perera
- Anuradha perera model
- Lakeesha perera
- Statistics
- Doreen perera
- Poliespecificidad
- Dinuka perera
- Spring framework overview
- Eylf meaning
- Nist cybersecurity framework overview
- Test strategy includes
- Theoritical framework example
- Test automation roi metrics
- Mof itil
- Sap test management
- Automation test
- Sitecore test automation
- Test automation for insurance
- Corporate strategy and business strategy
- Chase aggregate plan example
- Dispositional framework vs regulatory framework
- Iso/iec/ieee 42010
- Theoretical framework
- Dispositional framework vs regulatory framework
- Conceptual framework vs theoretical framework
- Loop #2 of hill’s generic strategy framework
- Global saturation
- 6 paths framework
- The afi strategy framework
- 4 actions framework example
- What is afi strategy framework
- Boston matrix of coca cola
- Matching stage of strategy formulation framework