[][src]Struct thirtyfour::Alert

pub struct Alert<'a> { /* fields omitted */ }

Struct for managing alerts.

Implementations

impl<'a> Alert<'a>[src]

pub fn new(session: &'a WebDriverSession) -> Self[src]

Create a new Alert struct. This is typically created internally via a call to WebDriver::switch_to().alert().

pub async fn text<'_>(&'_ self) -> WebDriverResult<String>[src]

Get the active alert text.

Example:

let alert = driver.switch_to().alert();
let text = alert.text().await?;

pub async fn dismiss<'_>(&'_ self) -> WebDriverResult<()>[src]

Dismiss the active alert.

Example:

driver.switch_to().alert().dismiss().await?;

pub async fn accept<'_>(&'_ self) -> WebDriverResult<()>[src]

Accept the active alert.

Example:

driver.switch_to().alert().accept().await?;

pub async fn send_keys<S, '_>(&'_ self, keys: S) -> WebDriverResult<()> where
    S: Into<TypingData>, 
[src]

Send the specified keys to the active alert.

Example:

You can specify anything that implements Into<TypingData>. This includes &str and String.

let alert = driver.switch_to().alert();
alert.send_keys("selenium").await?;
alert.accept().await?;

You can also send special key combinations like this:

let alert = driver.switch_to().alert();
alert.send_keys("selenium").await?;
alert.send_keys(Keys::Control + "a").await?;
alert.send_keys("thirtyfour").await?;

Auto Trait Implementations

impl<'a> !RefUnwindSafe for Alert<'a>

impl<'a> Send for Alert<'a>

impl<'a> Sync for Alert<'a>

impl<'a> Unpin for Alert<'a>

impl<'a> !UnwindSafe for Alert<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,