[−][src]Struct thirtyfour::Alert
Struct for managing alerts.
Methods
impl Alert
[src]
pub fn new(session_id: SessionId, conn: Arc<RemoteConnectionAsync>) -> 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]
pub async fn accept<'_>(&'_ self) -> WebDriverResult<()>
[src]
pub async fn send_keys<'_, S>(&'_ self, keys: S) -> WebDriverResult<()> where
S: Into<TypingData>,
[src]
S: Into<TypingData>,
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 !RefUnwindSafe for Alert
impl Send for Alert
impl Sync for Alert
impl Unpin for Alert
impl !UnwindSafe for Alert
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,