Sei sulla pagina 1di 3

Selenium Webdriver Data-Driven Framework

Selenium Webdriver Data-Driven Framework is where test input and output values are from
data files (ODBC sources, CVS files, Excel files, and DAO objects) and are loaded into variables in
captured or manually coded scripts.

In this framework, variables are used for both the input values and output verification values.
The framework should include navigation through the program, reading of the data files, and
logging of test status and information. All the processes should be in the test scripts. The
framework should have the following features:

 Well defined architectural design


 Less time to test large data
 Script execution in multiple environments
 Easier, faster, and efficient analysis of result logs
 Communication of results
 Easy debugging and script maintenance
 Robust and stable due to error and exception handling
 100% reliability of utility scripts, online execution and report packages.

http://seleniummaster.com/sitecontent/index.php/selenium-web-driver-menu/selenium-test-
automation-with-java/137-selenium-webdriver-data-driven-framework

What is Keyword Driven Framework?

Keyword Driven Framework is a type of Functional Automation Testing Framework which is


also known as Table-Driven testing or Action Word based testing. The basic working of the
Keyword Driven Framework is to divide the Test Case in to four different parts. First is called as
Test Step, second is Object of Test Step, third is Action on Test Object and fourth is Data for Test
Object.

Difference between Absolute path & Relative path.

Absolute path will start with root path (/) and Relative path will from current path (//)
1. Tell me some TestNG Annotations.

@BeforeMethod,@AfterMethod

@BeforeTest,@AfterTest,

@BeforeGroups,@AfterGroups,

@BeforeSuite, @AfterSuite,

@BeforeClass,@AfterClass,

@Test, @DataProvider, @Parameters,@Listeners ,@Factory

Selenium:
1. How do you set text box with a value.
2. How do u select 2nd element in a list.
3. What type of framework are you using for selenium automation?
4. What annotations did you use?
5. Diff between Assert and assert verify ?
6. Diff between driver.close & driver.quit?

Readexcel Function:

Write Readexcel function with String Two dimensional arrays and I give the two arguments
one is Excel sheet path and secod one is Excel sheet Name. ex:- Public String []
[]Readexcel(String ExcelPath, String SheetName).

a. Create the File object reference variable to give the excel sheet path.

b. We have to create the Fileinputstream object reference variable for import the data from
excel sheet.

c. Create the HsssfWorkBook object reference variable.

d. Create the HsssfSheet object reference variable

e. Identify how many rows and columns. And reading each row and columns for repeating all
the rows and columns I write the nested for loop.
CellToString Function:

Reading every cell. What type data is coming from a cell.. Numeric or string for that we have to
write the cellToString function.

In cell to string function write the getCellType method , for numeric value write
getNumericCellValue , for StringValue write the getStringValue method.

WriteExcel Function:

Write, writeExcel function with three arguments. one is Excel sheet path , second one is
SheetName, third one is Two dimensional arrays.

EX:-public void writeXL(String fPath, String fSheet, String[][] xData) throws Exception.

After writing the readExcel , writeExcel and CelltoString functions, I will call all the functions at
@Before annotation. And I will pass the parameters my excel sheets accordingly.

Potrebbero piacerti anche