[][src]Struct lw_webdriver::tab::Tab

pub struct Tab { /* fields omitted */ }

Tabs are used to load a site and get informations.

 
let mut session = Session::new(Browser::Firefox, false).unwrap();
 
// using the default tab
session.tabs[0].navigate("https://www.mozilla.org/fr/").unwrap();

Methods

impl Tab[src]

pub fn new_from(id: String, session_id: Rc<String>) -> Tab[src]

pub fn get_session_id(&self) -> Rc<String>[src]

pub fn new(session: &mut Session) -> Result<&Tab, WebdriverError>[src]

Create a new tab in a session. This return an immutable reference (in a Result) because the tab is stored in the session.

pub fn select(&self) -> Result<(), WebdriverError>[src]

Select this tab. Selection is done automatically by this crate when you get informations.

pub fn navigate(&mut self, url: &str) -> Result<(), WebdriverError>[src]

Load a website

pub fn find(
    &mut self,
    selector: Selector,
    tofind: &str
) -> Result<Option<Element>, WebdriverError>
[src]

Find an element in the tab, selected by a Selector.

pub fn get_url(&self) -> Result<String, WebdriverError>[src]

Return the url of the current web page.

pub fn get_title(&self) -> Result<String, WebdriverError>[src]

Return the title of the tab.

pub fn back(&mut self) -> Result<(), WebdriverError>[src]

Navigate to the previous page.

pub fn forward(&mut self) -> Result<(), WebdriverError>[src]

Navigate forward.

pub fn refresh(&mut self) -> Result<(), WebdriverError>[src]

Refresh the page.

pub fn execute_script(
    &self,
    script: &str,
    args: Vec<JsonValue>
) -> Result<(), WebdriverError>
[src]

pub fn get_cookies(
    &self
) -> Result<Vec<(String, usize, bool, String, String, bool, String)>, WebdriverError>
[src]

pub fn set_cookies(
    &self,
    cookies: Vec<(String, usize, bool, String, String, bool, String)>
) -> Result<(), WebdriverError>
[src]

pub fn get_page_source(&self) -> Result<String, WebdriverError>[src]

Trait Implementations

impl Drop for Tab[src]

impl PartialEq<Tab> for Tab[src]

impl WebdriverObject for Tab[src]

Auto Trait Implementations

impl !RefUnwindSafe for Tab

impl !Send for Tab

impl !Sync for Tab

impl Unpin for Tab

impl UnwindSafe for Tab

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.