Struct appium_client::wait::Wait
source · pub struct Wait<'c> { /* private fields */ }
Expand description
Wait parameters
Implementations§
source§impl Wait<'_>
impl Wait<'_>
sourcepub fn at_most(self, timeout: Duration) -> Self
pub fn at_most(self, timeout: Duration) -> Self
Set the timeout for maximum wait.
Checks are performed in a loop, with an interval. To prevent infinite wait, the loop will exit after this timeout and the wait will result in an error indicating timeout.
It is not guaranteed that the loop exits at the exact duration, as the check interval may hold it off. It works like this:
- is the timeout exceeded?
- try to locate
- wait for interval
- repeat
sourcepub fn check_every(self, interval: Duration) -> Self
pub fn check_every(self, interval: Duration) -> Self
Sets the period to delay checks.
Checks are performed in a loop, with an interval defined by this method. For example, if you set it to 250 ms, then the loop will check if element is present, wait 250 ms and repeat.
sourcepub async fn for_element(self, search: By) -> Result<Element, CmdError>
pub async fn for_element(self, search: By) -> Result<Element, CmdError>
Waits for element using Appium locator.
Tries to locate element in loop, with interval defined by “check delay”. If the timeout is exceeded, then it returns an error.
sourcepub async fn for_elements(self, search: By) -> Result<Vec<Element>, CmdError>
pub async fn for_elements(self, search: By) -> Result<Vec<Element>, CmdError>
Waits for a list of elements using Appium locator.
Tries to locate list of elements in loop, with interval defined by “check delay”. If the timeout is exceeded, then it returns an error.