Learn Technology What you really want

The future is closer than you think. You can pay attention now or watch the transformation happen right in front of your eyes.

Close

Different Frameworks in Selenium

Posted on April 13th, 2020 Selenium Journals

Welcome to my blog on different frameworks in Selenium. I hope people reading this already have a good understanding about Selenium. People you don’t have don’t worry. I will give a light intro before smelling the flavour of the framework.

An Overview

SELENIUM is an open-source automation testing framework that we use to validate web applications across different browsers and platforms. So you can automate any web application which is running on the browser. Whatever the use performs in the website like Click Targets, Fill Some Forms, Drag and Drop everything is possible.

Okay, we have everything in selenium, then why do i need this Framework ? Why is everyone talking about Framework ?.Actually what is Framework ? 

Top Different Selenium Frameworks

Different Types of Selenium Frameworks

A framework includes code libraries, a compiler, and other programs used in the software development process. Yes it makes your job easy. Let’s assume a car you drive but what is a self driven car?. So you are making some process more automated and easy that’s it.

Frameworks in selenium are not concepts from Selenium, but its few libraries or features that we use from other programming languages. Let’s say, I am taking an example from Java, because I know java.

  1. Excel sheet read and write by Java using Apache POI
  2. Java Reflection -> Read |  Call the methods or function of your class from outside
  3. Oops Concept 

Apache POI Excel Read helps to read the test cases steps and data to pass to Java methods where it invokes the Selenium libraries. The Reflection from Java is used to smell Java methods and call them. In excel we have a keywords section that is nothing but methods which we created in Java. That method gets the inputs from excel and calls your selenium methods.

The hybrid framework is a mix of keyword driven and data driven framework.

Hybrid Framework

We discuss about Hybrid Framework in selenium, there are few other frameworks called Keyword and Data Driven but this is mixing of both, the best word to use is best cocktail so you know both.

Let’s take a small example: I need to fill the application form, which has few elements to fill like Name, Mobile, Course etc. 

How do you automate this without any framework ?

  1. Find the element of Name, Mobile , Course , Text box of How can We help and Submit.
  2. You use sendKeys ( “  Sample “) to all text area.
  3. You use click() to click the Submit button. 

 Here if you want to fill this form for 10 times with a different data set how do you achieve ?

Suggestion: Have a loop and call the sequence , but for different data I need to run.

Now we use Framework, we don’t use any new concepts from Selenium, we just feature java.

Note: Element Type I used because I will pass what type of element to don’t duplicate my keywords, else I need to duplicate my methods as enterByElementId, enterByElementName.

  • Excel you read by Java Apache poi libraries and keep giving supply to your Java
  • Java use Reflection concepts and invoke the respective methods from your Java Classes
  • Selenium function are invoked from your java 

So here the excel has a keyword, ( method to call or step to execute ) and Data to enter. So the action and data pass happens in a single step.

Like you can have more data sets to run your test cases for different data sets and you can add many test steps as per requirement. Even the team who don’t have selenium knowledge can use this excel sheet to load different data sets and steps. Since we are using excel even you can add another column to update the test case is SUCCESS / FAIL.

If you wish don’t want to maintain the data here, you can loosely couple the data field and have only action then it becomes a keyword driven framework. Adding more flavour to this framework you can think about to integrate the TestNg and Extends Report. If you have TestNg you can make the framework more powerful. 

Hope you like the blog and suggest any best blogs from selenium to share.

For any help on Selenium Certification Training.

Related Posts

Things you should know to run Python Programs

An Overview I will give you a small hint about basics that you should know before we jump on to this topic.  You should know the following if you want to run python programs. Python Interpreter is a program that runs the python programs you write.  Source code which would . .

December 20, 2019

Python Journals

How Data Science is creating demand different sectors now?

Data Science is in Demand Now that you are aware that demand for Data Science is booming high, you should understand how Data Science is used in different sectors. Before that we should know what Data Analytics is all about?. We can recognize future trends or results based on historical . .

Top Key Things to Know for a Data Scientist to work on a Data Scientist Project

An Overview Data Science Project Cycle Overview: Welcome all.. I am sharing some of my knowledge on Data Science and some interesting facts that I learned in real time data science with python project that I worked on. It’s really fascinating to work on real time data science with python . .

Facebook
Instagram
Twitter
Linkedin
YouTube

Nearby Locations: Ramapuram, DLF IT Park, Valasaravakkam, Adyar, Adambakkam, Anna Salai, Ambattur, Ashok Nagar, Aminjikarai, Anna Nagar, Besant Nagar, Chromepet, Choolaimedu, Guindy, Egmore, K.K. Nagar, Kodambakkam, Ekkattuthangal, Kilpauk, Medavakkam, Nandanam, Nungambakkam, Madipakkam, Teynampet, Nanganallur, Mylapore, Pallavaram, OMR, Porur, Pallikaranai, Saidapet, St.Thomas Mount, Perungudi, T.Nagar, Sholinganallur, Triplicane, Thoraipakkam, Tambaram, Vadapalani, Villivakkam, Thiruvanmiyur, West Mambalam, Velachery and Virugambakkam.

Copyrights © 2024 Bit Park Private Limited · Privacy Policy · All Rights Reserved · Made in BIT Park Pvt Ltd