What is an Automation Framework ?

11
What is an Automation Framework ? Sriram Angajala – Testersworld.com

Transcript of What is an Automation Framework ?

Page 1: What is an Automation Framework ?

What is an Automation Framework ?Sriram Angajala – Testersworld.com

Page 2: What is an Automation Framework ?

Description

• Automation Frameworks is an analogy used for a typical project in software in automation testing world

• AF is a project which have need to full fill the purpose of automation test suite in effective way

• AF are divided into many categories but based on the requirement of the project automation framework is used

Page 3: What is an Automation Framework ?

What people say are frameworks

• People say they are few type of frameworks• Data driven• Function Driven• Keyword Driven

• Fact: They are supposed to the terms used in the world of QTP and Winrunner etc. After open source frameworks are used, now these frameworks no more make any sense

Page 4: What is an Automation Framework ?

Whats the Framework then??

• Framework: It is the project, its structure and its internals combined together called Automation Framework

• To make a robust automation framework they are few things we have to consider• PROJECT STUCTURE• TOOLS USED PART OF PROJECT• DESIGN PATTERNS USED • UTILITES AND SUPPORTED CLASSES AND OBJECTS

Page 5: What is an Automation Framework ?

What is the goal of automation framework?

• AF should make project easily maintainable• AF should write plenty of utilities and wrappers so the

further writing the code should be simple enough• In nutshell AF should create a solid platform and building

blocks for us to implement any new tests easily• AF should handle any unexpected errors with out

breaking the execution in middle• AF should log most of the information

Page 6: What is an Automation Framework ?

What to watch out in Automation Framework

• Reports including screen shots• Logging mechanism – to analyze test results and failures• Head lead test execution and jenkins/Ci compatibile• Easily changeable configuration – test/uat urls• Test data should be isolated properly – No hard code data• Hooks should be implemented (Before, Afters)• Locators should be isolated from hardcoding values• Easily Changeable Browsers and Remote Setting

Page 7: What is an Automation Framework ?

What’s the best for Selenium – Java Stack

• Tools• Cucumber JVM – for BDD tests(Gherkin), Step defs and

selecting test execution using tags. Also Hooks and Assertion

• Intellij – IDE to develop java code easily• Maven – Build code, automatic dependency, Command line

execution and unit test runner• Junit – Assertion and Annotations on top of Cucumber• Reports – Cucumber HTML reports and 3rd Party tools.

Page 8: What is an Automation Framework ?

What else required for better framework?

• Additional tools• Log4J – for logging mechanism• Properties files – for managing framework settings• cucumber-reporting – for better cucumber reports• JDBC – for DB connection• POI – for excel integration• Rest Assured – Api tests and calls for 3rd parties like slack,

test rail, hipchat etc• Visual Regression – Appli Tools

Page 9: What is an Automation Framework ?

What Design Patterns are used?

• Factory Methods – Use Browser Factory as single ton factory methods to generate driver object from single source

• Page Object Model – Use Page Object Model for Better code management, easy maintenance, reusable code

• Page Factory – To load locators dynamically and make elements as object and load them when required

• OOPS – for better manage page structure and base tests. Base tests, Base Pages

Page 10: What is an Automation Framework ?

What Utils are needed?

• Webdriver Utils – Many of the webdriver methods need to be over ridden and wrapped up into better methods to reduce rework – eg. SelectLastOption();

• System Utils – Waits, Get System Variables, Kill FF Browser etc

• Business Utils – Utils related to Login, Logouts etc.• Hooks – Before Class, After Class, Before, After etc• CLI – Create some CLI utils like –Denv=test to make test

to run and changeable to be flexible to run in jenkins.

Page 11: What is an Automation Framework ?

Conclusion

• Automation Framework needs are based on requirements of the test suite and project. So we cant have generic silver bullet framework. How ever use common tools, patterns and Utils to make framework robust