To generate html report in your test automation framework, you are using ExtentReport library and getting error while running your tests – “java.lang.NoSuchFieldError: VERSION_2_3_30“
This error normally occurs when you use an incompatible version of freemaker java library in your pom.xml.
<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker --> <dependency> <groupId>org.freemarker</groupId> <artifactId>freemarker</artifactId> <version>2.3.28</version> </dependency> <!-- https://mvnrepository.com/artifact/com.aventstack/extentreports --> <dependency> <groupId>com.aventstack</groupId> <artifactId>extentreports</artifactId> <version>5.0.9</version> </dependency>
You get error as “java.lang.NoSuchFieldError: VERSION_2_3_30” when running tests with extentreport, the reason is extent report version doesn’t compatible with 2.3.28 version freemaker, and it’s asking to upgrade the freemaker to 2.3.30.
so you should use the required version of freemaker as below and it will run the tests with out any issue.
<!-- https://mvnrepository.com/artifact/org.freemarker/freemarker --> <dependency> <groupId>org.freemarker</groupId> <artifactId>freemarker</artifactId> <version>2.3.30</version> </dependency> <!-- https://mvnrepository.com/artifact/com.aventstack/extentreports --> <dependency> <groupId>com.aventstack</groupId> <artifactId>extentreports</artifactId> <version>5.0.9</version> </dependency>
Refresh your maven dependencies by installing latest dependency and run your tests without any error.
Hope this helps!