Implicit Page Open Logic

You can register a custom callback that will be called implicitly every time a web page is opened. One of the typical use cases is to inject cookies or values into a local storage before tests logic begins.

Auto Login

To register an open handler you need to define browserPageNavigationHandlerProvider config value. url = "http://localhost:8180" def userNameKey = 'userName' browserPageNavigationHandler = { passedUrl, fullUrl, currentUrl -> if (browser.localStorage.getItem(userNameKey)) { return } browser.localStorage.setItem(userNameKey, 'LoggedIn User') browser.reopen(fullUrl) } package scenarios.ui import static org.testingisdocumenting.webtau.WebTauGroovyDsl.* scenario("page open handlers") { browser.open('/logged-in-user') $('#welcome').should == 'Welcome LoggedIn User' } scenario("page open handlers during re-open") { browser.localStorage.clear() browser.reopen('/logged-in-user') $('#welcome').should == 'Welcome LoggedIn User' } Note: usage of localStorage is just an example. You can use cookies , call external services using http. or load credentials from a file system.