You are on page 1of 3

FrameWork Component:

1. Business Component
2. Generic libraries:
3. Page Factory :
4. Test Cases :
5. Driver File(TestNG .Xml)
6. Test Data
7. Test Result
8. Screen Shot
9. Resources
Test Cases :
1. TestNG test case are built using testNg annotations ,
2. Each testing class can have multiple Test case , but test cases are distributed on the packages
basis of application modules(Like com.actitime.projectAndCustTest , com.actitime.reportsTest ..etc )
Test Data
1. Test data driven through testData xls sheet ,
2. Will keep all the test data which is required for the my test cases in excel file, and each row data is
dedicated for one test case
3. And also we can write result back to excel sheet using setExceldata generic method
Generic libraries:
1. Generic lib pakage contains multiple java file , that support various features of the framework, like
customized reporting, test data fetching , and webdriver Specific methods
2. Application independent reusable method ,which can be used for any projects ,contains
Excel_Lib , Reperting_Lib , WebdriverCommonUtill & Driver java class
a. Driver class provides browser driver instance
b. Excel_Lib class contains few reusable methods , those methods used to fetch test data from
Excel sheet
3. WebdriverCommonUtill java file contains webdriver specific custom method ,which can be used for
multiple application like Ajax and any (clickAndWait() , waitForPageToLoad() waitForElement Present
.etc
Business component
1. Business component contains application specific reusable methods , its is building block of our
automation test scripts ,
2. Business component are breakdown in to several Java files based on application module , each
java files contains business method specific to Application
3. Once we get the manual test cases from the manual team , first job is to understand the test cases
and creating reusable business method , if multiple test cases required
Page Factory :
1. Page factory is Java design pattern preferred by google, WebDriver's support library contains a
factory class.
2. We have used page factory design pattern to design Object repository (it means i can maintain all

the Xpath in single place ), we have consider each pages(Like login and customer) as one class and
keep all the Webelements page specific page .
3. In Page factory webelement are identified by @FindBy or @FindBys annotation
4. We provided getters methods in page factory class , to accesses page webelements to other
classes
Eg 1 (Sample Page factory class file )
Consider Login page as one class and place all the available webelement and action in that page
public class Login {
@FindBy(name="username")
private WebElement userName;
@FindBy(name="pwd")
private WebElement password;
@FindBy(xpath="//input[@type='submit']")
private WebElement loginBtn;
public WebElement getUserName() {
return userName;
}
public WebElement getPassword() {
return password;
}
public WebElement getLoginBtn() {
return loginBtn;
}
public void login(){
userName.sendKeys("admin");
password.sendKeys("manager");
loginBtn.click();
}
}
How to use pageFoctory webelement in a actual test cases
public class SampleTest {
@Test
public void TimeTrak1Test(){
Login loginPage = PageFactory.initElements(Driver.driver, Login.class); loginPage.login(); } }
}
}
Advantages
1. Directly we can store Webelement in a class (we cannot directly store webelement in .properties
and .xls file )
2. We can avoid duplicate object locators (means object xpath)
3. In case of development debug id changes , modification is required in page class not in the test
cases

4. Writing test cases will be easy and looks simple (just use getters to design test steps)
Driver File(TestNG .Xml)
1. Test NG .xml file is a brain of our frame, , which will takes care of executing all the testing classes
are specified in xml file,
2. We can declare environment variable (global variable )in xml file(like Url , )
3. We can do batch execution & grouping parallel execution.
Test Result
We used LOG-4j console results , and console result is integrated with Jenkins
Execution Steps
1. Framework driven through TestNg.xml file , once we run the driver xml which is execute the test
suite ,basically test suite contains a bunch of testNg classes , each tesNg classes can have multiple
test cases
2. Each scenario runs as TestNG test & when scenario runs , it call the excel libraries , which will
connect to the appropriate testdata.xls file , and get the test data which is required for the current test
case (We use apache POI to work with excel)
3. Once test data red, each test connect to business and Generic libraries to run the actual test
cases , once the execution is done finally we have LOG 4J to write a result in console
4. We have used Page Object Model , to maintains all the webelement and page specific
action(methode), which will help our framework to keep all element xpaths in page level

You might also like