[−][src]Struct lw_webdriver::tab::Tab
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]
&mut self,
selector: Selector,
tofind: &str
) -> Result<Option<Element>, WebdriverError>
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]
&self,
script: &str,
args: Vec<JsonValue>
) -> Result<(), WebdriverError>
pub fn get_cookies(
&self
) -> Result<Vec<(String, usize, bool, String, String, bool, String)>, WebdriverError>
[src]
&self
) -> Result<Vec<(String, usize, bool, String, String, bool, String)>, WebdriverError>
pub fn set_cookie(
&self,
cookie: (String, usize, bool, String, String, bool, String)
) -> Result<(), WebdriverError>
[src]
&self,
cookie: (String, usize, bool, String, String, bool, String)
) -> Result<(), WebdriverError>
pub fn set_cookies(
&self,
cookies: Vec<(String, usize, bool, String, String, bool, String)>
) -> Result<(), WebdriverError>
[src]
&self,
cookies: Vec<(String, usize, bool, String, String, bool, String)>
) -> Result<(), WebdriverError>
pub fn get_page_source(&self) -> Result<String, WebdriverError>
[src]
Trait Implementations
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]
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>,