user3718160
user3718160

Reputation: 491

Testng ITestListener with parallel tests for skipped test

I'm running test automation with appium in java and I have an issue with how to catch skipped test on parallel testing.

When I was running my tests on a single device, I've always used ITestListener to catch my skipped tests and log them in my report. It was working nice until I tried to run my tests on multiple devices at the same time.

The issue come from the fact that it's a listener, and I can not pass any parameter to it (tell me if i'm wrong).

So now that I have multiple devices, I don't know how to differentiate which device is called in the method

void onTestSkipped(ITestResult var1);

any idea ?

Upvotes: 0

Views: 299

Answers (1)

juherr
juherr

Reputation: 5740

You can get object attributes from ITestResult and/or ITestContext in the listener.

You can add attributes via @BeforeMethod or @AfterMethod. See the documentation about injection.

Upvotes: 0

Related Questions