Exception in thread "main" java.lang.NoSuchMethodError: com.relevantcodes.extentreports.model.Test.setLog(Lcom/relevantcodes/extentreports/model/Log;)V #261
Comments
Can you share complete code and version |
Version 2.40.0 public static ExtentReports extent; public static ExtentTest test; Reports(); test = extent.startTest(testCases.TestCaseID, testCases.TestCaseDescription); WebElement targetElement = driver.findElement(By.xpath(steps.FieldDefinition)); |
Test instance is created but when it is trying to log im getting issue Jan 11, 2016 11:14:03 AM com.relevantcodes.extentreports.Configuration Exception in thread "main" java.lang.NoSuchMethodError: com.relevantcodes.extentreports.model.Test.setLog(Lcom/relevantcodes/extentreports/model/Log;)V |
Did you recently use 2.40? There is some code that is from previous version I think. Can you do fresh build of project? Sometimes that helps because I have seen when you update jar it uses the old methods and does not reference latest jar. |
Let me check with your code gimme 2 mins |
I tried with same version (eclipse Luna).. No issues. |
actually i tried fresh build of project also. anyways i will check again |
Sorry can't be much help maybe Anshoo will able to figure out.. |
Thanks @karthikbhatnagar |
@anshooarora Please find the sample project which i have created and when i'm trying the run getting same error message. can please try to run the same file and let me know. Version 2.40.0 Jan 11, 2016 2:44:05 PM com.relevantcodes.extentreports.Configuration |
Thanks @anshooarora Donno what's wrong with my system. i getting the same error message which i have mentioned in earlier post. Can you please let me know what all external jars you have linked with the project |
I am also encountering the same error...Please help me to get it resolved. com.relevantcodes.extentreports.model.Test.setLog(Lcom/relevantcodes/extentreports/model/Log;)V |
@nikhilmullangi - jars: freemarker, jsoup and sqlite. They are included in lib folder if you download from website. If using maven dependency, they will be automatically added. Can you create a brand new project and use the latest beta from website or use its snapshot version as shown here under Download section. |
@agupta89 - were you also using version 2.10 earlier? |
@anshooarora : |
Most probably a build issue. Can you do a Project->Clean and try again? |
Its Working Now. i have mentioned same folder structure which was mentioned in the snapshot version. Thanks a ton @anshooarora |
Tried several times but all in vain. will replace with updated jar. Hope it will work. Thanks a lot @anshooarora . |
This does seem like a build/environment/IDE issue.. Try with the latest SNAPSHOT, looks like it worked for @nikhilmullangi also. |
@anshooarora
i'm running my test script, when my script started logging the details i'm getting the below error message.
Exception in thread "main" java.lang.NoSuchMethodError: com.relevantcodes.extentreports.model.Test.setLog(Lcom/relevantcodes/extentreports/model/Log;)V
at com.relevantcodes.extentreports.ExtentTest.log(ExtentTest.java:92)
at com.relevantcodes.extentreports.ExtentTest.log(ExtentTest.java:168)
extent-config.xml
UTF-8java Code
public static ExtentReports extent;
public static ExtentTest test;
extent = new ExtentReports(sreportname, true);
extent.loadConfig(new File("extent-config.xml"));
CommonActions.test.log(LogStatus.INFO, steps.FieldName,"Optional Element Not Found");
CommonActions.test.log(LogStatus.ERROR, steps.FieldName,"Query is returning null value at FeildName");
The text was updated successfully, but these errors were encountered: