Take Screenshot

How to take/capture screenshot.

Configuration

First of all, the AtataContext should be configured to store screenshots. Take a look at Getting Started/Set Up/Screenshots.

For example:

AtataContext.Configure().
    // Do some initialization.
    AddScreenshotFileSaving().
    Build();

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:

Go.To<OrdinaryPage>().
    Report.Screenshot();
    // Report.Screenshot("optional title"); // To pass a title.

In Any Place

AtataContext.Current.Log contains a set of logging methods as well as Screenshot:

AtataContext.Current.Log.Screenshot("optional title");

As a Trigger

Use Screenshot trigger. Below are just 2 possible scenarios.

Before Button Click

[Screenshot]
// [Screenshot("optional title")] // To pass a title.
public Button<_> Save { get; private set; }

Upon Page Object Initialization

[Screenshot(on: TriggerEvents.Init)]
public class SomePage : Page<_>
{
}