Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
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:
http://seleniummaster.com/sitecontent/index.php/selenium-web-driver-menu/selenium-test-
automation-with-java/137-selenium-webdriver-data-driven-framework
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,
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.
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.