TestNG Parameterization with CSV Files

581 views
Skip to first unread message

Vijay Jade

unread,
Jul 11, 2013, 4:40:28 PM7/11/13
to testng...@googlegroups.com
Hi Group,
Thanks for posting and answering the questions by users. I am new to TestNG, Java, and Selenium. I could learn and get many questions cleared by visiting the posts.

I am trying to solve Parameterization using CSV files by passing it to TestNG DataProvider. For the Selenium Web driver parameterization of browser type and version I am using "@Parameters" passed through testng.xml. For the test method, is it possible for me to use TestNG CSV DataProvider along with the Webdriver parameters sent via "@Parameters" annotation?

I am able to read my contents of CSV file using "@DataProvider".
How can I pass the DataProvider (@DataProvider) of CSV file along with @Parameters used for WebDrivers?

Example is below:

@Parameters({"browser","version","profile"})
@Test(description = "TestingParametersandDataProvider", dataProvider = "CSVTestDataProvider")

public void TestUI(String browser,String version,String profile, HashMap<String,String> CSVparameterValues) throws Exception {

//Test code goes here.

//Test method uses browser type and version passed via testng.xml
//I want to provide CSV input file parameters into this method, via TestNG dataProvider

}

Please let me know, if you have any suggestions or examples to achieve this.

Thanks for the help in advance.
-VijayS


Reply all
Reply to author
Forward
0 new messages