Overview:
In this tutorial, we will learn how to build Hybrid (Keyword+Data Driven) Framework and we will publish this tutorial in multiple parts. Initially, we will build up the core of Hybrid Framework. The core of Hybrid framework will look like. We will build up the core and integrate with webdriver and selenium RC. The features of the core will remain same for both webdriver and selenium RC.
For detailed tutorial series check here:
Steps involved to implement Core Hybrid Framework
In Data-driven framework we actually keep data in excel files and in a hybrid framework we have keywords as well as data in the excel files.
Rules for making XLS files in Hybrid framework
1) The primary file is Suite.xlsx
This file contains information about Test Suites.
2) Name of Suites.xlsx file should be same as the name of suite ID in Suite.xlsx.
3) Runmode for:
- Suite
- Testcase
- Data Set in Test Case
4) TCID in Test Cases sheet==TCID in Test Steps sheet
Step1: Create Eclipse project
Step2: Make package- com.selenium.test
Right Click on src->select Package
Step3: Make DriverScript.java, Keywords.java, Constants.java files in package
Step4: Make the package – com.selenium.xls
Step5: Decide your keywords, make test cases/suite in xls and copy xls files in com.selenium.xls package
Step6: Include selenium, POI, Logging jars in a project.
Step7: Make package- com.selenium.xls.read
Step8: Put Xls_Reader.java in com.selenium.xls.read package
Step9: Make package- com.selenium.config
Step10: Make config.properties and OR.properties in com.selenium.config package
config.properties
OR.properties
Step11: Make package- com.selenium.logs
Step12: Implement logging under src folder
#Application Logs
#Application Logs log4j.logger.devpinoyLogger=DEBUG, dest1 log4j.appender.dest1=org.apache.log4j.RollingFileAppender log4j.appender.dest1.maxFileSize=5000KB log4j.appender.dest1.maxBackupIndex=3 log4j.appender.dest1.layout=org.apache.log4j.PatternLayout log4j.appender.dest1.layout.ConversionPattern=%d{dd/MM/yyyy HH:mm:ss} %c %m%n log4j.appender.dest1.File=E:\\Tools\\Selenium\\ workspace\\Core_Hybrid_WebDriver\\src\\com\\selenium\\logs\\Application.log #do not append the old file. Create a new log file everytime log4j.appender.dest1.Append=false
Conclusion:
In the first part of this tutorial series, we learned about implementing core part of Hybrid (Keyword+Data Driven) Framework. In next part, we will learn about initializing config.properties, OR.properties, implement application-specific keywords, generic keywords, application constants etc.
Next tutorial: JUnit and Hybrid (Keyword+Data Driven) Framework – Part 2
⇓ Subscribe Us ⇓
If you are not a regular reader of this website then highly recommends you Sign up for our free email newsletter!! Sign up just providing your email address below:
Happy Testing!!!
- How to Perform Selenium Automation Using LambdaTest?
- Top 15 Common Selenium Exceptions You’ve Probably Seen
- How to create Selenium WebDriver Test using Selenium IDE? – Selenium Tutorial
- Learn JUnit annotations used for your Selenium WebDriver automation
- How to use JUnit Annotations in Selenium WebDriver Automation Script
- Installation of TestNG in Eclipse – Selenium WebDriver Tutorial
- How to handle Cookies in Selenium WebDriver
- Selenium Tutorial: Introduction to Selenium Grid
- Handling IFrames in Selenium – Selenium Tutorial
- Step by Step Guide on Database Testing using Selenium