Skip to main content

URL capture

I capture the current URL

Captures the current browser URL and binds it as the current URL in the global scope.

Example

  When I capture the current URL
And I navigate to "${the current URL}?q=gwen"
I capture the current URL as <name>

Captures the current browser URL and binds it to the given name in the global scope.

Where

  • <name> is the name to bind the captured URL to

Example

  When I capture the current URL as the base URL
And I navigate to "${the base URL}?q=gwen"
Then the current URL should start with the base URL
I capture the text in the current URL by regex "<expression>" as <name>

Extracts a substring from the current browser URL using the given regex and binds it to the given name in the global scope.

Where

  • <expression> is the regex expression
  • <name> is the name to bind the captured substring to

Example

  When I capture the text in the current URL by regex "q=([^&]*)" as q
Then q should be "gwen"