Automation Testing by Selenium is a bit of complex task because of the management and maintenance of the scripts. So therefore we need to use and develop the different types of frameworks in selenium webdriver.
- The structural way to implement the scripts for the better maintenance is known as frameworks.
- Maintenance means how we are implementing the automation scripts.
- It is easy to analyze, update, execute and analyzing the results.
Frameworks in Selenium:
- There are some frameworks given below:
- Modular Framework
- Data Driven Framework
- Keyword Driven Framework
- Hybrid Framework
It is the basic framework and also known as Linear Framework.
- The application will be divided into multiple Modules and Sub – Modules. The Software Tester will implement the automation scripts for all the modules.
- Once the automation scripts are stable, they will integrate in a hierarchical order to execute.
For example: Open URL >> Login >> perform some action >> Logout.
Data Driven Framework:
It is one of the advanced frameworks in Selenium. From Data Driven onwards, introduced external files. Like excel, Txt, xml, csv files etc. to take the input data as well as give the output result.
- It contains a driver script which is responsible for the test case execution.
- Driver script doesn’t contain any of the test case and test data, all the data will be available in the external file.
- The driver script will take the data from the external file and executes. Hence we will call as Data driven framework.
Advantages of Data Driven framework:
- If any change in the application will be happen then those changes will be updated in the external file, so the maintenance is very easy.
- The driver script will be implemented based on the common fields available in the application, it can be reusable for all kinds of applications.
- It is suitable for Agile based projects.
- If any application contains more no. of fields like, 100 text boxes, 100 buttons etc. Then it is not necessary to write those many lines codes to work on all fields. We can prefer data driven framework.
Disadvantages of Data Driven framework:
- Developing the driver script is a challenging task.
- Taking all the field locators into an external file is also a challenging task.
Keyword Driven Framework:
- Keyword means a step, it is a step by step execution.
- It is very similar to manual testing.
- The way we have used to implement the test cases in manual testing in the same way, we can develop the test scripts in the keyword driven framework with the help of TestNG and Junit.
Advantages of Keyword Driven framework:
- We are implementing the scripts in Manual testing format, so the maintenance is easy.
- TestNG and Junit are pre – defined frameworks, so it is not necessary to write any script to develop.
- Once the execution is completed, it will provide the results also.
Disadvantages of Keyword Driven framework:
- It is suitable for stable applications.
The combination of any two or more frameworks is nothing but hybrid framework.
- We can utilize the advantages of both the frame work in hybrid framework.