reportportal / agent-java-testNG

TestNG listener
Apache License 2.0
54 stars 20 forks source link

Getting Cannot instantiate class com.epam.reportportal.testng.ReportPortalTestNGListener #189

Closed php-del closed 2 years ago

php-del commented 2 years ago

Following are my pom.xml dependencies and listener configuration

tech.grasshopper extentreports-cucumber6-adapter 2.8.2 test org.projectlombok lombok 1.18.20 provided com.epam.reportportal agent-java-testng 5.1.3 com.epam.reportportal logger-java-logback 5.1.3 org.apache.maven.plugins maven-surefire-plugin 2.22.1 src/test/resources/cisuite/${suitefile} ${env} ${browser} ${suitefile} ${suite} ${test_region} ${updateBugInJira} ${updateTestRail} usedefaultlisteners true listener com.epam.reportportal.testng.ReportPortalTestNGListener I am getting the following error. Cannot instantiate class com.epam.reportportal.testng.ReportPortalTestNGListener [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process [ERROR] [ERROR] Cannot instantiate class com.epam.reportportal.testng.ReportPortalTestNGListener [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:656) [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:282) [ERROR] at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:245) [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1183) [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:1011) [ERROR] at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:857) [ERROR] at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:137) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:210) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:156) [ERROR] at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:148) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81) [ERROR] at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:56) [ERROR] at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128) [ERROR] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:305) I am using Cucumber with TestNG and the following is the reportportal.properties file kept at src/test/resources rp.endpoint = http://localhost:8080 rp.uuid = f6ce83b2-e26f-4fc9-9f03-03a9c163ece7 rp.launch = superadmin_TEST_EXAMPLE rp.project = superadmin_personal rp.attributes=key:value;value rp.reporting.async=true When I do keep the listener under properties out of the configuration as shown below, I do not get any error, and tests are executed but I see nothing in the test launch section of the report portal UI. com.morningstar.indexes market-data-ui-tests 0.0.1-SNAPSHOT UTF-8 11 11 SmokeSuite_qa.xml qa localChrome Smoke us-east-1 false true com.epam.reportportal.testng.ReportPortalTestNGListener Can someone please help me integrating my Test results to Report portal Dashboard?
HardNorth commented 2 years ago

@php-del Please provide detailed logs or an example project to reproduce the issue. Maven logging configuration: https://maven.apache.org/surefire/maven-surefire-plugin/examples/logging.html

php-del commented 2 years ago

Log.txt Attached is the detailed log @HardNorth

HardNorth commented 2 years ago

@php-del Still no any useful data, unforunately. Could you check your target\surefire-reports folder for any logs?

php-del commented 2 years ago

@HardNorth I have found one file in the target/surefire-reports section. It is as follows. Log2.txt

HardNorth commented 2 years ago

@php-del OK, found this in your Log:

Caused by: java.lang.NoSuchMethodError: okhttp3.OkHttpClient$Builder.callTimeout(Ljava/time/Duration;)Lokhttp3/OkHttpClient$Builder;

This usually happens when someone use outdated Selenium version. Since Selenium uses the same HTTP client as Report Portal. To fix that you need to update Selenium version on at least version 3.141.0.

This actually duplicate of the following issues: https://github.com/reportportal/examples-java/issues/61 https://github.com/reportportal/client-java/issues/182