reportportal / agent-java-testNG

TestNG listener
Apache License 2.0
54 stars 20 forks source link

[v5]agent-java-testng - ItemID should not be null (Test item is not getting created) #93

Closed arunkumar-muthusamy closed 4 years ago

arunkumar-muthusamy commented 4 years ago

While running the tests on Java+TestNG+LogBack with new version of agent-java-testng by pointing to V5 ReportPortal, i'm getting following exception. It used to work well until 5.0.0-BETA-6 version.

Exception in thread "TestNG-test=Multiple-1" java.lang.NullPointerException: ItemID should not be null
    at java.util.Objects.requireNonNull(Objects.java:228)
    at com.epam.reportportal.service.LaunchImpl.finishTestItem(LaunchImpl.java:283)
    at com.epam.reportportal.testng.TestNGService.finishTestMethod(TestNGService.java:167)
    at com.epam.reportportal.testng.BaseTestNGListener.onTestFailure(BaseTestNGListener.java:93)
    at org.testng.internal.TestListenerHelper.runTestListeners(TestListenerHelper.java:67)
    at org.testng.internal.Invoker.runTestListeners(Invoker.java:1389)
    at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1042)
    at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
    at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
    at java.lang.Thread.run(Thread.java:748)

pom.xml

        <dependency>
            <groupId>com.epam.reportportal</groupId>
            <artifactId>agent-java-testng</artifactId>
            <version>5.0.0-BETA-9</version>
        </dependency>
        <dependency>
            <groupId>com.epam.reportportal</groupId>
            <artifactId>logger-java-logback</artifactId>
            <version>5.0.0-BETA-9</version>
        </dependency>

TestNG.xml

<?xml version="1.0" encoding="UTF-8"?> 
    <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd">
<suite name="Login" parallel="classes" thread-count="2"
    data-provider-thread-count="2">
    <listeners>
        <listener class-name="com.epam.reportportal.testng.ReportPortalTestNGListener" />
    </listeners>
    <test name="Login">
        <classes>
            <class name="com.saucedemo.tests.login.AUTO123456_SauceDemo_Login_With_Valid_User" />
        </classes>
    </test>
</suite>

OS: Mac, java version "1.8.0_201" Note: You can run any TestNG test to reproduce it.

image

HardNorth commented 4 years ago

Unfortunately, TestNG made version 7 binary incompatible with version 6. We have to follow TestNG versions since there are a batch of users who want to move forward. And we have very limited resources to support many versions of TestNG.

arunkumar-muthusamy commented 4 years ago

Thank you, @HardNorth !

For anyone who end up with same issue, please update the TestNG version from 6.x.x to 7.x.x and update the TestNG version in IDE (in my case its Eclipse).

        <dependency>
            <groupId>org.testng</groupId>
            <artifactId>testng</artifactId>
            <version>7.1.0</version>
        </dependency>

Update/Install TestNG plugin version 7.1.1 in Eclipse

parthamaiti-hub commented 4 years ago

thanks. I got the issue . The solution works for me. much appreciated.