2

I've been spending for at least 3 months building a Test Automation Framework from scratch using Selenium WebDriver(Java) and TestNG.

I did the next things:

  1. adapted the concepts of page-object-model.

  2. integrated excel functionality to save the test data.

  3. added ExtentReports rather than the default TestNG reporting.

  4. included object property file to my project.

This may sound silly but, I don't have any idea how to integrate other project in the framework that I've made. I have the next two questions:

  1. Let's say my project name for the framework is AutomationFramework, now when there's a new project example WebAppProject1, how should WebAppProject1 interact with AutomationFramework?
  2. How would I achieve the files from the framework in order for it to be used in WebAppProject1?

AutomationFramework project includes the ff classes:

a. Testcase.java - includes all @Test methods like Signup, Login, ForgotPassword

b. Page Object classes - classes that locate webElements. Login.java, Signup.java and so on

c. UserDetails.java - class that returns random data to Testcase.java like Firstname, Lastname and so on

d. ExcelConfig.java - class which sets up excel functionality like check last row and adding all test data to the excel file

e. ConfigProperty.java - this class calls the property name for each variables stored in object repository like app URL, chrome-driver path, excel path and so on

f. Config.property - *holds the app URL, chrome-driver path, excel path and so on *.

2 Answers 2

2

You should make your framework as abstract as possible so that your actual project can implement your framework.

For example:

In your framework, you have an abstract page that has:

  • page title
  • page header

You also have an abstract button that:

  • can be clicked (clickable)
  • this button's name

When it comes to actual project implementation, you can inherit from your abstract classes to realize actual implementation.

2

I have worked in the similar way where I had developed an automation framework which I have implemented on similar kind of projects(I work on Banking applications, so they have "almost" every functionality and fields same).

Approach:

Test Suite file(Excel file): It contains the list of all the modules(say Scenarios) of the application with the flag suiteToRun which helps me to execute specific suites too.

Test Data file(Excel file): It contains the data which needs to be passed to the application based on which module I am executing. Elements file(Excel file): It contains all the Element IDs needed i the application

I have nowhere hardcoded any data or Element locator in the script which helped me to move to another project with minor changes (mostly in Excel file But few in code(for specific conditions))

I hope it should give you some better idea.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.