Extent: Add Class name to Test Success
Extent: Add Class name to Test Success
I want to add Test Class Name and Method Name into extent report as highlight in the picture. I want to change the loginInvalid to ClassName::Method name. I tried with following but no success.
@Override
public synchronized void onTestSuccess(ITestResult result)
System.out.println(result.getMethod().getMethodName() + " passed!");
test.get().pass(result.getTestContext().getClass().getName() + " Test passed");
Please help. Thanks in advance.
2 Answers
2
String feature = result.getMethod().getRealClass().getName() + ":" + result.getMethod().getMethodName();
ExtentTest extentTest = extent.createTest(feature, result.getMethod().getDescription());
extentTest = extentReport.createTest(this.getClass().getSimpleName() + "::" + Thread.currentThread().getStackTrace()[1].getMethodName());
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Comments
Post a Comment