hemanthsridhar / testng-excel-dataprovider Goto Github PK
View Code? Open in Web Editor NEWTestNG data provider libraries to read from csv and excel(xlsx and xls)
TestNG data provider libraries to read from csv and excel(xlsx and xls)
@hemanthsridhar am using TestNG-DataProvider to generate multiple reports for a test case which is running in loop. The data is fetched from CSV sheet. Now the issue is, I have a column named count which contains value 1,2 3.. and so on. The values are in multiple rows. Suppose the value 1 present in column count is in 5 rows, value 2 is in 7 rows and so on. I want to generate a TestNG report for the column containing 1 as one report, column containing 2 as another report and so on. The number of different values in count column should be equal to the TestNG reports generated. I am able to generate report for each of the line but not for 5 rows as one. I am attaching the code I have written till now. The CSV looks like this: enter image description here
And the code I have written till now is below:
@dataProvider(name = "userDetails")
public static Object[][] readCsv() throws IOException {
CSVReader csvReader = new CSVReader(new FileReader("C:\Users\admin\Desktop\Appium3.csv"),',');
List<String[]> csvData=csvReader.readAll();
Object[][] csvDataObject=new Object[csvData.size()][2];
for (int i=0;i<csvData.size();i++) {
csvDataObject[i]=csvData.get(i);
}
return csvDataObject;
}
@test(dataProvider = "userDetails",priority = 2)
public void userLoginTest(String PLATFORM_NAME,String PLATFORM_VERSION,String DEVICE_NAME,String UDID,String SUPPORT_LOCATION_CONTEXT,String NO_RESET, String FULL_RESET, String appPackage,String appActivity, String url,String Count, String Action, String Element, String Identifier, String XPath , String ClassName , String SendKeysWait , String MoveToX, String MoveToY, String MoveToXPathClassName, String DownToX, String DownToY) throws InterruptedException {
if (Action.contains("Click") && Element.contains("Button")&&Identifier.contains("XPath")) {
Button b1 = new Button();
b1.ButtonClickByXpath(GetAppiumDriver.driver, XPath);
}
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.