[−][src]Struct thirtyfour_sync::Alert
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 fn text(&self) -> WebDriverResult<String>
[src]
Get the active alert text.
Example:
let alert = driver.switch_to().alert(); let text = alert.text()?;
pub fn dismiss(&self) -> WebDriverResult<()>
[src]
pub fn accept(&self) -> WebDriverResult<()>
[src]
pub 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")?; alert.accept()?;
You can also send special key combinations like this:
let alert = driver.switch_to().alert(); alert.send_keys("selenium")?; alert.send_keys(Keys::Control + "a")?; alert.send_keys("thirtyfour")?;
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]
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> Instrument for T
[src]
fn instrument(self, span: Span) -> Instrumented<Self>
[src]
fn in_current_span(self) -> Instrumented<Self>
[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>,