WaitingPreset

A waiting preset is basically a named pair of timeout and interval values. They are very convenient to reflect specific interaction waiting periods (for instance, some tasks may require a bigger timeout period, so one can create a "slow" waiting preset for that.

.done()

Goes back to the corresponding configuration.

.interval(interval)

Sets this waiting preset timeout.

Parameter Description
interval the interval period for this waiting preset

.reset()

Resets this waiting preset interval, that is, both timeout and interval periods will be the default values for the corresponding configuration.

.timeout(timeout)

Sets this waiting preset timeout.

Parameter Description
timeout the timeout period for this waiting preset

InteractionListenerCollection

Handles interaction listeners registration and unregistration, as well as accessing all registered interaction listeners.

.add(interactionListener)

Adds a new interaction listener. If the same interaction listerer is added twice, it will only be called once (.equals() is used for comparison).

Parameter Description
interactionListener interaction listener to add

.clear()

Removes all interaction listeners from this configuration.

.done()

Goes back to the corresponding configuration.

.remove(interactionListener)

Removes an existing interaction listener (.equals() is used for comparison). If the listener does not exist, there is no state change.

Parameter Description
interactionListener interaction listener to remove

CookieCollection

Maintains all cookies for this browser. It is possible to access cookies, as well as add and remove them. This is a Minium adapter for `org.openqa.selenium.WebDriver.Options`

This is a chainable interface (to go back to the browser WebConfiguration, call .done()).

.add(cookie)

Adds a cookie to this browser.

Parameter Description
cookie the cookie to add

.clear()

Removes all cookies from this browser.

.done()

Goes back to this browser WebConfiguration.

.get(name)

Gets a cookie by name.

Parameter Description
name name of the cookie to get

.remove(name)

Removes a cookie from this browser.

Parameter Description
name name of the cookie we want to remove.

Window

This is a Minium adapter for org.openqa.selenium.WebDriver.Window.

.getPosition()

Get the position of the current window, relative to the upper left corner of the screen.

.getSize()

Get the size of the current window. This will return the outer window dimension, not just the view port.

.maximize()

Maximizes the current window if it is not already maximized.

.setPosition(targetPosition)

Set the position of the current window. This is relative to the upper left corner of the screen, synonymous to window.moveTo() in javascript.

Parameter Description
targetPosition the target position of the window.

.setSize(targetSize)

Set the size of the current window. This will change the outer window dimension, not just the view port, synonymous to window.resizeTo() in javascript.

Parameter Description
targetSize the target size.

Configuration

Fluent API for Minium configuration. For instance, you can write code like this:

 configuration
   .defaultTimeout(2, TimeUnit.SECONDS)
   .defaultInterval(1, TimeUnit.SECONDS)
   .waitingPreset("slow")
     .timeout(20, TimeUnit.SECONDS)
     .interval(5, TimeUnit.SECONDS)
   .done()
   .waitingPreset("fast")
     .timeout(1, TimeUnit.SECONDS)
     .interval(200, TimeUnit.MILLISECONDS)
   .done()
   .interactionListeners()
     .add(slowMotion(2, TimeUnit.SECONDS))
     .add(retry())
   .done()
 

.defaultInterval()

Gets the default interaction interval.

.defaultTimeout()

Gets the default interaction timeout.

.exceptionHandlers()

Gets the exception handlers collection so that exception handlers can be added or removed.

.interactionListeners()

Gets the interaction listeners collection so that listeners can be added or removed.

.waitingPreset(preset)

Gets the waiting preset corresponding to the passed preset value. That waiting can be used to access or update both interval and timeout periods. If that waiting preset was never configure, both interval and timeout periods will be the default ones.

Parameter Description
preset the waiting preset name

WebConfiguration

Extends Configuration by allowing cookies and browser windows management.

.cookies()

Gets the cookies collection so that cookies can be added or removed.

.window()

Gets the window manager object, which allows window position and dimensions to be controlled.