Navigates the current page to a URL. Tracked as a normal Gatling request/response.
// with an absolute static url
browserAction("HomePage").open("https://docs.gatling.io/")
// with a dynamic value computed from a Gatling Expression Language String
browserAction("name").open("#{url}")
// a dynamic value computed from a function
browserAction("name").open(session => session("url").as[String])
It is possible to set additional navigation options or page load validation.
See the NavigateOptions documentation here.
browserAction("name").open("https://docs.gatling.io/").withNavigateOptions(new Page.NavigateOptions().setWaitUntil(LOAD))
See the LoadValidations documentations here
val validationScript =
"""
(function () {
const el = document.querySelector('[data-test-id="chat-widget-iframe"]');
return document.readyState === "complete" &&
el !== null &&
el.getBoundingClientRect().width > 0 &&
el.getBoundingClientRect().height > 0;
})();
"""
val pageLoadValidator = PageLoadValidator(validationScript, null, new Page.WaitForFunctionOptions().setPollingInterval(100).setTimeout(30000))
browserAction("HomePage").open("https://gatling.io/").withLoadValidations(pageLoadValidator)
You can use it with default script that check pageCompleteCheckByInactivity similar that make sitespeed tool
browserAction("name").open("https://docs.gatling.io/").withLoadValidations()
Timeouts: see Timeouts — open is bounded by Playwright’s own navigation timeout, not
a plugin-level one.
← API overview · Flow Action · Browser Session Function · Clean Context