@DataProvider public Object[][]readxlsdata(){ Xls_Reader xls= new Xls_Reader("C:/Users/sairam/Desktop/login.xlsx"); int rows = xls.getRowCount("Sheet1"); int colms=xls.getColumnCount("Sheet1"); System.out.println("Number of Rows are " +rows); System.out.println("number of colums are" +colms); Object[][] data = new Object[rows-2][colms]; for(int i=2;i<=rows;i++){ for(int j=0;j<colms;j++){ data[i-2][j]=xls.getCellData("Sheet1", j, i); } }
[Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\Default suite\Default test.xml [Utils] Directory C:\Users\sairam\workspace\module15\test-output\Default suite exists: true SKIPPED: doLogin java.lang.RuntimeException: java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException at org.testng.internal.MethodInvocationHelper.invokeMethodNoCheckedException(MethodInvocationHelper.java:45) at org.testng.internal.MethodInvocationHelper.invokeDataProvider(MethodInvocationHelper.java:110) at org.testng.internal.Parameters.handleParameters(Parameters.java:429) at org.testng.internal.Invoker.handleParameters(Invoker.java:1240) at org.testng.internal.Invoker.createParameters(Invoker.java:980) at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1070) at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:129) at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:112) at org.testng.TestRunner.privateRun(TestRunner.java:746) at org.testng.TestRunner.run(TestRunner.java:600) at org.testng.SuiteRunner.runTest(SuiteRunner.java:366) at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:361) at org.testng.SuiteRunner.privateRun(SuiteRunner.java:319) at org.testng.SuiteRunner.run(SuiteRunner.java:268) at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52) at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86) at org.testng.TestNG.runSuitesSequentially(TestNG.java:1264) at org.testng.TestNG.runSuitesLocally(TestNG.java:1189) at org.testng.TestNG.runSuites(TestNG.java:1104) at org.testng.TestNG.run(TestNG.java:1076) at org.testng.remote.AbstractRemoteTestNG.run(AbstractRemoteTestNG.java:126) at org.testng.remote.RemoteTestNG.initAndRun(RemoteTestNG.java:152) at org.testng.remote.RemoteTestNG.main(RemoteTestNG.java:57) Caused by: java.lang.NoClassDefFoundError: org/apache/xmlbeans/XmlException at uploads.Xls_Reader.<init>(Xls_Reader.java:34) at uploads.login_xls.readxlsdata(login_xls.java:38) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:100) at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:51) at org.testng.internal.MethodInvocationHelper.invokeMethodNoCheckedException(MethodInvocationHelper.java:41) ... 22 more Caused by: java.lang.ClassNotFoundException: org.apache.xmlbeans.XmlException at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) ... 31 more
=============================================== Default suite Total tests run: 1, Failures: 0, Skips: 1 ===============================================
[TestNG] Time taken by org.testng.reporters.XMLReporter@6e8dacdf: 11 ms [TestNG] Time taken by org.testng.reporters.jq.Main@1d251891: 45 ms [TestNG] Time taken by org.testng.reporters.EmailableReporter2@7f63425a: 9 ms [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\testng-failed.xml [Utils] Directory C:\Users\sairam\workspace\module15\test-output exists: true [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\Default suite\testng-failed.xml [Utils] Directory C:\Users\sairam\workspace\module15\test-output\Default suite exists: true [TestNG] Time taken by [FailedReporter passed=0 failed=0 skipped=0]: 9 ms [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\old\Default suite\toc.html [Utils] Directory C:\Users\sairam\workspace\module15\test-output\old\Default suite exists: true [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\old\Default suite\Default test.properties [Utils] Directory C:\Users\sairam\workspace\module15\test-output\old\Default suite exists: true [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\old\Default suite\index.html [Utils] Directory C:\Users\sairam\workspace\module15\test-output\old\Default suite exists: true [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\old\Default suite\main.html [Utils] Directory C:\Users\sairam\workspace\module15\test-output\old\Default suite exists: true [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\old\Default suite\groups.html [Utils] Directory C:\Users\sairam\workspace\module15\test-output\old\Default suite exists: true [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\old\Default suite\classes.html [Utils] Directory C:\Users\sairam\workspace\module15\test-output\old\Default suite exists: true [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\old\Default suite\reporter-output.html [Utils] Directory C:\Users\sairam\workspace\module15\test-output\old\Default suite exists: true [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\old\Default suite\methods-not-run.html [Utils] Directory C:\Users\sairam\workspace\module15\test-output\old\Default suite exists: true [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\old\Default suite\testng.xml.html [Utils] Directory C:\Users\sairam\workspace\module15\test-output\old\Default suite exists: true [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\old\index.html [Utils] Directory C:\Users\sairam\workspace\module15\test-output\old exists: true [TestNG] Time taken by org.testng.reporters.SuiteHTMLReporter@7c75222b: 49 ms [Utils] Attempting to create C:\Users\sairam\workspace\module15\test-output\junitreports\TEST-uploads.login_xls.xml [Utils] Directory C:\Users\sairam\workspace\module15\test-output\junitreports exists: true [TestNG] Time taken by org.testng.reporters.JUnitReportReporter@511baa65: 8 ms