Forum Discussion
7 Replies
- karkadilValued Contributor
I suppose you can use OnLogCheckpoint event to create screenshots for every checkpoint.
Just create event handler function and put there
Log.Picture(Sys.Desktop.Picture())
- tristaanogreEsteemed Contributor
Do you need the screenshot for a success or is it sufficient to get the screenshot for an error? If error screenshots are what you need, you can do that for all errors for your project under Tools | Current Project Properties | Project | Playback. There's a checkbox that says "post image on error" that will take a screenshot of your current desktop whenever an error is logged.
Personally, I choose the path of "less is more" with regards to writing to the log. If some test or validation passes within the larger test case, I choose not to log anything. I really only need to know when something fails and, if it does, details about the failure. So, since a failed object checkpoint can automatically generate a screenshot (see above), there's no need to do any other work to do so.
- karkadilValued Contributor
I agree with Robert, in most cases it is enough to have the screenshot in case of error only
- shahid24Contributor
Hi ,
Thanks for the reply, would this give two screenshots, actual vs expected?Thanks
Shahid
- tristaanogreEsteemed Contributor
Why do you need the visual image screenshot of actual vs. expected for instances where the test passes? If it passes, that means everything is there... Actual = Expected. If it fails, as with an error, then the onlogerror screenshot will show you the Actual and the test log, in the information in the log, will detail what doesn't match.
For that matter, an image comparison of actual vs expected is moot for object checkpoints. An object checkpoint takes a snapshot of the object and your selected properties and compares that snapshot to what's actually rendered in your application. If you pick your properties within the checkpoint properly, screenshots don't matter. If you truly want an actual vs. expected image, then your best bet is to use region checkpoints/image comparison.
Related Content
Recent Discussions
- 22 hours agojstaehlin