Skip to main content


Instructs an actor who has the ability to BrowseTheWeb to enter a value into a form input field.

Example widget

<input type="text" name="example" id="example" />

Lean Page Object describing the widget

import { By, PageElement } from '@serenity-js/web'

class Form {
static exampleInput = () =>
.describedAs('example input')

Entering the value into a form field

import { actorCalled } from '@serenity-js/core';
import { Enter } from '@serenity-js/web';

await actorCalled('Esme')
Enter.theValue('Hello world!').into(Form.exampleInput()),

Handling sensitive information

By design, any data handled by an actor appears in Serenity/JS reports. To prevent the exposure of any sensitive information, such as passwords or tokens, you should use Masked.

import { actorCalled, Masked } from '@serenity-js/core'
import { Enter } from '@serenity-js/web'

await actorCalled('Esme')
Enter.theValue(Masked.valueOf('your little secret').into(Form.exampleInputField()),

// Gets reported as: "Esme enters [a masked value] into the example input field"

Learn more





  • theValue(...values: Answerable<string | number | string[] | number[]>[]): { into: (field: Answerable<PageElement<any>>) => Interaction }
  • Instantiates this Interaction.


    • rest...values: Answerable<string | number | string[] | number[]>[]

      The text value to be entered

    Returns { into: (field: Answerable<PageElement<any>>) => Interaction }

    • into: (field: Answerable<PageElement<any>>) => Interaction
        • Parameters

          Returns Interaction


  • instantiationLocation(): FileSystemLocation
  • Returns the location where this Activity was instantiated.

    Returns FileSystemLocation


  • toString(): string
  • Generates a human-friendly description to be used when reporting this Activity.

    Note: When this activity is reported, token #actor in the description will be replaced with the name of the actor performing this Activity.

    For example, #actor clicks on a button becomes Wendy clicks on a button.

    Returns string


  • performAs(actor: UsesAbilities & AnswersQuestions): Promise<void>