1. Why do we need automation framework?
Organized project files/in structured manner.
1.1 Main Objectives of Automation Framework -
a) Re-Usability
When we create any functions, it should be reusable multiple times.
If we want to add multiple test cases into existing framework, we should be able to add it without any error.
Example- Utility Files, Data Providers.
b) Maintainability
Maintainability in testing is verifying the software’s ability to maintain itself as it goes through several changes.
Any Modifications should be possible without impacting any other test cases
c) Readability
Readable code takes less time to understand, to hand over to your colleagues or clients and to update.
Code could be written in simple java language that is readable for beginners as well.
2. Types of framework.
a) Built-In framework
In simple language , Framework that has already been developed, which is already available , all we need to do is
to use it in our application.
Example of Automation Frameworks:-
i) TestNG -
TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionalities that make it more powerful and easier to use. It is a framework that is already available in the market, having many features like parallel testing, parameterization, data provider, annotations, grouping and many more.
ii) Junit -
It is an open-source testing framework for java programmers. This framework is also available to use, it has all the features that TestNG have. Then why do we need TestNG, it is because TestNG has some extra features that Junit doesn't have like Parallel testing, Report generation etc.
iii) Cucumber -
Cucumber framework is a widely used tool for Behaviour Driven Development because it provides an easily understandable testing script for system acceptance and automation testing. It offers a way to write tests that anybody can understand, regardless of their technical knowledge. Cucumber is written in the Ruby programming language and allows development teams to write tests in plain text using the Gherkin language, which is a business-readable, domain-specific language.
iv) Robot -
Robot Framework is a Python-based, extensible, and keyword-based automation framework for acceptance testing, acceptance test-driven development (ATDD), behavior-driven development (BDD).
These frameworks does not support all kind of languages
TestNG and Junit -> Supports Java
Robot -> Supports Python
However, only using built in framework you cannot complete the entire framework. There are certain things that needs to be added apart from the built-in ones.
b) Customized Framework
In customized framework, we already have a pre-base(built-in) framework. We add additional features and functions as per requirement, particular project, technology, the skills of the team, and other relevant considerations.
i) Modular Based Testing Framework -
Implementing a modular framework will require testers to divide the application under test into separate units, functions, or sections, each of classes is tested individually. After separating the application into individual modules, testers create test script for each part and then combined to build larger tests in a hierarchically. These larger sets of tests will begin to represent various test cases.
ii) Data-Driven Framework
The data-driven test automation framework is focused on separating the test scripts logic and the test. Most of the time, testers need to test the same feature or function of an application multiple times with different sets of data. It is critical that the test data should not be hard-coded in the script itself, which is what happens with a
Modular based testing framework. The test data set is kept in the external files or resources such as MS Excel Sheets, SQL Database, XML files,Json Files .
The test scripts connect to the external resources to get the test data.
iii) Keyword-Driven Framework
It is also known as table-driven testing, we use a table format to define keywords or action words for each function or method that we would execute.With this approach, keywords are also stored in an external data table , making them independent from the automated testing tool being used to execute the tests.
By using this Framework, testers can work with keywords to develop any test automation script, testers with less programming knowledge would also be able to work on the test scripts.
iv) Hybrid Testing Framework
As the name suggests, a hybrid framework is a combination of any of the previously mentioned frameworks. It attempts to leverage the strengths and benefits of other frameworks for the particular test environment it manages.
3. Phases/Stages of Testing
i) Analysing Phase
In software testing, test analysis is the process of establishing test cases by determining what needs to be tested and specifying the methods to do so.
What type of analysis needs to be performed?
a) Analyse the screen, the page and by doing so, the tester can determine how many page objects can be created.
b) What type of framework is used, is it built-in or customized?
c) What are the different types of elements used?
d) What to automate/what cannot be automated.
e) Some test cases needs to be verified manually, like color of page, font size, captchas, graphs that cannot be
automated.
i) Analysing Phase
Consider a tester has 50 test cases. So when it is said that test case is 100% passed. Does that mean all the 50 test cases were automated?
No – may be a tester can automate 40 test cases and other 10 that cannot be automated, may be those are manual test cases.
So when they automate all the 40 test cases that is 100% covered test case.
ii) BASED ON PRIORITY TESTER HAS TO CHOOSE TEST CASE
SANITY TEST CASE
The main purpose of this testing is to determine that the changes or the proposed functionality are working as expected.Sanity testing is a kind of software testing that occurs when a new software build is developed or when minor changes in code or functionality are made to an existing build. This covers the basic functionality. If Sanity test fails then the tester cannot proceed with further test cases.
2. DATA DRIVEN TEST CASE.
Data-driven testing is a software testing methodology where test data is stored in external data sources
like spreadsheets, databases, or CSV files, json files ,rather than hard coded into the test case, allowing the
same test logic to be executed multiple times with different sets of data.This methodology allows you to easily test many scenarios without manually re-executing the test case with each data set.
3.REGRESSION TEST CASE.
Regression testing means that old features are still working as they should when new features are introduced. New code may bring in new logic that conflicts with the existing code, and can introduce unintended breaks in functionality. Moreover, regression testing is a series of tests, not a single one performed whenever you add a new code. At initial stage of testing a tester will not know what will fall under regression testing. At that point the tester does not know what all bugs you will get and what bugs the developer will be able to fix. Based on those scenarios tester decides what test cases comes under regression.
iii) Design and development of framework
It is a blue print of how a tester will organize the test, what tools will be used, design of the framework, creating reusable components. Creation of framework and folder structure is called design
Adding of utility files,creating pageobjects.
iV) Execution
Execution happens locally and remotely
Local execution:
Consider the entire project is in eclipse. so the tester can execute the code within his eclipse.
Remote execution:
Pushing the code to remote repository and test it another workspace or some other machine , through selenium grid we can achieve remote execution.Executing the test case through jenkins.
V) Maintenance
The maintenance phase in the software development process is where the software is monitored to ensure it continues to function as it was designed to, and repairs or upgrades are performed as needed. After the software is released into production, updates or upgrades will need to be made.
****************************************************END***********************************************************
Comments