You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The expectation is to get test using getXmlTest() method in Listeners such as IInvokedMethodListener and ITestListener while running JUnit 4 tests using testNG.
Actual behavior
While looking at JUnitTestClass, it seems like the xmlTest has been returned as null. Is there a way to get xmlTest in the ITestContext and ITestResult?
public class InvokedMethodListener implements IInvokedMethodListener {
@Override
public void beforeInvocation(IInvokedMethod method, ITestResult testResult) {
Thread.currentThread().setName(method.getTestMethod().getMethodName() + "@" + testResult.getTestClass().getXmlTest().getAllParameters()); // null
}
public class TmpSuiteListener implements ITestListener {
@Override
public void onTestStart(ITestResult result) {
try {
System.out.println(result.getTestClass().getXmlTest()) // null
} catch (Exception e) {
e.printStackTrace();
}
}
}
Is the issue reproducible on runner?
Shell
Maven
Gradle
Ant
Eclipse
IntelliJ
NetBeans
Test case sample
Please, share the test case (as small as possible) which shows the issue
Contribution guidelines
Incase you plan to raise a pull request to fix this issue, please make sure you refer our Contributing section for detailed set of steps.
The text was updated successfully, but these errors were encountered:
kamal-kaur04
changed the title
JUnitTestClass sets XmlTest as null
JUnitTestClass sets XmlTest as null when running JUnit Tests using TestNG
Aug 15, 2022
kamal-kaur04
changed the title
JUnitTestClass sets XmlTest as null when running JUnit Tests using TestNG
JUnitTestClass sets XmlTest as null when running JUnit 4 Tests using TestNG
Aug 15, 2022
TestNG Version
Expected behavior
The expectation is to get test using
getXmlTest()
method in Listeners such asIInvokedMethodListener
andITestListener
while running JUnit 4 tests using testNG.Actual behavior
While looking at JUnitTestClass, it seems like the xmlTest has been returned as
null
. Is there a way to get xmlTest in the ITestContext and ITestResult?Is the issue reproducible on runner?
Test case sample
Contribution guidelines
Incase you plan to raise a pull request to fix this issue, please make sure you refer our Contributing section for detailed set of steps.
The text was updated successfully, but these errors were encountered: