gatling-playwright-plugin

Open Action

Navigates the current page to a URL. Tracked as a normal Gatling request/response.

// with an absolute static url
BrowserDsl.browserAction("name").open("https://docs.gatling.io/")
// with a dynamic value computed from a Gatling Expression Language String
BrowserDsl.browserAction("name").open("#{url}")
// a dynamic value computed from a function
BrowserDsl.browserAction("name").open(session -> session.getString("url"))

It is possible to set additional navigation options or page load validation.

See the NavigateOptions documentation here.

BrowserDsl.browserAction("name").open("https://docs.gatling.io/").withNavigateOptions(new Page.NavigateOptions().setWaitUntil(LOAD))

Load Validations

See the LoadValidations documentations here

String 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;
                })();
    """;
PageLoadValidator pageLoadValidator = new PageLoadValidator(validationScript, null, new Page.WaitForFunctionOptions().setPollingInterval(100).setTimeout(30000));

BrowserDsl.browserAction("name").open("https://docs.gatling.io/").withLoadValidations(pageLoadValidator)

You can use it with default script that check pageCompleteCheckByInactivity similar that make sitespeed tool

BrowserDsl.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