19
AUTOMATION TESTING FRAMEWORK DESIGN How to design automation testing framework

Autoframework design

Embed Size (px)

Citation preview

Page 1: Autoframework design

AUTOMATION TESTING FRAMEWORK DESIGN

How to design automation testing framework

Page 2: Autoframework design

INTRODUCTIONAutomation Testing framework is a way to organize the code so that can be:• Reusable• Scalable• Maintainable• Understandable• Workable

Page 3: Autoframework design

REUSABLE• A framework once written, should be used by multiple people across

same or multiple team not just for one project, but it should be used across multiple projects

• Using framework one can reduce the effort spent on ‘X’ component (library of code) which is already written or available

• Using the already available code will require less or no testing since the available code is not all new and its already in use

Page 4: Autoframework design

SCALABLE• Framework written should be scalable, meaning it should be used

from small to bigger project• Framework should also support multiple projects• Framework should be scaled to support multiple technologies and

tools• Technologies can be web or windows or even service based• Tools can be selenium, Robotium, Jbehave etc.

Page 5: Autoframework design

MAINTAINABLE• Framework should be easily maintainable, meaning the code need to

be segregated as a logical groups of same type (classes) and functionalities (methods)• Each and every code in framework should be documented so that

duplicate code will not emerge as a result lack of knowledge on existing code• Framework should be different entity from thet of test project, so that

changes to framework will go to framework project whereas changes to test goes to test project

Page 6: Autoframework design

WORKABLE• Framework should be usable by the team.• Framework should be pluggable and even less knowledge automation

test engineer should work with code using the framework methods

Page 7: Autoframework design

KINDS OF FRAMEWORKS • There are different kinds of framework and some of the most

commonly used automation testing framework are:• Data Driven Framework• Keyword Driven Framework• Hybrid Framework

Page 8: Autoframework design

DATA DRIVEN FRAMEWORK• Data Driven framework are used where testing relays on huge number

of input test data.• E.g. Online Candidate Form , which requires lot of input data to be

supplied by user with different combinations• These different combinations of data cannot be hardcoded in your Java,

C# classes. Hence they need to be pulled from external data sources• Hence data driven framework will have code to pull data from any of

the data source , which can then be used to populate data on app UI druing data entry operations

Page 9: Autoframework design

KEYWORD DRIVEN AUTOMATION FRAMEWORK• In Keyword driven frameworks both the app UI object and test data

are coded within Java or C# class files• Here each and every operations are represented as keyword e.g.

SendEmail(), Logout().• New test cases can reuse the existing keyword very easily• Easy to modify and maintain the code• Require more programming knowledge

Page 10: Autoframework design

HYBRID FRAMEWORK• Hybrid framework are the combination of Keyword driven and data

driven framework• Hybrid framework will pull data from external data sources and also

uses keyword to perform operation such as RegisterUser(), SendEmail() etc.

Page 11: Autoframework design

AUTOMATION TESTING MODELS• There are different kinds of models available, which can be used while

designing a framework, some of the most commonly used are• Behavioral Driven Development• Page Object Model

Page 12: Autoframework design

BDD• BDD – Behavioral Driven Development is based on Test Driven

Development (TDD) and it aims to bridge the gap between Busines analyst and developers.• BDD seems to be like a plain text, but they have their own syntax

based on certain tools

Page 13: Autoframework design

GHERKIN• Cherkin is the format for Cucumner specification.• It is a business readable, Domain specific language which will let

anybody to understand the software behavior easily, since they are PLAIN TEXT.• Gherkin has some spaces and indentation to define structure.• Gherkin has some spaces and indentation to define structure.• Gherkin has very few syntax which make the parser to behave based

on the structure.• The syntax of Gherkin is very simple and pretty readable as plain text

Page 14: Autoframework design

GHERKIN SYNTAX

Page 15: Autoframework design

BDD

Page 16: Autoframework design

PAGE OBJECT MODEL• Each webpage UI will have different objects (UI Elements) to interact.• These objects are identified and written in the code along with their

identification property• A Page Object simply models the objects within the test code. This

reduces the amount of duplicated code and means that if te UI changes the fix need only be applied in one place• The code looks like : @FindBy(name = “q”) public WebElement txtSearch

Page 17: Autoframework design

Designing Automation Testing Framework

Page 18: Autoframework design

POINTS TO CONSIDERAs mentioned in the framework design, we are going to usePage Object ModelExcel to drive dataCustom Selenium wrappersWrite framework as separate project

Page 19: Autoframework design

QUESTIONS??