Package: geb

## [Groovy] Class Browser

- geb.Browser

-     class Browser
      extends Object

  The browser is the centre of Geb. It encapsulates a WebDriver implementation and references a Page object that provides access to the content.

  Browser objects dynamically delegate all method calls and property read/writes that it doesn't implement to the current page instance via `propertyMissing ( )` and `methodMissing ( )`.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static String` | `CLOSE_OPTION` |
    `protected static String` | `HAS_NETWORK_CONDITIONS_CLASS_NAME` |
    `static String` | `QUERY_STRING_SEPARATOR` |
    `static String` | `UTF8` |

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `WebDriver` | `augmentedDriver` If the driver is remote, this object allows access to its capabilities (users of Geb should not access this object, it is used internally).
    `String` | `baseUrl`
    `WebDriver` | `driver`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Browser()` Create a new browser with a default configuration loader, loading the default configuration file.
    `Browser(Configuration config)` Create a new browser backed by the given configuration.
    `Browser(Map props, Configuration config)` Creates a new browser instance backed by the given configuration, then applies `props` as property overrides on the browser.

  - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `<T extends Page>` | `T` | `at(Class<T> pageType)` Checks if the browser is at the current page by running the at checker for this page type
    `<T extends Page, R>` | `R` | `at(Class<T> pageType, Closure<R> assertions)` Checks if the browser is at the current page by running the at checker using `at(pageType)`.
    `<T extends Page>` | `T` | `at(T page)` Checks if the browser is at the current page by running the at checker for this page instance
    `<T extends Page, R>` | `R` | `at(T page, Closure<R> assertions)` Checks if the browser is at the current page by running the at checker using `at(page)`.
    `` | `void` | `checkIfAtAnUnexpectedPage(Class<? extends Page>[] expectedPages)` Check if at one of the pages configured to be unexpected.
    `` | `void` | `checkIfAtAnUnexpectedPage(Page[] expectedPages)` Check if at one of the pages configured to be unexpected.
    `` | `void` | `cleanReportGroupDir()` Removes the directory returned by getReportGroupDir() from the filesystem if it exists.
    `` | `void` | `clearCookies(String[] additionalUrls)` Clears cookies for the current domain and a number of additional domains by navigating the browser to each of to the urls passed as the argument to this method and clearing cookies for them.
    `` | `void` | `clearCookies()` Clears all cookies for the current domain that the browser has.
    `` | `void` | `clearCookiesQuietly()` Clears all cookies that the browser currently has, suppressing any webdriver exceptions.
    `` | `void` | `clearWebStorage()` Clears web storage, that is both local and session storage for the current domain.
    `` | `void` | `clearWebStorageQuietly()` Clears web storage, that is both local and session storage for the current domain, suppressing any webdriver exceptions.
    `` | `void` | `close()` Closes the current driver window.
    `` | `protected WebDriver` | `createDriver()` Called to create the driver, the first time it is requested.
    `` | `protected NavigatorFactory` | `createNavigatorFactory()` Called to create the navigator factory, the first time it is requested.
    `<T extends Page>` | `T` | `createPage(Class<T> pageType)` Creates a new instance of the given page type and initialises it.
    `<T>` | `protected T` | `doWithWindow(Map options, Closure<T> block)`
    `` | `static Browser` | `drive(Closure script)` Creates a new browser object via the default constructor and executes the closure with the browser instance as the closure's delegate.
    `` | `static Browser` | `drive(Configuration conf, Closure script)` Creates a new browser with the configuration and executes the closure with the browser instance as the closure's delegate.
    `` | `static Browser` | `drive(Map browserProperties, Closure script)` Creates a new browser with the properties and executes the closure with the browser instance as the closure's delegate.
    `` | `static Browser` | `drive(Browser browser, Closure script)` Executes the closure with browser as its delegate.
    `<T>` | `Optional<T>` | `driverAs(Class<T> castType)`
    `` | `Set<String>` | `getAvailableWindows()` Retrieves all available windows
    `` | `String` | `getBaseUrl()` The url to resolve all relative urls against.
    `` | `Configuration` | `getConfig()` Provides access to the configuration object assoicated with this browser.
    `` | `String` | `getCurrentUrl()` Retrieves the current url
    `` | `String` | `getCurrentWindow()` Retrieves current window
    `` | `WebDriver` | `getDriver()` The driver implementation used to automate the actual browser.
    `` | `JavascriptInterface` | `getJs()` Returns a newly created javascript interface connected to this browser.
    `` | `WebStorage` | `getLocalStorage()` Returns an object that allows access to and manipulation of local storage.
    `` | `NavigatorFactory` | `getNavigatorFactory()` Returns the factory that creates navigator instances for this browser.
    `` | `Page` | `getPage()` Provides access to the current page object.
    `` | `File` | `getReportGroupDir()` The directory that will be used for the method.
    `` | `WebStorage` | `getSessionStorage()` Returns an object that allows access to and manipulation of session storage.
    `` | `void` | `go(String url)` Sends the browser to the given url.
    `` | `void` | `go(String url, UrlFragment fragment)` Sends the browser to the given url and fragment.
    `` | `void` | `go(Map params, UrlFragment fragment)` Sends the browser to the base url with the given query params and fragment.
    `` | `void` | `go(Map params, String url, UrlFragment fragment)` Sends the browser to the given url with the given query params and fragment.
    `` | `boolean` | `isAt(Class<? extends Page> pageType, boolean honourGlobalAtCheckWaiting)` Checks if the browser is at the given page by running the at checker for this page type, suppressing assertion errors.
    `` | `boolean` | `isAt(Page page, boolean honourGlobalAtCheckWaiting)` Checks if the browser is at the given page by running the at checker for this page instance, suppressing assertion errors.
    `` | `Object` | `methodMissing(String name, Object args)` Delegates the method call directly to the current page object.
    `<T extends Page>` | `T` | `page(Class<T> pageClass)` Changes the browser's page to be an instance of the given class.
    `` | `Page` | `page(Class<? extends Page>[] potentialPageClasses)` Changes the browser's page to be an instance of the first given type whose at checker returns a true value.
    `<T extends Page>` | `T` | `page(T page)` Sets this browser's page to be the given page after initializing it.
    `` | `Page` | `page(Page[] potentialPageInstances)` Changes the browser's page to be an instance of the first given instance whose at checker returns a true value.
    `` | `void` | `pause()` Indefinitely waits for `geb.unpause` javascript variable to be set to `true` in the driven browser.
    `` | `Object` | `propertyMissing(String name)` Delegates the property access directly to the current page object.
    `` | `Object` | `propertyMissing(String name, Object value)` Delegates the property assignment directly to the current page object.
    `` | `void` | `quit()` Quits the driver.
    `` | `void` | `report(String label)` Writes a snapshot of the browser's state to the current getReportGroupDir() using the config's reporter.
    `` | `void` | `reportGroup(String path)` Sets the "group" for all subsequent reports, which is the relative path inside the reports dir that reports will be written to.
    `` | `void` | `reportGroup(Class clazz)` Sets the report group to be the full name of the class, replacing "." with "/".
    `` | `void` | `resetNetworkLatency()` Removes any previously configured network latency.
    `` | `void` | `setBaseUrl(String baseUrl)` Changes the base url used for resolving relative urls.
    `` | `void` | `setDriver(WebDriver driver)` Set (or change) the webdriver underneath this browser.
    `` | `void` | `setNetworkLatency(java.time.Duration duration)` Allows to introduce network latency to the browser being driven.
    `` | `protected Object` | `switchToWindow(String window)`
    `<T extends Page>` | `T` | `to(Map params, Class<T> pageType, Object[] args)` Sends the browser to the given page type's url, sets the page to a new instance of the given type and verifies the at checker of that page.
    `<T extends Page>` | `T` | `to(Map params, Class<T> pageType, UrlFragment fragment, Object[] args)` Sends the browser to the given page type's url, sets the page to a new instance of the given type and verifies the at checker of that page.
    `<T extends Page>` | `T` | `to(Map params, T page, Object[] args)` Sends the browser to the given page instance url, sets the page to the given page instance and verifies the at checker of that page.
    `<T extends Page>` | `T` | `to(Map params, T page, UrlFragment fragment, Object[] args)` Sends the browser to the given page instance url, sets the page to a new instance of the given type and verifies the at checker of that page.
    `` | `void` | `verifyAtImplicitly(Class<? extends Page> targetPage)`
    `` | `void` | `verifyAtImplicitly(Page targetPage)`
    `<T extends Page>` | `T` | `via(Map params, Class<T> pageType, Object[] args)` Sends the browser to the given page type's url and sets the page to a new instance of the given type.
    `<T extends Page>` | `T` | `via(Map params, Class<T> pageType, UrlFragment fragment, Object[] args)` Sends the browser to the given page type's url and sets the page to a new instance of the given type.
    `<T extends Page>` | `T` | `via(Map params, T page, Object[] args)` Sends the browser to the given page instance url and sets the page the given instance.
    `<T extends Page>` | `T` | `via(Map params, T page, UrlFragment fragment, Object[] args)` Sends the browser to the given page instance url and sets the page the given instance.
    `<T>` | `T` | `withNewWindow(Map options, Closure windowOpeningBlock, Closure<T> block)` Expects the first closure argument to open a new window and calls the second closure argument in the context of the newly opened window.
    `<T>` | `T` | `withNewWindow(Closure windowOpeningBlock, Closure<T> block)` Expects the first closure argument to open a new window and calls the second closure argument in the context of the newly opened window.
    `<T>` | `T` | `withWindow(String window, Closure<T> block)` Executes a closure within the context of a window specified by a name
    `<T>` | `List<T>` | `withWindow(Closure specification, Closure<T> block)` Executes a closure within the context of all windows for which the specification closure returns groovy truth.
    `<T>` | `List<T>` | `withWindow(Map options, Closure specification, Closure<T> block)` Executes a closure within the context of all windows for which the specification closure returns groovy truth.
    `<T>` | `T` | `withWindow(Map options, String window, Closure<T> block)` Executes a closure within the context of a window specified by a name

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `equals, toString, hashCode, getClass, notify, notifyAll, wait, wait, wait`

- - ### Field Detail

    - #### public static final String CLOSE_OPTION

    - #### protected static final String HAS_NETWORK_CONDITIONS_CLASS_NAME

    - #### public static final String QUERY_STRING_SEPARATOR

    - #### public static final String UTF8

  - ### Property Detail

    - #### @Lazy
      WebDriver augmentedDriver

      If the driver is remote, this object allows access to its capabilities (users of Geb should not access this object, it is used internally).

    - #### String baseUrl

    - #### WebDriver driver

  - ### Constructor Detail

    - #### Browser()

      Create a new browser with a default configuration loader, loading the default configuration file.

      See Also:
        ConfigurationLoader

    - #### Browser(Configuration config)

      Create a new browser backed by the given configuration.

      See Also:
        Configuration

    - #### Browser(Map props, Configuration config)

      Creates a new browser instance backed by the given configuration, then applies `props` as property overrides on the browser.

      See Also:
        Configuration

  - ### Method Detail

    - #### <T extends Page> T at(Class<T> pageType)

      Checks if the browser is at the current page by running the at checker for this page type A new instance of the page is created for the at check. If the at checker is successful, this browser object's page instance is updated to the new instance of the given page type and the new instance is returned. If the given pageType does not define an at checker, UndefinedAtCheckerException is thrown.

      If implicit assertions are enabled (which they are by default). This method will only ever return a page instance or throw an AssertionError

      Returns:
        a page instance of the given page type when the at checker succeeded or null otherwise (never null if implicit assertions are enabled)

    - #### <T extends Page, R> R at(@DelegatesTo.Target
      Class<T> pageType, @DelegatesTo(strategy: DELEGATE_FIRST, genericTypeIndex: 0)
      Closure<R> assertions)

      Checks if the browser is at the current page by running the at checker using `at(pageType)`. If the at checker is successful, the `assertions` closure passed as the last argument is executed with the delegate set to an instance of the `pageType` class. If implicit assertions are enabled (which they are by default), each statement in the `assertions` closure is implicitly asserted.

      Returns:
        the value returned from `assertions` closure

    - #### <T extends Page> T at(T page)

      Checks if the browser is at the current page by running the at checker for this page instance If the at checker is successful, this browser object's page instance is updated to the said instance of the page. If the given page object does not define an at checker, UndefinedAtCheckerException is thrown.

      If implicit assertions are enabled (which they are by default), this method will only ever return a page instance or throw an AssertionError

      Returns:
        a page instance of the passed page after initializing when the at checker succeeded or null otherwise (never null if implicit assertions are enabled)

    - #### <T extends Page, R> R at(@DelegatesTo.Target
      T page, @DelegatesTo(strategy: DELEGATE_FIRST)
      Closure<R> assertions)

      Checks if the browser is at the current page by running the at checker using `at(page)`. If the at checker is successful, the `assertions` closure passed as the last argument is executed with the delegate set to the said instance of the page. If implicit assertions are enabled (which they are by default), each statement in the `assertions` closure is implicitly asserted.

      Returns:
        the value returned from `assertions` closure

    - #### void checkIfAtAnUnexpectedPage(Class<? extends Page>[] expectedPages)

      Check if at one of the pages configured to be unexpected.

      throws:
        UnexpectedPageException when at an unexpected page
      Parameters:
        `expectedPages` - allows to specify which of the unexpected pages to ignore for the check

    - #### void checkIfAtAnUnexpectedPage(Page[] expectedPages)

      Check if at one of the pages configured to be unexpected.

      throws:
        UnexpectedPageException when at an unexpected page
      Parameters:
        `expectedPages` - allows to specify which of the unexpected pages to ignore for the check

    - #### void cleanReportGroupDir()

      Removes the directory returned by getReportGroupDir() from the filesystem if it exists.

    - #### void clearCookies(String[] additionalUrls)

      Clears cookies for the current domain and a number of additional domains by navigating the browser to each of to the urls passed as the argument to this method and clearing cookies for them.

      Parameters:
        `additionalUrls` - urls for which the cookies should be cleared in addition to the current domain

    - #### void clearCookies()

      Clears all cookies for the current domain that the browser has.

      If the driven browser has accumulated cookies for additional domains that are to be cleared then clearCookies(java.lang.String[]) method should be used.

      See Also:
        Options.deleteAllCookies

    - #### void clearCookiesQuietly()

      Clears all cookies that the browser currently has, suppressing any webdriver exceptions.

    - #### void clearWebStorage()

      Clears web storage, that is both local and session storage for the current domain.

    - #### void clearWebStorageQuietly()

      Clears web storage, that is both local and session storage for the current domain, suppressing any webdriver exceptions.

    - #### void close()

      Closes the current driver window.

      See Also:
        WebDriver.close

    - #### protected WebDriver createDriver()

      Called to create the driver, the first time it is requested.

      Returns:
        The driver

    - #### protected NavigatorFactory createNavigatorFactory()

      Called to create the navigator factory, the first time it is requested.

      Returns:
        The navigator factory

    - #### <T extends Page> T createPage(Class<T> pageType)

      Creates a new instance of the given page type and initialises it.

      Returns:
        The newly created page instance

    - #### <T> protected T doWithWindow(Map options, Closure<T> block)

    - #### static Browser drive(Closure script)

      Creates a new browser object via the default constructor and executes the closure with the browser instance as the closure's delegate.

      Returns:
        the created browser

    - #### static Browser drive(Configuration conf, Closure script)

      Creates a new browser with the configuration and executes the closure with the browser instance as the closure's delegate.

      Returns:
        the created browser

    - #### static Browser drive(Map browserProperties, Closure script)

      Creates a new browser with the properties and executes the closure with the browser instance as the closure's delegate.

      Returns:
        the created browser

    - #### static Browser drive(Browser browser, Closure script)

      Executes the closure with browser as its delegate.

      Returns:
        browser

    - #### <T> Optional<T> driverAs(Class<T> castType)

    - #### Set<String> getAvailableWindows()

      Retrieves all available windows

      See Also:
        WebDriver.getWindowHandles

    - #### String getBaseUrl()

      The url to resolve all relative urls against. Typically the root of the application or system Geb is interacting with.

      The base url is determined by the configuration.

      See Also:
        Configuration.getBaseUrl

    - #### Configuration getConfig()

      Provides access to the configuration object assoicated with this browser.

    - #### String getCurrentUrl()

      Retrieves the current url

      See Also:
        WebDriver.getCurrentUrl

    - #### String getCurrentWindow()

      Retrieves current window

      See Also:
        WebDriver.getWindowHandle

    - #### WebDriver getDriver()

      The driver implementation used to automate the actual browser.

      The driver implementation to use is determined by the configuration.

      See Also:
        Configuration.createDriver

    - #### JavascriptInterface getJs()

      Returns a newly created javascript interface connected to this browser.

    - #### WebStorage getLocalStorage()

      Returns an object that allows access to and manipulation of local storage.

      See Also:
        WebStorage

    - #### NavigatorFactory getNavigatorFactory()

      Returns the factory that creates navigator instances for this browser.

      Returns:
        The navigator factory

    - #### Page getPage()

      Provides access to the current page object.

      All browser objects are created with a page type of Page initially.

    - #### File getReportGroupDir()

      The directory that will be used for the method.

      Uses the Configuration.getReportsDir for the base location for reports (throwing an exception if this is not set), and appending the current report group. The returned file object is guaranteed to exist on the filesystem.

      If the current report group is `null`, this method returns the same as `config.reportsDir`.

      See Also:
        reportGroup(java.lang.String)
        report(java.lang.String)

    - #### WebStorage getSessionStorage()

      Returns an object that allows access to and manipulation of session storage.

      See Also:
        WebStorage

    - #### void go(String url)

      Sends the browser to the given url. If it is relative it is resolved against the base url.

    - #### void go(String url, UrlFragment fragment)

      Sends the browser to the given url and fragment. If the url is relative it is resolved against the base url.

    - #### void go(Map params, UrlFragment fragment)

      Sends the browser to the base url with the given query params and fragment.

    - #### void go(Map params, String url, UrlFragment fragment)

      Sends the browser to the given url with the given query params and fragment. If the url is relative it is resolved against the base url.

    - #### boolean isAt(Class<? extends Page> pageType, boolean honourGlobalAtCheckWaiting)

      Checks if the browser is at the given page by running the at checker for this page type, suppressing assertion errors. If the at checker is successful, this browser object's page instance is updated the one the method is called with. If the given pageType does not define an at checker, UndefinedAtCheckerException is thrown. If the at check throws an AssertionError (as it will when implicit assertions are enabled) this method will suppress the exception and return false.

      Returns:
        true if browser is at the given page otherwise false

    - #### boolean isAt(Page page, boolean honourGlobalAtCheckWaiting)

      Checks if the browser is at the given page by running the at checker for this page instance, suppressing assertion errors. If the at checker is successful, this browser object's page instance is updated the one the method is called with. If the given page instance does not define an at checker, UndefinedAtCheckerException is thrown. If the at check throws an AssertionError (as it will when implicit assertions are enabled) this method will suppress the exception and return false.

      Returns:
        true if browser is at the given page otherwise false

    - #### Object methodMissing(String name, Object args)

      Delegates the method call directly to the current page object.

    - #### <T extends Page> T page(Class<T> pageClass)

      Changes the browser's page to be an instance of the given class.

      This method performs the following:

      - Create a new instance of the given class (which must be Page or a subclass thereof) and connect it to this browser object
      - Inform any registered page change listeners
      - Set the browser's page property to the created instance (if it is not already of this type)

      Note that it does not verify that the page matches the current content by running its at checker

      Returns:
        an initialized page instance set as the current page

    - #### Page page(Class<? extends Page>[] potentialPageClasses)

      Changes the browser's page to be an instance of the first given type whose at checker returns a true value.

      This method performs the following:

      - For each given page type:
        - Create a new instance of the class (which must be Page or a subclass thereof) and connect it to the browser object
        - Test if the page represents the new instance by running its at checker
        - If the page's at checker is successful:
          - Inform any registered page change listeners
          - Set the browser's page property to the instance
          - Discard the rest of the potentials
        - If the page's at checker is not successful:
          - Try the next potential
      - If none of the pages match:
        - Check if not at an unexpected page
        - Throw an UnexpectedPageException
    Returns:
      an initialized page instance set as the current page

  - #### <T extends Page> T page(T page)

    Sets this browser's page to be the given page after initializing it.

    This method performs the following:

    - Connect the instance passed in to this browser object
    - Inform any registered page change listeners
    - Set the browser's page property to the instance passed in

      Note that it does not verify that the page matches the current content by running its at checker

      Returns:
        a page instance passed as the first argument after initializing

    - #### Page page(Page[] potentialPageInstances)

      Changes the browser's page to be an instance of the first given instance whose at checker returns a true value.

      This method performs the following:

      - For each given page instance:
        - Connects the page instance to the browser object
        - Test if the page represents the instance by running its at checker
        - If the page's at checker is successful:
          - Inform any registered page change listeners
          - Set the browser's page property to the instance (if it is not already of this type)
          - Discard the rest of the potentials
      - If the page's at checker is not successful:
        - Try the next potential
      - If none of the pages match:
        - Check if not at an unexpected page
        - Throw an UnexpectedPageException
      Returns:
        an initialized page instance set as the current page

    - #### void pause()

      Indefinitely waits for `geb.unpause` javascript variable to be set to `true` in the driven browser.

      Can be used as an alternative to setting a breakpoint and running the JVM in debug mode for debugging purposes.

    - #### Object propertyMissing(String name)

      Delegates the property access directly to the current page object.

    - #### Object propertyMissing(String name, Object value)

      Delegates the property assignment directly to the current page object.

    - #### void quit()

      Quits the driver.

      See Also:
        WebDriver.quit

    - #### void report(String label)

      Writes a snapshot of the browser's state to the current getReportGroupDir() using the config's reporter.

      Parameters:
        `label` - The name for the report file (should not include a file extension)

    - #### void reportGroup(String path)

      Sets the "group" for all subsequent reports, which is the relative path inside the reports dir that reports will be written to.

      Parameters:
        `path` - a relative path, or `null` to have reports written to the base reports dir

    - #### void reportGroup(Class clazz)

      Sets the report group to be the full name of the class, replacing "." with "/".

      See Also:
        reportGroup(String)

    - #### void resetNetworkLatency()

      Removes any previously configured network latency.

      throws:
        geb.error.IncorrectDriverTypeException When called while using a driver which does not implement and is not augmentable to org.openqa.selenium.chromium.HasNetworkConditions

    - #### void setBaseUrl(String baseUrl)

      Changes the base url used for resolving relative urls.

      This method delegates to Configuration.setBaseUrl.

    - #### void setDriver(WebDriver driver)

      Set (or change) the webdriver underneath this browser.

      This should only be called before making any requests as a means to override the driver instance that would be created from the configuration. Where possible, prefer using the configuration mechanism to specify the driver implementation to use.

    - #### void setNetworkLatency(java.time.Duration duration)

      Allows to introduce network latency to the browser being driven.

      Helpful for exposing network related timing issues in automation code under development.

      Only supported when using a driver implementing or augmentable to org.openqa.selenium.chromium.HasNetworkConditions.

      throws:
        geb.error.IncorrectDriverTypeException When called while using a driver which does not implement and is not augmentable to org.openqa.selenium.chromium.HasNetworkConditions

    - #### protected Object switchToWindow(String window)

    - #### <T extends Page> T to(Map params, Class<T> pageType, Object[] args)

      Sends the browser to the given page type's url, sets the page to a new instance of the given type and verifies the at checker of that page.

      Returns:
        a page instance of the passed page type when the at checker succeeded
      See Also:
        page(geb.Page)
        Page.to

    - #### <T extends Page> T to(Map params, Class<T> pageType, UrlFragment fragment, Object[] args)

      Sends the browser to the given page type's url, sets the page to a new instance of the given type and verifies the at checker of that page.

      Returns:
        a page instance of the passed page type when the at checker succeeded
      See Also:
        page(geb.Page)
        Page.to

    - #### <T extends Page> T to(Map params, T page, Object[] args)

      Sends the browser to the given page instance url, sets the page to the given page instance and verifies the at checker of that page.

      Returns:
        a page instance of the passed page after initializing when the at checker succeeded
      See Also:
        page(geb.Page)
        Page.to

    - #### <T extends Page> T to(Map params, T page, UrlFragment fragment, Object[] args)

      Sends the browser to the given page instance url, sets the page to a new instance of the given type and verifies the at checker of that page.

      Returns:
        a page instance of the passed page type when the at checker succeeded
      See Also:
        page(geb.Page)
        Page.to

    - #### void verifyAtImplicitly(Class<? extends Page> targetPage)

    - #### void verifyAtImplicitly(Page targetPage)

    - #### <T extends Page> T via(Map params, Class<T> pageType, Object[] args)

      Sends the browser to the given page type's url and sets the page to a new instance of the given type.

      Returns:
        a page instance of the passed page type
      See Also:
        page(geb.Page)
        Page.to

    - #### <T extends Page> T via(Map params, Class<T> pageType, UrlFragment fragment, Object[] args)

      Sends the browser to the given page type's url and sets the page to a new instance of the given type.

      Returns:
        a page instance of the passed page type
      See Also:
        page(geb.Page)
        Page.to

    - #### <T extends Page> T via(Map params, T page, Object[] args)

      Sends the browser to the given page instance url and sets the page the given instance.

      Returns:
        a page instance that was passed after initializing it.
      See Also:
        page(geb.Page)
        Page.to

    - #### <T extends Page> T via(Map params, T page, UrlFragment fragment, Object[] args)

      Sends the browser to the given page instance url and sets the page the given instance.

      Returns:
        a page instance that was passed after initializing it.
      See Also:
        page(geb.Page)
        Page.to

    - #### <T> T withNewWindow(Map options, Closure windowOpeningBlock, @DelegatesTo(value: Browser, strategy: DELEGATE_FIRST)
      Closure<T> block)

      Expects the first closure argument to open a new window and calls the second closure argument in the context of the newly opened window. A map of options can also be specified that allows to close the new window, switch to a different page for closure executed in the context of the new window and also to wait for the window opening if the window opening is asynchronous.

      throws:
        geb.error.NoNewWindowException if the window opening closure doesn't open one or opens more than one new window
      Parameters:
        `options` - a map that can be used to pass additional options
        `windowOpeningBlock` - a closure that should open a new window
        `block` - closure to be executed in the new window context
      Returns:
        The return value of `block`

    - #### <T> T withNewWindow(Closure windowOpeningBlock, @DelegatesTo(value: Browser, strategy: DELEGATE_FIRST)
      Closure<T> block)

      Expects the first closure argument to open a new window and calls the second closure argument in the context of the newly opened window.

      throws:
        geb.error.NoNewWindowException if the window opening closure doesn't open one or opens more than one new window
      Parameters:
        `windowOpeningBlock` - a closure that should open a new window
        `block` - closure to be executed in the new window context
      Returns:
        The return value of `block`

    - #### <T> T withWindow(String window, @DelegatesTo(value: Browser, strategy: DELEGATE_FIRST)
      Closure<T> block)

      Executes a closure within the context of a window specified by a name

      Parameters:
        `window` - name of the window to use as context
        `block` - closure to be executed in the window context
      Returns:
        The return value of `block`

    - #### <T> List<T> withWindow(Closure specification, @DelegatesTo(value: Browser, strategy: DELEGATE_FIRST)
      Closure<T> block)

      Executes a closure within the context of all windows for which the specification closure returns groovy truth.

      Parameters:
        `specification` - closure executed once in context of each window, if it returns groovy truth for a given window then also the block closure is executed in the context of that window
        `block` - closure to be executed in the window context
      Returns:
        List containing values returned from `block` for each window for which `specification` returns groovy truth

    - #### <T> List<T> withWindow(Map options, Closure specification, @DelegatesTo(value: Browser, strategy: DELEGATE_FIRST)
      Closure<T> block)

      Executes a closure within the context of all windows for which the specification closure returns groovy truth.

      Parameters:
        `options` - a map that can be used to pass additional options
        `specification` - closure executed once in context of each window, if it returns groovy truth for a given window then also the block closure is executed in the context of that window
        `block` - closure to be executed in the window context
      Returns:
        List containing values returned from `block` for each window for which `specification` returns groovy truth

    - #### <T> T withWindow(Map options, String window, @DelegatesTo(value: Browser, strategy: DELEGATE_FIRST)
      Closure<T> block)

      Executes a closure within the context of a window specified by a name

      Parameters:
        `options` - a map that can be used to pass additional options
        `window` - name of the window to use as context
        `block` - closure to be executed in the window context
      Returns:
        The return value of `block`