Skip to main content

Regex bindings

<name> is defined in <textRef> by regex "<expression>"

Captures text from a text reference using the given regex expression and associates it with the given name. The value is resolved every time the name is referenced.

Where

  • <name> is the name of the name to associate the captured value to
  • <textRef> is the name of the binding containing the source text

    • Can be the name of any binding that contains or resolves to a text value, including a web element in which case the text in the element will be dynamically retrieved and used.
  • <expression> is the regex selector expression

Optionally accepts the @Eager, @Lazy or @Masked annotations.

  • @Eager immediately evaluates the <expression> and binds the result to <name>
  • @Lazy evaluates the <expression> and binds the result to <name> when it is first referenced
  • In the absence of either of the above annotations, <expression> is evaluated every time <name> is referenced
  • @Masked masks the captured value to prevent it from being logged as clear text

Example

  Given the date is "2021-09-22"
And the year is defined in the date by regex "(\d{4})"
Then the year should be "2021"