br.eti.kinoshita.selenium
Class DataDrivenSeleniumWebTest
java.lang.Object
br.eti.kinoshita.selenium.SeleniumWebTest
br.eti.kinoshita.selenium.DataDrivenSeleniumWebTest
public abstract class DataDrivenSeleniumWebTest
- extends SeleniumWebTest
An Excel data driven Selenium web test.
It behaves exactly as SeleniumWebTest, with the difference that
it contains a TestNG DataProvider that is created from an Excel
file. This Excel file name comes from selenium.properties.
This solution was found whilst navigating on the Internet. Check it
out here: http://www.qualitytesting.info/forum/topics/how-to-do-data-driven-using.
If you know whom is the original author, drop me a note please, and I will
make sure to have her/his name here as author, or I will pay some
Baden-Baden beers.
// TBD: think in a way to have Data Driven Tests from properties files,
XML, JSON, YAML, or any other test data source. Not only from Excel.
- Since:
- 0.1
- Author:
- Bruno P. Kinoshita - http://www.kinoshita.eti.br, Cesar Fernandes de Almeida
|
Field Summary |
protected static org.slf4j.Logger |
LOGGER
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOGGER
protected static final org.slf4j.Logger LOGGER
DataDrivenSeleniumWebTest
public DataDrivenSeleniumWebTest()
getTableName
public String getTableName()
- Returns:
- Name of Table in the XLS file. By default this value is "TABLE".
Override this method and return the constant you used in your Excel files
to delimit test data cells.
getSheetName
public abstract String getSheetName()
- Returns:
- Name of the Sheet in the XLS file.
getDataFromXLS
public Object[][] getDataFromXLS()
throws SeleniumWebTestException
- This is the method that enables data-driven tests. It returns an multi-
dimensional array of Objects to be used in tests.
- Throws:
SeleniumWebTestException
getTableArray
protected String[][] getTableArray(String sheetName,
String tableName)
throws SeleniumWebTestException
- Reads a XLS File and return an array of an array of objects,
just like testng data providers
- Parameters:
sheetName - Excel sheet nametableName - Excel table name
- Throws:
SeleniumWebTestException
Copyright © 2010-2011. All Rights Reserved.