Data Driven Framework In Selenium WebDriver - Creating Required Class Files

STEP 5

Prerequisite : Jar files should be added In software testing project's build path As described In Step 4.
(Special Note : Please don't skip any of the previous steps.).

Now Its time to create all required class(.java) files under different packages. In our selenium WebDriver software testing data driven framework, We have to create one base class for all the test suites of project. We have to
create one base class for each and every test suite. And then, We have to create separate classes for each test case In each test suite. In our data driven framework for software web application, Initially we will create only two test suites having two test cases In each. Later on, You can create more test suites and test cases as per your software web application's requirement. Follow the steps of test cases and test suites class creation.

(Note : All class files names should be same as given bellow. Please consider case sensitivity when giving class file name.)

"com.stta.TestSuiteBase" Package
Create bellow given class file under "com.stta.TestSuiteBase" Package.
  1. SuiteBase.java - We will use this class file as a master base class file for both the test suites (com.stta.SuiteOne, com.stta.SuiteTwo) for software web application.
"com.stta.SuiteOne" Package
This package will be considered as a test suite one and will create test suite one related classes under this package. Create bellow given class files under "com.stta.SuiteOne" Package. Later on, You can create more test case classes under any suite.
  1. SuiteOneBase.java - This class will be used as base class of test suite one.
  2. SuiteOneCaseOne.java - This class will be used as test case one of suite one.
  3. SuiteOneCaseTwo.java - This class will be used as test case two of suite one.
"com.stta.SuiteTwo" Package
This package will be considered as a test suite two and will create test suite two related classes under this package.Create bellow given class files under "com.stta.SuiteTwo" Package.

  1. SuiteTwoBase.java - This class will be used as base class of test suite two.
  2. SuiteTwoCaseOne.java - This class will be used as test case one of suite two.
  3. SuiteTwoCaseTwo.java - This class will be used as test case two of suite two.
"com.stta.utility" Package
This package will be considered as utility package and framework's utility related classes will be created under this package. At present, create bellow given 2 packages and later on will create more classes If required.
  1. Read_XLS.java - Functions related to read data from .xls files will be will be created In this class.
  2. SuiteUtility.java - Utility functions will be created In this class.
Now your packages structure will looks like bellow.


We are going very slow In data driven framework creation and I am trying to cover each and every point from very basic level so that any one can create and understand this framework very easily.

10 comments:

  1. I am unable to download any.java file.Is the download link has been disabled.Please help

    ReplyDelete
  2. You need to add those under the package...

    ReplyDelete
  3. For the "com.stta.utility" Package it says "create bellow given 2 packages" It should say create these two classes below it.

    ReplyDelete
  4. The same framework can be used for appium as well?

    ReplyDelete
    Replies
    1. Yes Its just the structure. Can be used for any kind of automation.

      Delete
  5. Same frame work can be used for appium as well?

    ReplyDelete
  6. thanks. Would be better if you can change "SuiteBase.java" to "SuiteBase" because when we add a class to the package by right clicking on it. It does not allow to type .java with class name. It comes automatically when we create class.

    Would be good for users with all different kinds of knowledge

    ReplyDelete