Struct fantoccini_stable::Client [] [src]

pub struct Client(_);

A WebDriver client tied to a single browser session.

Methods

impl Client
[src]

[src]

Create a new Client associated with a new WebDriver session on the server at the given URL.

Returns two futures -- one that resolves to a handle for issuing additional WebDriver tasks, and one that resolves once all tasks have been completed and the WebDriver session has been destroyed. Note that it is important to eventually wait for this future, as otherwise the WebDriver browser session may not be closed. For some drivers, such as geckodriver, this is particularly important, as multiple simulatenous sessions are not supported.

Note that the second future will not resolve until the Client has been dropped.

[src]

Set the User Agent string to use for all subsequent requests.

[src]

Terminate the connection to the webservice.

This function may be useful in conjunction with raw_client_for, as it allows you to close the automated browser window while doing e.g., a large download.

Note that this call only takes effect if there are no other copies of this Client. This function is safe to call multiple times. Returns true if the shutdown took effect. Returns true if the shutd

[src]

Navigate directly to the given URL.

[src]

Retrieve the currently active URL for this session.

[src]

Get the HTML source for the current page.

[src]

Go back to the previous page.

[src]

Refresh the current previous page.

[src]

Execute the given JavaScript script in the current browser session.

args is available to the script inside the arguments array. Since Element implements ToJson, you can also provide serialized Elements as arguments, and they will correctly serialize to DOM elements on the other side.

[src]

Issue an HTTP request to the given url with all the same cookies as the current session.

Calling this method is equivalent to calling with_raw_client_for with an empty closure.

[src]

Build and issue an HTTP request to the given url with all the same cookies as the current session.

Before the HTTP request is issued, the given before closure will be called with a handle to the Request about to be sent.

[src]

Find an element by CSS selector.

Find an element by its link text.

The text matching is exact.

[src]

Find an element using an XPath expression.

[src]

Wait for the given function to return true before proceeding.

This can be useful to wait for something to appear on the page before interacting with it. While this currently just spins and yields, it may be more efficient than this in the future. In particular, in time, it may only run is_ready again when an event occurs on the page.

[src]

Wait for the page to navigate to a new URL before proceeding.

If the current URL is not provided, self.current_url() will be used. Note however that this introduces a race condition: the browser could finish navigating before we call current_url(), which would lead to an eternal wait.

[src]

Locate a form on the page.

Through the returned Form, HTML forms can be filled out and submitted.