/// Search for an element on the current page using the specified selector.
///
/// # Example:
/// ```rust
/// # use thirtyfour::error::WebDriverResult;
/// # use thirtyfour::{By, DesiredCapabilities, sync::WebDriver};
/// #
/// # fn main() -> WebDriverResult<()> {
/// #     let caps = DesiredCapabilities::chrome();
/// #     let driver = WebDriver::new("http://localhost:4444/wd/hub", &caps)?;
/// #     driver.get("http://localhost:8000")?;
/// let elem_text = driver.find_element(By::Name("input1"))?;
/// let elem_button = driver.find_element(By::Id("button-set"))?;
/// let elem_result = driver.find_element(By::Name("input-result"))?;
/// #     Ok(())
/// # }
/// ```
Search for an element on the current page using the specified selector.
Search for an element on the current page using the specified selector .
pub fn find_element(&self, by: By) -> WebDriverResult<WebElement> {
        let v = self
            .conn
            .execute(Command::FindElement(&self.session_id, by))?;
        unwrap_element_sync(self.conn.clone(), self.session_id.clone(), &v["value"])
    }
pub fn find_element ( & self , by : By ) -> WebDriverResult < WebElement > { let v = self . conn . execute ( Command :: FindElement ( & self . session_id , by ) ) ? ; unwrap_element_sync ( self . conn . clone ( ) , self . session_id . clone ( ) , & v [ " " ] ) }
Search for an element on the current page using the specified selector.
Search for an element on the current page using the specified selector .
&self
by
By
example:
None
use thirtyfour::error::webdriverresult;
None
use thirtyfour::{by, desiredcapabilities, sync::webdriver};
None
fn main() -> webdriverresult<()> {
None
let caps = desiredcapabilities::chrome();
None
let driver = webdriver::new("http://localhost:4444/wd/hub", &caps)?;
None
driver.get("http://localhost:8000")?;
let elem_text = driver.find_element(By::Name("input1"))?;
let elem_button = driver.find_element(By::Id("button-set"))?;
let elem_result = driver.find_element(By::Name("input-result"))?.
let elem_text = driver . find_element ( By :: Name ( " input1 " )) ? ; let elem_button = driver . find_element ( By :: Id ( " button - set " )) ? ; let elem_result = driver . find_element ( By :: Name ( " input - result " )) ? .
ok(())
None
}
None