Take Screenshot

How to take/capture screenshot.

There are few ways to capture a screenshot depending on place where you need to do it.

In test or page object

Use Report.Screenshot(...) method:

    //.Report.Screenshot("optional title"); // To specify a title.
    //.Report.Screenshot(ScreenshotKind.FullPage); // To specify a kind (FullPage/Viewport).

In any place


Using trigger

Use TakeScreenshot trigger. Below are just 2 possible scenarios.

Before button click

// [TakeScreenshot("optional title", TriggerEvents.BeforeClick)] // To specify a title.
// [TakeScreenshot(ScreenshotKind.FullPage, TriggerEvents.BeforeClick)] // To specify a kind.
public Button<_> Save { get; private set; }

Upon page object initialization

public class SomePage : Page<_>