Extent: Add Class name to Test Success

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP

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");



Extent Report



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

Popular posts from this blog

Executable numpy error

PySpark count values by condition

Trying to Print Gridster Items to PDF without overlapping contents