download the latest version of poi api and try again
https://www.apache.org/dyn/closer.lua/poi/release/bin/poi-bin-3.15-20160924.zip
Thanks for the quick reply. Just to add we also need to add commons-collections4-x.x.jar but Apache has removed the Interface ListValuedMap from commons-Collections4-4.0.jar so use updated version 4.1 it has the required classes and Interfaces.
Refer here if you want to read Excel (2003 or 2007+) using java code.
http://www.codejava.net/coding/how-to-read-excel-files-in-java-using-apache-poi
I am getting below error whenever any of the test step fails and halts my flow of execution. I have all the keywords in try catch block. But not sure what is causing this.
Here is the snippet of a keyword.
@SuppressWarnings("deprecation")
public String VerifyText(String object,String data) {
String expected = data;
String actual = driver.findElement(By.xpath(OR.getProperty(object))).getText();
APP_LOGS.debug("verifyText" + "expected" + data);
try{
Assert.assertEquals(expected.trim(), actual.trim());
APP_LOGS.debug("verifyText");
}catch (Exception e) {
return Constants.KEYWORD_FAIL + object +" Not found." +"Error message: " + e.getMessage() ;
}
return Constants.KEYWORD_PASS;
}
Error that I am getting
Exception in thread "main" java.lang.reflect.InvocationTargetException
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)
NOTE: this is from Module 19. Also, the same code worked fine while I tested, without the actually implementing keyword. Something like
public String VerifyText(String object,String data) {
return Constants.KEYWORD_FAIL;
}
The above code would update the excel with a fail and still continue the execution.
InvocationTargetException can be caused because of many reasons send the complete stack trace.
Here is the full stack trace
Exception in thread "main" java.lang.reflect.InvocationTargetException
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 strattonTest.DriverScript.executeKeywords(DriverScript.java:187)
at strattonTest.DriverScript.start(DriverScript.java:127)
at strattonTest.DriverScript.main(DriverScript.java:73)
Caused by: junit.framework.ComparisonFailure: expected:<[]601.32> but was:<[$]601.32>
at junit.framework.Assert.assertEquals(Assert.java:100)
at junit.framework.Assert.assertEquals(Assert.java:107)
at strattonTest.Keywords.VerifyText(Keywords.java:149)
... 7 more
I'm not getting that error, that means that there is a problem with the configuration on your system.
start with deleting your jar files and downloading the latest version of all your jar files again.
I tried doing what you said. Below is the list of the new jar files I added. But no luck. Please let me in case I missed any.
All the jar files with Sel 3.01
*******Below is the list of the Jar that came with the latest POI.*******
log 4j 1.2.14
commons-codec-1.10
commons-collections4-4.1
commons-logging-1.2
junit-4.12
dom4j-1.1
poi-3.15
poi-ooxml-3.15
poi-ooxml-schemas-3.15
xmlbeans-2.6.0
curvesapi-1.04
poi-examples-3.15
poi-excelant-3.15
poi-scratchpad-3.15
******These are the files that were there in your Jar folder so thought of adding them as well.*******
mail.jar
saxon-8.7
SaxonLiaison
Yes I can. Please let me know the time you are available to connect.
P.S: I am in Melbourne.
I'll be available after my working hours i.e between 6:30PM-10:30PM (Australian Eastern Daylight Time (AEDT)) during weekdays (prefered) 8-10 Feb and then 13 onwards.
Sorry I missed your message. Please let me know under which timezone you live. I believe it is better if we book our calendars and then meet on that specific time.
Great so let's meet on monday @4:00pm IST, let me know if you want to push it a bit early(before 4:00pm). My skype id is vinayak.bahri. Please share yours skype id as well. I have tried adding you in my account but still want to be double sure.
Talk to you soon.
Hi,
Please let me know when you are available to do skype chat.
Thanks
Vinayak
Hi ashish,
Can we schedule a call now? I am still stuck on the same step i.e. the system giving me error while running the cases.
Thanks
Vinayak