What Are Selenium Testing Frameworks
Posted By : Sandeep Rathor | 20-Sep-2017
So first, we need to understand what is a framework, what is selenium framework and where we can use frameworks in our selenium projects.
Frameworks are basically considered a combination of the set of Rules, Protocols, Standard, and guidelines that can be incorporated as a whole. Selenium Frameworks is a code structure through which we can increase the maintainability of our code. If we don't use the framework so that we have to place our "data" and "code" due to which we can neither re-use it nor we understand this. Selenium Framework lets us understand the complete and proper structure of our selenium code, it provides higher portability, cost-effective, re-usability of our code, reduces script, increases the code readability, easy reporting, maximum coverage, etc.
I hope now you will be able to understand what is a framework and how does it affect our code management in selenium projects. Selenium framework is not only one type there are many types of the framework through which we can achieve our goal and make our project compatible. These frameworks are
1.Module Based Testing Framework
2. Library Architecture Testing Framework
3. Data Driven Testing Framework
4. Keyword Driven Testing Framework
5. Hybrid Testing Framework
6. Behaviour Driven Testing Framework
Now let's have to look these frameworks in a hierarchy way

Now I hope this is clear to you all what is a framework and what are their types and how much they help us in automation project. Now have look towards modular based testing framework with its advantages and disadvantages
Module Based Testing Framework
This model is based on OOPS concept i.e Abstraction. In this framework, test scripts are written in a format that to match the functionality that represents module of that application-under-test. In this for each module, we can create the separate modules and separate script. Thus, this module together builds a large test script which represents more than one module.

Let's understand with code
This is a common file where we have to write our elements in a modular way
@FindBy (xpath="//button/span[text()='Sign in']")
public WebElement SignIN_Button;
@FindBy (xpath="//a[@title='YouTube Home']")
public WebElement Youtube_Home;
@FindBy (id="identifierId")
public WebElement Username;
@FindBy (name="password")
public WebElement Password;
@FindBy (xpath="//span[text()='Next']")
public WebElement Next ;
@FindBy (xpath="//input[@title='Search']")
public WebElement searchBar ;
@FindBy (xpath="//a[@title='Jana Gana Mana - National Anthem']")
public WebElement NationalAnthem ;
@FindBy (xpath="//button[@title='Theater mode']")
public WebElement Theater;
Now in your signIN() class you can use them
public void SignIN(){
PageFactory.initElements(driver, this);
WaitForElement(10,Youtube_Home);
SignIN_Button.click();
Username.sendKeys("[email protected]");
Next.click();
Advantage of Module Based Testing Framework
- Easy to Maintain
- Scalability of automated test script is independent to write
- Framework is pretty much scalable
- if you want to fix any script of the module then other parts are untouchable
Disadvantages of Module Based Testing Framework
- Difficult to debug whenever a test case failed
- Implementation of test script for each module sometimes is difficult
Now in another blog, we will be understanding about other testing frameworks
THANKS
Cookies are important to the proper functioning of a site. To improve your experience, we use cookies to remember log-in details and provide secure log-in, collect statistics to optimize site functionality, and deliver content tailored to your interests. Click Agree and Proceed to accept cookies and go directly to the site or click on View Cookie Settings to see detailed descriptions of the types of cookies and choose whether to accept certain cookies while on the site.
About Author
Sandeep Rathor
Sandeep is an experienced QA Engineer with skills in Manual testing, Automation Testing and Performance Testing over both Mobile and Web Application