{"id":4579,"date":"2020-08-28T16:46:37","date_gmt":"2020-08-28T11:16:37","guid":{"rendered":"https:\/\/www.h2kinfosys.com\/blog\/?p=4579"},"modified":"2025-04-02T09:58:37","modified_gmt":"2025-04-02T13:58:37","slug":"selenium-automation-framework-data-driven-keyword-driven-hybrid","status":"publish","type":"post","link":"https:\/\/www.h2kinfosys.com\/blog\/selenium-automation-framework-data-driven-keyword-driven-hybrid\/","title":{"rendered":"Selenium Automation Framework Data Driven, Keyword Driven &#038; Hybrid"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>What is Selenium Framework?<\/strong><\/h2>\n\n\n\n<p>Selenium Automation Frameworks are a code structure that helps maintain the code in an organized and efficient manner. Without frameworks, we would place the developed code and the provided data in the same location, making it neither re-usable nor readable. Selenium <a href=\"https:\/\/www.h2kinfosys.com\/blog\/selenium-test-automation-framework\/\" data-type=\"link\" data-id=\"https:\/\/www.h2kinfosys.com\/blog\/selenium-test-automation-framework\/\">Automation Frameworks<\/a> offer several benefits, such as increased re-usage of code, higher portability, reduced maintenance costs, and improved code readability. These advantages make frameworks essential for optimizing automation testing processes.<\/p>\n\n\n\n<p>Selenium WebDriver created three type of frameworks to automate manual test cases<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Keyword Driven Framework<\/li>\n\n\n\n<li>Data Driven Framework<\/li>\n\n\n\n<li>Hybrid Framework<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/_8L0rD5Tbl0DMTT-oJw1Emb6mpNHv7MYPU805fQOIG7xYbD5u7Me5bWOPggIBQHWnGFaLuxEdmiZZRrPLdx5SY-mAjwQlxSE8d-MhOjDfB5jE2msKcLrNtySim5c_oApKPelY70DMuBGFCaWAw\" alt=\"Framework.PNG\" title=\"\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Data Driven Framework<\/strong><\/h2>\n\n\n\n<p>In&nbsp;data driven framework all our test data is generated from external files like CSV, XML, Excel or some database table.<\/p>\n\n\n\n<p>If we want to read or write in an Excel, Apache provides a very famous library called POI. This library will read and write both XLS and XLSX file format of Excel.<\/p>\n\n\n\n<p>An <strong>HSSF <\/strong>implementation is provided by <a href=\"https:\/\/en.wikipedia.org\/wiki\/Apache_POI\" rel=\"nofollow noopener\" target=\"_blank\">POI library <\/a>to read XLS files. Implementation of POI library will be the choice to read XLSX, XSSF.<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-video is-provider-youtube wp-block-embed-youtube wp-embed-aspect-16-9 wp-has-aspect-ratio\"><div class=\"wp-block-embed__wrapper\">\n<iframe title=\"HP UFT \/ QTP Tutorials for Beginners | Data Driven Frame work | H2KInfosys\" width=\"800\" height=\"450\" src=\"https:\/\/www.youtube.com\/embed\/3DMQW9EtamY?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Keyword Driven Test Framework:<\/strong><\/h2>\n\n\n\n<p>In Excel worksheet we will write all the operations and instructions in Keyword driven framework.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/1wFFk3LIFNBaP1zTP7cqqzJiR5G2e8j4c_f-8AJbK0-3-n-u7WuLqQpooblWKXZjkyBoaoUAvIVW-xOEdkRh7LWtgMkPhmt-wBUuxfEdAYjBVotGezK-JDdcWYLb97OtBhcAHDf4Yn--M2I0Zg\" alt=\"keyword.PNG\" title=\"\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Components of Keyword Driven Framework<\/strong><\/h2>\n\n\n\n<p>The list of components are involved in Keyword Driven Framework.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Function Library<\/li>\n\n\n\n<li>Excel Sheet to store Keywords<\/li>\n\n\n\n<li>Design Test Case Template<\/li>\n\n\n\n<li>Object Repository for Elements\/Locators<\/li>\n\n\n\n<li>Test Scripts or Driver Script<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Function Library: <\/strong><\/h3>\n\n\n\n<p>This is a Java class file where we define keywords.&nbsp;<\/p>\n\n\n\n<p><strong>For Example:<\/strong><\/p>\n\n\n\n<p>Let us perform the following actions in one or more test cases:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Enter the URL.<\/li>\n\n\n\n<li>Click on an element.<\/li>\n\n\n\n<li>Type in a textbox.<\/li>\n<\/ul>\n\n\n\n<p>Then,<strong>&nbsp;the library file is created by defining individual methods for all the actions<\/strong><\/p>\n\n\n\n<p>Here, we will create a user-defined method for the action by&nbsp; \u2018Entering the URL\u2019.<\/p>\n\n\n\n<p><strong>Keyword<\/strong>&nbsp; is the name provided for the user-defined method<strong>.<\/strong><\/p>\n\n\n\n<p>So, here \u2018enter_URL\u2019 is the Keyword<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>public void enter_URL(WebDriver driver,String TestData) throws IOException\n{\ndriver.get(TestData);\n}<\/code><\/pre>\n\n\n\n<p><strong>Parameters<\/strong>:<\/p>\n\n\n\n<p><strong>Driver<\/strong>: In the Main Class the driver is initialized and is passed in here.<br><strong>TestData<\/strong>: It is read from the external source by the Main Class and passed it in here.<\/p>\n\n\n\n<p><strong>Function<\/strong>:<\/p>\n\n\n\n<p>Here,&nbsp;<strong>driver.get()<\/strong>: is the function that performs the action \u2018enter URL\u2019.<\/p>\n\n\n\n<p><strong>Keywords.java<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package Keywords;\n&nbsp;\nimport java.io.File;\nimport org.openqa.selenium.By;\nimport org.openqa.selenium.WebDriver;\n&nbsp;\npublic class Keywords {\n&nbsp;&nbsp;\nString path = System.getProperty(\"user.dir\");\nWebDriver driver;\n&nbsp;&nbsp;\n&nbsp;\npublic void enter_URL(WebDriver driver,String TestData) throws IOException\n{\ndriver.get(TestData);\n}\n&nbsp;\npublic void type(WebDriver driver, String typeLocator, String testdata, String ObjectName)&nbsp;\n{\ndriver.findElement(this.getObject(ObjectName,typeLocator)).sendKeys(testdata);\n}\n&nbsp;&nbsp;\n&nbsp;\npublic void click(WebDriver driver,String ObjectName, String typeLocator)&nbsp;\n{\ndriver.findElement(this.getObject(ObjectName,typeLocator)).click();\n}\n&nbsp;\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Excel Sheet to Store Keywords<\/strong><\/h3>\n\n\n\n<p>All the user-defined methods along with its functionality details are maintained in the excel sheet so that the user can easily understand what Keyword the library file holds.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/fJmN4nOWitG7w49gG18rYmUSfYz1cDLtrajutN9BktRo9gSL_qi_MBkPz8MEuwbQoYeTNKN2RkynQE3p6CIGPsVCk1_qlRTaF8b480upVMmxuSH_MkKvXHd722HNsXBL6MspMj-7mdTVJKqxmA\" alt=\"excel.PNG\" title=\"\"><\/figure>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>package<\/strong> Keywords;\n\n<strong>import<\/strong> java.io.File;\n<strong>import<\/strong> java.io.FileInputStream;\n<strong>import<\/strong> java.io.IOException;\n<strong>import<\/strong> java.util.Properties;\n\n<strong>import<\/strong> org.openqa.selenium.By;\n<strong>import<\/strong> org.openqa.selenium.WebDriver;\n<strong>import<\/strong> org.openqa.selenium.support.ui.ExpectedConditions;\n<strong>import<\/strong> org.openqa.selenium.support.ui.WebDriverWait;\n\n<strong>public<\/strong> <strong>class<\/strong> Keywords {\nString path = System.<em>getProperty<\/em>(\"user.dir\");\n&nbsp;\nWebDriver driver;\n&nbsp;\n<strong>public<\/strong> <strong>void<\/strong> enter_URL(WebDriver driver,String TestData) <strong>throws<\/strong> IOException{\ndriver.get(TestData);\n}\n&nbsp;\n<strong>public<\/strong> <strong>void<\/strong> type(WebDriver driver, String typeLocator, String testdata, String ObjectName) <strong>throws<\/strong> IOException{\n&nbsp;\ndriver.findElement(<strong>this<\/strong>.getObject(ObjectName,typeLocator)).sendKeys(testdata);\n\/\/driver.findElement(By.xpath(\"\/\/\")).sendKeys(testdata);\n&nbsp;\n}\n<strong>public<\/strong> <strong>void<\/strong> wait(WebDriver driver,String ObjectName, String typeLocator) <strong>throws<\/strong> IOException{\nWebDriverWait wait = <strong>new<\/strong> WebDriverWait(driver, 60);\nwait.until(ExpectedConditions.<em>visibilityOf<\/em>(driver.findElement(<strong>this<\/strong>.getObject(ObjectName,typeLocator))));\n}\n<strong>public<\/strong> <strong>void<\/strong> click(WebDriver driver,String ObjectName, String typeLocator) <strong>throws<\/strong> IOException{\ndriver.findElement(<strong>this<\/strong>.getObject(ObjectName,typeLocator)).click();\n}\n<strong>public<\/strong> String get_currentURL(WebDriver driver){\nString URL = driver.getCurrentUrl();\nSystem.<strong><em>out<\/em><\/strong>.println(\"print URL \"+URL);\n<strong>return<\/strong> URL;\n}\nBy getObject(String ObjectName, String typeLocator) <strong>throws<\/strong> IOException{\n&nbsp;\nFile file = <strong>new<\/strong> File(path+\"\\\\Externals\\\\Object Repository.properties\");\nFileInputStream fileInput = <strong>new<\/strong> FileInputStream(file);\n&nbsp;\nProperties prop = <strong>new<\/strong> Properties();\n\/\/find by the xpath\n<strong>if<\/strong>(typeLocator.equalsIgnoreCase(\"XPATH\")){\n&nbsp;\n<strong>return<\/strong> By.<em>xpath<\/em>(prop.getProperty(ObjectName));\n}\n\/\/find by the class\n<strong>else<\/strong> <strong>if<\/strong>(typeLocator.equalsIgnoreCase(\"CLASSNAME\")){\n&nbsp;\n<strong>return<\/strong> By.<em>className<\/em>(prop.getProperty(ObjectName));\n&nbsp;\n}\n\/\/find by name locator\n<strong>else<\/strong> <strong>if<\/strong>(typeLocator.equalsIgnoreCase(\"NAME\")){\n&nbsp;\n<strong>return<\/strong> By.<em>name<\/em>(prop.getProperty(ObjectName));\n&nbsp;\n}\n\/\/Find by css lcatoor\n<strong>else<\/strong> <strong>if<\/strong>(typeLocator.equalsIgnoreCase(\"CSS\")){\n&nbsp;\n<strong>return<\/strong> By.<em>cssSelector<\/em>(prop.getProperty(ObjectName));\n&nbsp;\n}\n\/\/find by the link\n<strong>else<\/strong> <strong>if<\/strong>(typeLocator.equalsIgnoreCase(\"LINK\")){\n&nbsp;\n<strong>return<\/strong> By.<em>linkText<\/em>(prop.getProperty(ObjectName));\n&nbsp;\n}\n\/\/find by the partial link\n<strong>else<\/strong> <strong>if<\/strong>(typeLocator.equalsIgnoreCase(\"PARTIALLINK\")){\n&nbsp;\n<strong>return<\/strong> By.<em>partialLinkText<\/em>(prop.getProperty(ObjectName));\n&nbsp;\n}\n<strong>return<\/strong> <strong>null<\/strong>;\n&nbsp;\n}\n\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\"> <strong>Design Test Case Template<\/strong><\/h3>\n\n\n\n<p>Test Case Template can be created as per our project convenience. The externalization can be only for Keywords, or even for Test Data and UI Elements are also externalized.<\/p>\n\n\n\n<p><strong>A sample test case template is created:<\/strong><\/p>\n\n\n\n<p>In the given example, the template is created as follows:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Each sheet corresponds to a Test Case and the last sheet holds the \u2018Keywords list\u2019.<\/li>\n\n\n\n<li>Each row corresponds to the test steps of a TC.<\/li>\n\n\n\n<li>Each Column is the parameters that are necessary for each action.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/TP-7LqdowF4EE8-Lmm_IqxS1Sjk9xCWy7spMstFECxTlgeQJcnAId1jSncr3ms5FJmu2JRIgGQfnYL-_qEvmE1FAh8eLBek3UqGg-pwFd_D7vcn5L-HztG1tU1g-01XeW5ERW7jeUK0aSxOdXA\" alt=\"keywords.PNG\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Object Repository for Locators<\/strong><\/h3>\n\n\n\n<p>UI locator can be identified and its value can be mentioned in the test case template or maintained in a separate Object Repository.<\/p>\n\n\n\n<p><strong>In the below example, the element identification properties<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Locator Type<\/strong>&nbsp;\u2013 The identification used is id, Xpath, ClassName, etc.<\/li>\n\n\n\n<li><strong>Locator Value<\/strong>&nbsp;\u2013 Value of that attribute \u2013&nbsp;<strong>For Example:<\/strong>&nbsp;If its Id attribute, then the value of id and so on.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/UzuI1RutAGwzAPZ9ge5SNXXtm-LjvTNwvgytVGG6hWfeIElN3eMjg9uBnCgpNrNOfVsiFFNIeUAp2dr7DbL9_pHgs49_WMgm2xXiMogXBykJPiMGeEtD1Y3paxGjIiizdYaLronQgzIarHb_hw\" alt=\"Object Repository for Locators\" title=\"\"><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\"><strong> Test Scripts or Driver Script<\/strong><\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>package<\/strong> KeywordFramework;\n\n<strong>import<\/strong> java.io.FileInputStream;\n<strong>import<\/strong> java.io.IOException;\n<strong>import<\/strong> java.util.LinkedList;\n\n<strong>import<\/strong> org.apache.poi.ss.usermodel.Cell;\n<strong>import<\/strong> org.apache.poi.xssf.usermodel.XSSFSheet;\n<strong>import<\/strong> org.apache.poi.xssf.usermodel.XSSFWorkbook;\n<strong>import<\/strong> org.openqa.selenium.WebDriver;\n<strong>import<\/strong> org.openqa.selenium.firefox.FirefoxDriver;\n<strong>import<\/strong> org.testng.annotations.Test;\n<strong>import<\/strong> org.testng.asserts.Assertion;\n\n<strong>import<\/strong> Keywords.Assertions;\n<strong>import<\/strong> Keywords.Keywords;\n\n<strong>public<\/strong> <strong>class<\/strong> Irctc {\nWebDriver driver;\nString path = System.<em>getProperty<\/em>(\"user.dir\");\n&nbsp;\nKeywords keyword = <strong>new<\/strong> Keywords();\nAssertions assertion = <strong>new<\/strong> Assertions();\n&nbsp;\n@Test\n<strong>public<\/strong> <strong>void<\/strong> readExcelandexecute() <strong>throws<\/strong> IOException, InterruptedException{\n&nbsp;\n\nString excelFilePath = path+\"\\\\Externals\\\\Test Cases.xlsx\";\nFileInputStream fileInputStream = <strong>new<\/strong> FileInputStream(excelFilePath);\n&nbsp;\nXSSFWorkbook workbook = <strong>new<\/strong> XSSFWorkbook(fileInputStream);\n&nbsp;\n<strong>int<\/strong> testcasescount = workbook.getNumberOfSheets()-1;\n&nbsp;\nSystem.<strong><em>out<\/em><\/strong>.println(\"Total no of test cases :\"+testcasescount);\n&nbsp;\n<strong>for<\/strong> (<strong>int<\/strong> testcase=0;testcase&lt;testcasescount;testcase++){\nSystem.<em>setProperty<\/em>(\"webdriver.gecko.driver\",\"F:\\\\drivers\\\\geckodriver.exe\");&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp; driver = <strong>new<\/strong> FirefoxDriver();\n&nbsp;\nXSSFSheet worksheet = workbook.getSheetAt(testcase);\n&nbsp;\nSystem.<strong><em>out<\/em><\/strong>.println(\"worksheet Number \"+testcase+\":\"+worksheet.getSheetName());\n&nbsp;\n<strong>int<\/strong> row = worksheet.getLastRowNum();\n<strong>int<\/strong> column = worksheet.getRow(1).getLastCellNum();\n&nbsp;\n<strong>for<\/strong>(<strong>int<\/strong> i=1;i&lt;=row;i++){\n&nbsp;\nLinkedList&lt;String&gt; Testexecution = <strong>new<\/strong> LinkedList&lt;&gt;();\n&nbsp;\nSystem.<strong><em>out<\/em><\/strong>.println(\"Row value :\"+i+\"First cell value as : \"+worksheet.getRow(i).getCell(0));\n&nbsp;\n<strong>for<\/strong>(<strong>int<\/strong> j=0;j&lt;column-1;j++){\nSystem.<strong><em>out<\/em><\/strong>.println(\"Column index :\"+j);\nCell Criteria = worksheet.getRow(i).getCell(j);\n&nbsp;\nString CriteriaText;\n<strong>if<\/strong>(Criteria==<strong>null<\/strong>){\nCriteriaText = <strong>null<\/strong>;\n}<strong>else<\/strong>{\nCriteriaText = Criteria.getStringCellValue();\n}\nTestexecution.add(CriteriaText);\n}\nSystem.<strong><em>out<\/em><\/strong>.println(\"List :\"+Testexecution);\n&nbsp;\nString TestStep = Testexecution.get(0);\nString ObjectName = Testexecution.get(1);\nString TypeLocator = Testexecution.get(2);\nString Testdata = Testexecution.get(3);\nString AssertionType = Testexecution.get(4);\nString ExpectedValue = Testexecution.get(5);\nString ActualValue = Testexecution.get(6);\n&nbsp;\nperform(TestStep,ObjectName,TypeLocator,Testdata,AssertionType,ExpectedValue,ActualValue);\n&nbsp;\nSystem.<strong><em>out<\/em><\/strong>.println(\"Row\"+i+\" is read and action performed\");\n}\n&nbsp;\ndriver.close();\nSystem.<strong><em>out<\/em><\/strong>.println(\"****TEST CASE \"+worksheet.getSheetName()+\" is executed*****\");\n}\n}\n&nbsp;\n<strong>public<\/strong> <strong>void<\/strong> perform(String operation, String objectName, String typeLocator, String testdata,\nString assertionType, String expectedValue, String actualValue) <strong>throws<\/strong> IOException, InterruptedException {\n&nbsp;\n<strong>switch<\/strong> (operation) {\n<strong>case<\/strong> \"enter_URL\":\n\n\/\/Perform click action\nkeyword.enter_URL(driver,testdata);\n<strong>break<\/strong>;\n&nbsp;\n<strong>case<\/strong> \"get_currentURL\":\n\nkeyword.get_currentURL(driver);\n<strong>break<\/strong>;\n&nbsp;\n<strong>case<\/strong> \"type\":\nkeyword.type(driver, objectName, typeLocator, testdata);\n&nbsp;\n<strong>case<\/strong> \"click\":\nkeyword.click(driver, objectName, typeLocator);\n&nbsp;\n\n<strong>case<\/strong> \"implicitWait\":\nThread.sleep(8000);\n&nbsp;\n<strong>default<\/strong>:\n<strong>break<\/strong>;\n}\n&nbsp;\n<strong>if<\/strong>(operation.contains(\"AssertURL\")){\n&nbsp;\n<strong>switch<\/strong>(assertionType){\n&nbsp;\n<strong>case<\/strong> \"contains\":\nassertion.AssertURLContains(driver, keyword.get_currentURL(driver), expectedValue);\n<strong>case<\/strong> \"equals\":\nassertion.AssertURLEquals(driver, keyword.get_currentURL(driver), expectedValue);\n&nbsp;\n}\n&nbsp;\n}\n&nbsp;\n<strong>if<\/strong>(operation.contains(\"AssertElement\"){\n&nbsp;\nassertion.AssertElement(driver, assertionType, objectName, typeLocator);\n&nbsp;\n}\n}\n}<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Hybrid Test Framework<\/strong><\/h2>\n\n\n\n<p>Hybrid Driven Framework is a combination of both the Data-Driven and Keyword-Driven framework. Here, the keywords, the test data, are externalized. Keywords are maintained in a separate Java class file and test data can be maintained either in properties file or excel file or can use the data provider of a TestNG framework.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh5.googleusercontent.com\/_8L0rD5Tbl0DMTT-oJw1Emb6mpNHv7MYPU805fQOIG7xYbD5u7Me5bWOPggIBQHWnGFaLuxEdmiZZRrPLdx5SY-mAjwQlxSE8d-MhOjDfB5jE2msKcLrNtySim5c_oApKPelY70DMuBGFCaWAw\" alt=\"Framework.PNG\" title=\"\"><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Components of Hybrid Driven Framework<\/strong><\/h2>\n\n\n\n<p>Components of the Hybrid Framework are similar as Keyword Driven Framework&nbsp;wherein every Test Data, Keywords, are externalized making the script in a more generalized form<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Function Library<\/li>\n\n\n\n<li>Excel Sheet to store Keywords<\/li>\n\n\n\n<li>Design Test Case Template<\/li>\n\n\n\n<li>Object Repository for Elements\/Locators<\/li>\n\n\n\n<li>Test Scripts or Driver Script<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Function Library<\/strong><\/h3>\n\n\n\n<p>User-defined methods are created for each user action. In other words, Keywords are created in the library file.<\/p>\n\n\n\n<p><strong>For Example:<\/strong>&nbsp;Let us automate the below test cases.<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td><strong>Test Case No<\/strong><\/td><td><strong>Description<\/strong><\/td><td><strong>Test Steps<\/strong><\/td><td><strong>Expected Result<\/strong><\/td><\/tr><tr><td>1<\/td><td>Verify Amazon logo&nbsp;<\/td><td>1. Enter URL &#8211; https:\/\/www.amazon.com<\/td><td>Amazon logo should be displayed in home page<\/td><\/tr><tr><td>2<\/td><td>Verify valid signIn<\/td><td>1. Enter URL &#8211; https:\/\/www.amazon.com<br>2. Click on &#8216;SignIn&#8217; link<br>3. Enter valid Email<br>4. Click on continue<br>5. Enter Valid Password<br>6. Click on SignInButton<\/td><td>User Icon should be present in Homepage<\/td><\/tr><tr><td>3<\/td><td>Invalid login<\/td><td>1. Enter URL &#8211; https:\/\/www.amazon.com<br>2. Click on &#8216;SignIn&#8217; link<br>3. Enter invalid Email<br>4. Click on continue<\/td><td>This error message should contain &#8216;cannot find an account&#8217;<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>First, the test cases are analyzed and note down its actions.<\/p>\n\n\n\n<p>In&nbsp;<strong>TC 01:<\/strong>&nbsp;Verify Amazon logo which is present- the user actions will be: Enter the URL<br>In&nbsp;<strong>TC 02:<\/strong>&nbsp;Verify Valid SignIn- the user actions are Enter URL, Click, TypeIn<br>In&nbsp;<strong>TC03:<\/strong>&nbsp;Verify Invalid Login- the user actions are Enter URL, Click, TypeIn<\/p>\n\n\n\n<p><strong>Now, for each action the library file will be created with Keywords defined as below:<\/strong><\/p>\n\n\n\n<p><strong><em>Keywords.java<\/em><\/strong><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>Excel Sheet to store Keywords<\/strong><\/h3>\n\n\n\n<p>Keywords that we created in the library file are stored in an excel sheet with description to understand the framework easily for anyone who uses it.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong> Test Case Design Template<\/strong><\/h3>\n\n\n\n<p>For the framework we need to create the Test Case template.&nbsp; Both Test Data and Keywords should be externalized in Hybrid Framework,&nbsp; So we need to create the template accordingly. For example:<\/p>\n\n\n\n<p>For Test Case 2 \u2013 Verify valid SignIn<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Test Steps<\/td><td>Locator Type<\/td><td>Locator Value<\/td><td>TestData<\/td><td>AssertionType<\/td><td>Expected Value<\/td><\/tr><tr><td>Enter_URL<\/td><td><\/td><td><\/td><td>www.amazon.com<\/td><td><\/td><td><\/td><\/tr><tr><td>Click<\/td><td>Xpath<\/td><td>\/\/div[contains(@id,&#8217;SignIn&#8217;)]<\/td><td><\/td><td><\/td><td><br><br><\/td><\/tr><tr><td>typeIn<\/td><td>Xpath<\/td><td>\/\/div[contains(@id,&#8217;SignIn&#8217;)]<\/td><td>xyz@gmail.com<\/td><td><\/td><td><\/td><\/tr><tr><td>Click<\/td><td>Xpath<\/td><td>\/\/div[contains(@id,&#8217;continue&#8217;)]<\/td><td><\/td><td><\/td><td><\/td><\/tr><tr><td>typeIn<\/td><td>Id<\/td><td>Password<\/td><td>Password@123<\/td><td><\/td><td><\/td><\/tr><tr><td>Click<\/td><td>Id<\/td><td>SignIn<\/td><td><\/td><td><\/td><td><\/td><\/tr><tr><td>AssertElement<\/td><td>Xpath<\/td><td>\/\/div[contains(@id,&#8217;usericon&#8217;)]<\/td><td><\/td><td>Displayed<\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>In the same way we create test steps for each test case in a separate sheet.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong> Object Repository for Elements<\/strong><\/h3>\n\n\n\n<p>For all elements on the webpage we maintain a separate Repository. Each WebElement is referred with a name followed with its value. Test Case template will hold the Object Name and from the repository its value is taken as shown below:<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Test Steps<\/td><td>Locator Type<\/td><td>Locator Value<\/td><td>TestData<\/td><td>AssertionType<\/td><td>Expected Value<\/td><\/tr><tr><td>Enter_URL<\/td><td><\/td><td><\/td><td>www.amazon.com<\/td><td><\/td><td><\/td><\/tr><tr><td>Click<img decoding=\"async\" src=\"https:\/\/docs.google.com\/drawings\/u\/0\/d\/s4GTEnfNIH5dR9kygZ5Uoow\/image?w=81&amp;h=218&amp;rev=1&amp;ac=1&amp;parent=1IbvlXrpcg5HLALktY4AI_ZKNFUIRebkWW7MR75HI6Hg\" width=\"81\" height=\"218\" alt=\"\" title=\"\"><\/td><td>Xpath<\/td><td>LoginLink<\/td><td><\/td><td><\/td><td><br><br><\/td><\/tr><tr><td>typeIn<\/td><td>Xpath<\/td><td>EmailTextbox<\/td><td>xyz@gmail.com<\/td><td><\/td><td><\/td><\/tr><tr><td>Click<\/td><td>Xpath<\/td><td>ContinueButton<\/td><td><\/td><td><\/td><td><\/td><\/tr><tr><td>typeIn<\/td><td>Id<\/td><td>PasswordTextbox<\/td><td>Password@123<\/td><td><\/td><td><\/td><\/tr><tr><td>Click<\/td><td>Id<\/td><td>SignInButton<\/td><td><\/td><td><\/td><td><\/td><\/tr><tr><td>AssertElement<\/td><td>Xpath<\/td><td>UserIcon<\/td><td><\/td><td>Displayed<\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh4.googleusercontent.com\/FMJyvqjjuxGDPpCD9otESwyOalPLsGHg_O_p6XggJjKQYWyfkDBDivi6M_593Glt6aKf8uFyG8G0BMWBhHZ8sAHz9hsU-OggLr2suSBqJ78bO9nL80AI_ZYS7gVCuvwYTv4kG_U19JO97iUwFA\" alt=\"code.PNG\" title=\"\"><\/figure>\n\n\n\n<p>Here LoginLink is the name of the object and from OR.properties we read its value as \u201c\/\/div[contains(@id,\u2019SignIn\u2019)]<\/p>\n\n\n\n<p>Accordingly from ObjectRepository we read the value from the code and will be included in the script Keywords.java<\/p>\n\n\n\n<p><strong>For Example:<\/strong><\/p>\n\n\n\n<p>&nbsp;Library file: In Keywords.java consider the \u2018click\u2019 action<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code><strong>package<\/strong> Keywords;\n\n<strong>import<\/strong> java.io.File;\n<strong>import<\/strong> java.io.FileInputStream;\n<strong>import<\/strong> java.io.IOException;\n<strong>import<\/strong> java.util.Properties;\n\n<strong>import<\/strong> org.openqa.selenium.By;\n<strong>import<\/strong> org.openqa.selenium.WebDriver;\n<strong>import<\/strong> org.openqa.selenium.support.ui.ExpectedConditions;\n<strong>import<\/strong> org.openqa.selenium.support.ui.WebDriverWait;\n\n<strong>public<\/strong> <strong>class<\/strong> Keywords {\n<strong>public<\/strong> <strong>void<\/strong> click(WebDriver driver, String ObjectName, String typeLocator)&nbsp;\n<strong>throws<\/strong> IOException{\n&nbsp; &nbsp; &nbsp; &nbsp; driver.findElement(<strong>this<\/strong>.getObject(ObjectName, typeLocator)).click();\n&nbsp; &nbsp; }\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp; &nbsp; By getObject(String ObjectName, String typeLocator) <strong>throws<\/strong>\nIOException{\n\/\/Object Repository is opened&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\nFile file = <strong>new<\/strong> File(path+\"\\\\Externals\\\\Object Repository.properties\");\nFileInputStream fileInput = <strong>new<\/strong> FileInputStream(file);\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n\/\/Properties file is read&nbsp;&nbsp;&nbsp;&nbsp;\nProperties prop = <strong>new<\/strong> Properties();\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n<strong>if<\/strong>(typeLocator.equalsIgnoreCase(\"XPATH\")){\n&nbsp; &nbsp; &nbsp; <strong>return<\/strong> By.<em>xpath<\/em>(prop.getProperty(ObjectName));&nbsp;\n\/\/ ObjectName is read and its value is returned\n}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n<strong>else<\/strong> <strong>if<\/strong>(typeLocator.equalsIgnoreCase(\"ID\")){\n&nbsp; &nbsp; &nbsp; <strong>return<\/strong> By.<em>id<\/em>(prop.getProperty(ObjectName));\n\/\/ ObjectName is read and its value is returned\n&nbsp;\n}\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n<strong>else<\/strong> <strong>if<\/strong>(typeLocator.equalsIgnoreCase(\"NAME\")){\n&nbsp; &nbsp; &nbsp; <strong>return<\/strong> By.<em>name<\/em>(prop.getProperty(ObjectName));\n\/\/ ObjectName is read and its value is returned\n&nbsp;\n}\n<strong>return<\/strong> <strong>null<\/strong>;\n&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp; &nbsp; }\n}<\/code><\/pre>\n\n\n\n<p><strong><em>Object Repository for Test Data in Test Cases<\/em><\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Externalizing Test Data from Test case Template:<\/strong><\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-table\"><table><tbody><tr><td>Test Steps<\/td><td>Locator Type<\/td><td>Locator Value<\/td><td>TestData<\/td><td>AssertionType<\/td><td>Expected Value<\/td><\/tr><tr><td>Enter_URL<img fetchpriority=\"high\" decoding=\"async\" src=\"https:\/\/docs.google.com\/drawings\/u\/0\/d\/sO6n3CFrnv4rvRB1peZOZSw\/image?w=262&amp;h=361&amp;rev=1&amp;ac=1&amp;parent=1IbvlXrpcg5HLALktY4AI_ZKNFUIRebkWW7MR75HI6Hg\" width=\"262\" height=\"361\" alt=\"\" title=\"\"><\/td><td><\/td><td><\/td><td>URL<\/td><td><\/td><td><\/td><\/tr><tr><td>Click<\/td><td>Xpath<\/td><td>LoginLink<\/td><td><\/td><td><\/td><td><br><br><\/td><\/tr><tr><td>typeIn<\/td><td>Xpath<\/td><td>EmailTextbox<\/td><td>email<\/td><td><\/td><td><\/td><\/tr><tr><td>Click<\/td><td>Xpath<\/td><td>ContinueButton<\/td><td><\/td><td><\/td><td><\/td><\/tr><tr><td>typeIn<\/td><td>Id<\/td><td>PasswordTextbox<\/td><td>password<\/td><td><\/td><td><\/td><\/tr><tr><td>Click<\/td><td>Id<\/td><td>SignInButton<\/td><td><\/td><td><\/td><td><\/td><\/tr><tr><td>AssertElement<\/td><td>Xpath<\/td><td>UserIcon<\/td><td><\/td><td>Displayed<\/td><td><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/g5GhFL5Xp4pqlBkMvrQpMMO8naFrJ7rBr5uj-S_siXVWckRIfz6wYNa5XAy6Y5v3f9pD-EaYW15j4nIEKh7iMAy8PWwHyiaJULQZlW4gFpXCEDMh2Pbr8FokzQPZ_m4y5UFzzkD8tVx8bFT0QQ\" alt=\"\" title=\"\"><\/figure>\n\n\n\n<p>Similarly the test data is also read from the properties file.<\/p>\n\n\n\n<p><strong><em>Object Repository for test data<\/em><\/strong><\/p>\n\n\n\n<p>General data like Browser name, executable driver location, test case filename, etc can also be externalized in a separate repository.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh6.googleusercontent.com\/XcbT2az3L47UQ1oV4dUjt3ykJ9Ib3HeXdS9T2kXIqOWdOtWg8Jr37WLztyKNBZyhnQ15kOtczqQyNmbPDYwZscf78o9-WcDxWuMjhbqEsSAmCvrEV3kQ6ZFTgkIeivbKEMfwRUZUNUqTzj5Ajw\" alt=\"before.png\" title=\"\"><\/figure>\n\n\n\n<p>In the above example, the browser parameter is externalized in a properties file \u2013 Basic.properties.<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Passing Test Data from TestNG Suite:<\/strong><\/li>\n<\/ul>\n\n\n\n<p>TestData can be also be passed from a suite file of TestNG to the method.<\/p>\n\n\n\n<p>We use a &lt;parameter&gt; tag in the TestNG.xml file above the class.<\/p>\n\n\n\n<p><strong>Syntax:&nbsp;<\/strong>&lt;parameter name = \u201cany_name\u201d value=\u201dvalue_to_be_passed\u201d\/&gt;<\/p>\n\n\n\n<p>Once the testing suite is specified with the parameter name and its value, annotations are used in the script to specify which method uses the value. This is specified using the @Parameters annotation.<\/p>\n\n\n\n<p><strong>Syntax:<\/strong>&nbsp;@Parameters({\u201cvalue_to_be_passed\u201d})<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"482\" height=\"400\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-14.png\" alt=\"\" class=\"wp-image-4583\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-14.png 482w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/08\/image-14-300x249.png 300w\" sizes=\"(max-width: 482px) 100vw, 482px\" \/><\/figure>\n\n\n\n<p><img loading=\"lazy\" decoding=\"async\" width=\"602\" height=\"319\" alt=\"before.png\" src=\"https:\/\/lh6.googleusercontent.com\/XcbT2az3L47UQ1oV4dUjt3ykJ9Ib3HeXdS9T2kXIqOWdOtWg8Jr37WLztyKNBZyhnQ15kOtczqQyNmbPDYwZscf78o9-WcDxWuMjhbqEsSAmCvrEV3kQ6ZFTgkIeivbKEMfwRUZUNUqTzj5Ajw\" title=\"\"><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong> Driver Script<\/strong><\/h3>\n\n\n\n<p>This contains the main logic from the test case template excel sheet and it will read all the test cases and performs the corresponding action by reading from the library file. The script is designed based on the test case template created.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package HybridFramework;\n&nbsp;\nimport java.lang.reflect.Method;\n&nbsp;\npublic class DriverScript\n&nbsp;\n{\n&nbsp;\npublic static Actions actionKeywords;\n&nbsp;\n&nbsp;public static String sActions;\n&nbsp;\n&nbsp;\/\/This is reflection class object and declared as 'public static'&nbsp;\n&nbsp;\n&nbsp;\/\/and it can be used outside the main&#91;] method\n&nbsp;\n&nbsp;public static Method method&#91;];\n&nbsp;\n&nbsp;public static void main(String&#91;] args) throws Exception&nbsp;\n&nbsp;\n&nbsp;{\n&nbsp;\n&nbsp;\/\/Declaring the path of the Excel file with the name of the Excel file\n&nbsp;\n&nbsp;String sPath = \"C:\\\\Users\\\\qwerty\\\\workspace\\\\Selenium Frameworks \\\\data.xlsx\";\n&nbsp;\n&nbsp;\/\/Here we are passing the path of the excel file and SheetName to connect with the Excel file&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;\n&nbsp;\n&nbsp;ReadExcelData.setExcelFile(sPath, \"Sheet1\");\n&nbsp;\n&nbsp;for (int iRow=1;iRow&lt;=9;iRow++)\n&nbsp;\n&nbsp;{\n&nbsp;\n&nbsp;sActions = ReadExcelData.getCellData(iRow, 1);\n&nbsp;\n&nbsp;execute_Actions();&nbsp;\n&nbsp;\n&nbsp;}\n&nbsp;\n&nbsp;}\n&nbsp;\nprivate static void execute_Actions() throws Exception&nbsp;\n&nbsp;\n&nbsp;{\n&nbsp;\n&nbsp;\/\/Here we are instantiating a new object of class 'Actions'\n&nbsp;\n&nbsp;actionKeywords = new Actions();\n&nbsp;\n&nbsp;\/\/It will load all the methods of the class 'Actions' in it.&nbsp;\n&nbsp;\n&nbsp;\n&nbsp;method = actionKeywords.getClass().getMethods();\n&nbsp;\n&nbsp;\/\/It will run for the number of actions in the Action Keyword class&nbsp;\n&nbsp;\n&nbsp;for(int i = 0;i&lt;method.length;i++)\n&nbsp;\n&nbsp;{\n&nbsp;&nbsp;if(method&#91;i].getName().equals(sActions))\n&nbsp;\n&nbsp;{\n&nbsp;\n&nbsp;&nbsp;method&#91;i].invoke(actionKeywords);\n&nbsp;\n&nbsp;&nbsp;break;\n&nbsp;\n&nbsp;}\n&nbsp;\n&nbsp;}\n&nbsp;\n&nbsp;}\n&nbsp;\n}<\/code><\/pre>\n\n\n\n<p><strong><em>Example: Test Case creation in Framework using POM<\/em><\/strong><\/p>\n\n\n\n<p><strong>Step1: Create a class BrowserFactory<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.automation.utility;\nimport org.openqa.selenium.WebDriver;\npublic class BrowserFactory {\npublic static WebDriver startApplication(WebDriver driver,String browserName, String appURL)\n{\nif(browserName.equals(\u201cchrome\u201d))\n{\nSystem.setProperty(\u201cwebDriver.chrome.driver\u201d,\u201d.\/Drivers\/chromedriver.exe\u201d);\ndriver = new ChromeDriver();\ndriver.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS);\n}\nelse if(browserName.equals(\u201cFirefox\u201d))\n{\nSystem.setProperty(\u201cwebDriver.gecko.driver\u201d,\u201d.\/ Drivers\/geckodriver.exe\u201d);\ndriver = new FirefoxDriver();\n&nbsp;\n}\nelse if(browserName.equals(\u201cIE\u201d))\n{\nSystem.setProperty(\u201cwebDriver.ie.driver\u201d,\u201d.\/ Drivers\/IEDriverServer.exe\u201d);\ndriver = new InternetExplorerDriver();\n&nbsp;\n}\nelse\n{\nSystem.out.println(\u201cWe do not support this browser\u201d);\n}\ndriver.manage().timeouts().pageLoadTimeout(20, TimeUnit.SECONDS);\n&nbsp;\ndriver.manage().window().maximize();\ndriver.get(appURL);\ndriver.manage().timeouts().implicitlyWait(30,TimeUnit.SECONDS);\nreturn driver;\n}\npublic static void quitBrowser(WebDriver driver)\n{\ndriver.quit();\n}\n}<\/code><\/pre>\n\n\n\n<p><strong>Step2: Create a New Class LoginTestCRM<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.automation.testcases;\nimport org.openqa.selenium.WebDriver;\nimport org.openqa.selenium.support.PageFactory;\nimport org.testng.annotations.Test;\nimport com.automation.pages.LoginPage;\nimport com.automation.utility.BrowserFactory;\npublic class LoginTestCRM extends BaseClass {\n&nbsp;\n@Test\nPublic void loginApp()\n{\nLoginPage loginpage = PageFactory.initElements(driver, LoginPage.class);\nloginPage.loginToCRM(\u201cSelenium\u201d, \u201cAbcd@123456\u201d);\n}\n}<\/code><\/pre>\n\n\n\n<p><strong>Step 3: Create a New Class LoginPage<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.automation.pages;\nimport org.openqa.selenium.WebDriver;\nimport org.openqa.selenium.WebElement;\nimport org.openqa.selenium.support.FindBy;\n&nbsp;\npublic class LoginPage {\nWebDriver driver;\npublic LoginPage(WebDriver ldriver)\n{\nthis.driver=ldriver;\n}\n@FindBy(name=\u201dusername\u201d) WebElement uname;\n@FindBy(name=\u201dpassword\u201d) WebElement pass\n@FindBy(xpath=\u201d\/\/input&#91;@value=\u2019Login\u2019]\u201d) WebElement loginButton;\n&nbsp;\nPublic void loginToCRM(String usernameApplication, String passwordApplication)\n{\nuname.sendKeys(xxxzbc);\npass.sendKeys(xxxxx);\nloginButton.click();\n&nbsp;\n}\n}<\/code><\/pre>\n\n\n\n<p><strong>Step4: Create a class (BaseClass)<\/strong><\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>package com.automation.pages;\nimport org.openqa.selenium.WebDriver;\nimport org.testng.annotations.AfterClass;\nimport org.testng.annotations.BeforeClass;\nimport com.automation.utility.BrowserFactory;\npublic class BaseClass {\npublic WebDriver driver;\n@BeforeClass\npublic void setup()\n{\ndriver= BrowserFactory.startApplication(driver, \u201cChrome\u201d, \u201chttps:\/\/www.freecrm.com\/index.html\u201d);\n}\n@AfterClass\npublic void teardown()\n{\nBrowserFactory.quitBrowser(driver);\n}\n}<\/code><\/pre>\n\n\n\n<p><strong>Right-click on LoginTestCRM class and Run the application.<\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>In Selenium WebDriver we can create three types of frameworks.<\/li>\n\n\n\n<li>They are Data Driven, Keyword Driven, and Hybrid Driven framework.<\/li>\n\n\n\n<li>Using TestNG&#8217;s data provider we can achieve Data-driven framework&nbsp;<\/li>\n\n\n\n<li>Keywords are written in some external files like excel file and java code will call this excel file and execute the test cases in Keyword driven framework,.<\/li>\n\n\n\n<li>The hybrid framework is a combination of keyword driven and data driven framework.<\/li>\n<\/ul>\n\n\n\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/www.h2kinfosys.com\/courses\/selenium-webdriver-junit-training-course\"><img loading=\"lazy\" decoding=\"async\" width=\"728\" height=\"90\" src=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/11\/Learn-selenium-certification-online.jpg\" alt=\"Selenium framework online training\" class=\"wp-image-6594\" title=\"\" srcset=\"https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/11\/Learn-selenium-certification-online.jpg 728w, https:\/\/www.h2kinfosys.com\/blog\/wp-content\/uploads\/2020\/11\/Learn-selenium-certification-online-300x37.jpg 300w\" sizes=\"(max-width: 728px) 100vw, 728px\" \/><\/a><\/figure>\n\n\n\n<p>In conclusion, mastering Data-Driven, Keyword-Driven, and Hybrid frameworks in Selenium empowers testers to create scalable and efficient automation solutions. These frameworks enhance flexibility, reusability, and ease of maintenance in test scripts, making them indispensable for modern testing needs. Enroll in <a href=\"https:\/\/www.h2kinfosys.com\/courses\/selenium-automation-testing-certification-course\/\" data-type=\"link\" data-id=\"https:\/\/www.h2kinfosys.com\/courses\/selenium-automation-testing-certification-course\/\">Selenium certification<\/a> courses to gain expertise in building and implementing these advanced frameworks and elevate your testing career to new heights.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Call to Action<\/h2>\n\n\n\n<p><strong>Master Advanced Selenium Automation Frameworks with H2K Infosys<\/strong><br>Take your automation testing skills to the next level by mastering Data-Driven, Keyword-Driven, and Hybrid frameworks in Selenium. At H2K Infosys, we provide expert-led training that covers everything you need to know about these advanced frameworks, enabling you to build scalable, efficient, and reusable test scripts. With hands-on projects and real-world examples, you&#8217;ll gain the practical experience required to excel in automation testing.<\/p>\n\n\n\n<p>Don\u2019t miss the opportunity to enhance your testing expertise with comprehensive Selenium training. Learn to implement and optimize advanced frameworks that are in demand across industries. With industry-expert trainers, real-time project experience, and 24\/7 support, H2K Infosys ensures you&#8217;re fully equipped to succeed. Enroll today and make your mark in the competitive world of automation testing!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>What is Selenium Framework? Selenium Automation Frameworks are a code structure that helps maintain the code in an organized and efficient manner. Without frameworks, we would place the developed code and the provided data in the same location, making it neither re-usable nor readable. Selenium Automation Frameworks offer several benefits, such as increased re-usage of [&hellip;]<\/p>\n","protected":false},"author":16,"featured_media":4643,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[43],"tags":[1295,1297,1296,1893,503,1892,1891],"class_list":["post-4579","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-selenium-tutorials","tag-data-driven-framework","tag-hybrid","tag-keyword-driven","tag-poi-library","tag-selenium-automation","tag-selenium-automation-framework","tag-selenium-framework"],"_links":{"self":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/4579","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/users\/16"}],"replies":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/comments?post=4579"}],"version-history":[{"count":0,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/posts\/4579\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media\/4643"}],"wp:attachment":[{"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/media?parent=4579"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/categories?post=4579"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.h2kinfosys.com\/blog\/wp-json\/wp\/v2\/tags?post=4579"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}