Marionette::Session
Inherits Marionette::Logger / Reference / Object
Constants
Class methods
Start a new Session using the given driver and type. You can pass in any
capabilities you want here, and they'll be merged with the browser's
desired capabilities.
Instance methods
Accept an active alert. For confirmation boxes this is the same as clicking the "Ok" button.
Creates a new ActionBuilder instance and passes it to the block.
Given actions are not performed on block exit, so you will need
to call ActionBuilder#perform eventually.
Dismiss an active alert. For confirmation boxes this is the same as clicking the "Cancel" button.
Execute an arbitrary command with the given permissions. See Commands
for all available commands.
Execute a CDP (Chrome DevTools Protocol) command. See the API documentation for information on acceptable commands.
NOTE: Available for Chrome/Chromium only.
Execute arbitrary JavaScript in the context of the given document. Any args to be passed into the script should be provided as an array.
For now the result is returned as raw JSON.
Execute arbitrary JavaScript in the context of the given document. Any args to be passed into the script should be provided as an array.
This is an async process and does not return a result.
Find an element using the given selector. The strategy can be any
LocationStrategy. Default is LocationStrategy::Css. Returns
nil if no element with the given selector was found.
Find an element using the given selector. The strategy can be any
LocationStrategy. Default is LocationStrategy::Css. Raises an
exception if no element with the given selector was found.
Find a child of the given element. Returns nil if no element with the given
selector was found.
Find a child of the given element. Raises an exception if no element with the given selector was found.
Find multiple children of the given element with the given selector and
return them as an array.
Find multiple elements with the given selector and return them as an array.
Takes a full screen screenshot and return it as a Base64 encoded PNG string.
NOTE: Available for Firefox only.
Get the cookie with the specified name. Returns nil if no cookie was found.
Add an implicit wait that will occur before calls are made in a newly opened page.
Install an addon from the given path. If temporary is set
to true this addon will only be installed for the
current session.
NOTE: Available for Firefox only.
Get the issue message for the current cast context.
NOTE: Available for Chrome/Chromium only.
Launch a Chrome app using its id.
NOTE: Available for Chrome/Chromium only.
Return the set network conditions as a NetworkConditions
object. This will raise if network conditions haven't
been set already.
NOTE: Available for Chrome/Chromium only.
Set the network conditions.
NOTE: Available for Chrome/Chromium only.
Create a new Window. The window will not be switched to
automatically.
Get the orientation of the current driver.
NOTE: only available on non-W3C compatible drivers.
Set the orientation of the current driver.
NOTE: only available on non-W3C compatible drivers.
Add a timeout for page loads. Pages that take longer than the given amount of time to load
will throw an Error::TimeoutError.
Creates a new ActionBuilder instance and passes it to the block.
Actions are performed immediately upon block exit.
Set debug_mouse_move to true to get visual indicators
on screen when the mouse changes location.
Set Safari permissions.
NOTE: Available for Chrome/Chromium only.
Take a fullscreen screenshot and save it to the
given path as a PNG image.
NOTE: Available for Firefox only.
Take a screenshot and save it as a PNG at the given path. If scroll is
set to true the element will be scrolled to before taking the screenshot.
Add a timeout for script execution. Scripts that take longer than the given amount
of time to execute will throw as Error::TimeoutError.
Set a single Safari permission.
NOTE: Available for Chrome/Chromium only.
Set the current casting sink.
NOTE: Available for Chrome/Chromium only.
Start mirroring the current tab using the given sink.
NOTE: Available for Chrome/Chromium only.
Stop casting to the current sink.
NOTE: Available for Chrome/Chromium only.
Take a screenshot of the element with the given element_id. If scroll is
set to true the element will be scrolled to before taking the screenshot.
The PNG data is returned as a Base64 encoded string.
Take a screenshot of the current visible portion of the screen. The PNG is returned as a Base64 encoded string.
Uninstall an addon using its id.
NOTE: Available for Firefox only.
Wait the given amount of time for an element to be available. If no element is found an exception will be raised.
Wait the given amount of time for an element to be available. If no element is found an exception will be raised.
Wait the given amount of time for elements to be available. If no element is found an exception will be raised.