/// Search for all elements on the current page that match 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 elems = driver.find_elements(By::ClassName("section"))?;
/// for elem in elems {
///     assert!(elem.get_attribute("class")?.contains("section"));
/// }
/// #     Ok(())
/// # }
/// ```
Search for all elements on the current page that match the specified
selector.
Search for all elements on the current page that match the specified selector .
pub fn find_elements(&self, by: By) -> WebDriverResult<Vec<WebElement>> {
        let v = self
            .conn
            .execute(Command::FindElements(&self.session_id, by))?;
        unwrap_elements_sync(&self.conn, &self.session_id, &v["value"])
    }
pub fn find_elements ( & self , by : By ) -> WebDriverResult < Vec < WebElement > > { let v = self . conn . execute ( Command :: FindElements ( & self . session_id , by ) ) ? ; unwrap_elements_sync ( & self . conn , & self . session_id , & v [ " " ] ) }
Search for all elements on the current page that match the specified
selector.
Search for all elements on the current page that match 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 elems = driver.find_elements(By::ClassName("section"))?;
for elem in elems {
assert!(elem.get_attribute("class")?.contains("section"));
}
let elems = driver . find_elements ( By :: ClassName ( " section " )) ? ; for elem in elems { assert! ( elem . get_attribute ( " class " ) ? . contains ( " section " )) ; }
ok(())
None
}
None