Skip to content

I.getURL()

Returns the URL of the current page.

Usage

js
var url = I.getURL()

Returns

A string containing the full URL of the current page.

Example

js
I.click("Proceed to checkout")

// Extract the order ID from the URL using a regular expression
var url = I.getURL()
var match = url.match(/[?&]order_id=([^&]+)/)
var orderId = match ? match[1] : null
TEST.log.info("Order ID: " + orderId)

This example uses I.getURL() to retrieve the current page URL and extracts the order_id query parameter from the URL.