Professional Documents
Culture Documents
POF FrameWorkDescription
POF FrameWorkDescription
1. Business Componenet
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 :
Test Data
Generic libraries:
1. Genaric 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
Object Repository :
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 in specific page .
3. PAGE FACTORY class contains collection of WEBELEMNT
@FindBy(name="username")
private WebElement userName;
@FindBy(name="pwd")
private WebElement password;
@FindBy(xpath="//input[@type='submit']")
private WebElement loginBtn;
@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)
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