I try to take screenshot from current page under test with LeanFT
to attach to report file.
RenderedImage img = browser.getPage().getSnapshot();
Reporter.reportEvent("Login","Login successful", Status.Passed, img);
I get error message:
com.hp.lft.sdk.GeneralLeanFtException: ERROR at com.hp.lft.sdk.internal.ReplayExceptionFactory.createDefault(ReplayExceptionFactory.java:202) at com.hp.lft.sdk.internal.ReplayExceptionFactory.createOrDefault(ReplayExceptionFactory.java:194) at com.hp.lft.sdk.internal.ReplayExceptionFactory.createOrDefault(ReplayExceptionFactory.java:21) at com.hp.lft.sdk.internal.TestObjectExecuterBehaviorBase$ReplayErrorHandler.onError(TestObjectExecuterBehaviorBase.java:65) at com.hp.lft.sdk.internal.CommunicationClientImpl.handleError(CommunicationClientImpl.java:221) at com.hp.lft.sdk.internal.CommunicationClientImpl.send(CommunicationClientImpl.java:96) at com.hp.lft.sdk.internal.TestObjectExecuterBehavior.executeMethod(TestObjectExecuter.java:44) at com.hp.lft.sdk.internal.TestObjectBase.executeMethod(TestObjectBase.java:123) at com.hp.lft.sdk.internal.TestObjectBase.getSnapshot(TestObjectBase.java:197)
Method in reference(https://admhelp.microfocus.com/leanft/en/14.03/JavaSDKReference/com/hp/lft/report/Reporter.html):
reportEvent(java.lang.String stepName, java.lang.String description, Status status, java.lang.Exception ex, java.awt.image.RenderedImage image) Adds a custom step to the LeanFT including the provided exception and image object.