Skip to main content

Element capture

I capture element screenshot of <element>

Captures the screenshot of a web element and attaches it to the Gwen report.

Where

  • <element> the name of the web element to capture the screenshot of

Example

  Given the todo field can be located by class "new-todo"
When I navigate to "https://todomvc.com/examples/react/dist"
And I type "Walk the dog" in the todo field
And I capture element screenshot of the todo field
I capture element screenshot of <element> as <name>

Captures the screenshot of a web element, attaches it to the Gwen report, and binds the filepath of the saved image to the given name in the global scope.

Where

  • <element> the name of the web element to capture the screenshot of
  • <name> the name to bind the captured image filepath to

Example

  Given the todo field can be located by class "new-todo"
When I navigate to "https://todomvc.com/examples/react/dist"
And I type "Walk the dog" in the todo field
And I capture element screenshot of the todo field as my element screenshot