Search Results for

    Show / Hide Table of Contents

    Class DriverExtensions

    Defines a collection of extensions for a driver.

    Inheritance
    System.Object
    DriverExtensions
    Namespace: Legerity.Extensions
    Assembly: Legerity.Core.dll
    Syntax
    public static class DriverExtensions : object

    Methods

    | Improve this Doc View Source

    FindElementByPartialText(RemoteWebDriver, String)

    Finds the first element in the page that matches the specified text partially.

    Declaration
    public static IWebElement FindElementByPartialText(this RemoteWebDriver driver, string text)
    Parameters
    Type Name Description
    RemoteWebDriver driver

    The remote web driver.

    System.String text

    The partial text to find.

    Returns
    Type Description
    IWebElement

    A .

    | Improve this Doc View Source

    FindElementByText(RemoteWebDriver, String)

    Finds the first element in the page that matches the specified text.

    Declaration
    public static IWebElement FindElementByText(this RemoteWebDriver driver, string text)
    Parameters
    Type Name Description
    RemoteWebDriver driver

    The remote web driver.

    System.String text

    The text to find.

    Returns
    Type Description
    IWebElement

    A .

    | Improve this Doc View Source

    FindElementsByPartialText(RemoteWebDriver, String)

    Finds all the elements in the page that matches the specified text partially.

    Declaration
    public static ReadOnlyCollection<IWebElement> FindElementsByPartialText(this RemoteWebDriver driver, string text)
    Parameters
    Type Name Description
    RemoteWebDriver driver

    The remote web driver.

    System.String text

    The partial text to find.

    Returns
    Type Description
    ReadOnlyCollection<IWebElement>

    A readonly collection of .

    | Improve this Doc View Source

    FindElementsByText(RemoteWebDriver, String)

    Finds all the elements in the page that matches the specified text.

    Declaration
    public static ReadOnlyCollection<IWebElement> FindElementsByText(this RemoteWebDriver driver, string text)
    Parameters
    Type Name Description
    RemoteWebDriver driver

    The remote web driver.

    System.String text

    The text to find.

    Returns
    Type Description
    ReadOnlyCollection<IWebElement>

    A readonly collection of .

    | Improve this Doc View Source

    FindWebElement(RemoteWebDriver, By)

    Finds the first element in the page that matches the locator.

    Declaration
    public static RemoteWebElement FindWebElement(this RemoteWebDriver driver, By locator)
    Parameters
    Type Name Description
    RemoteWebDriver driver

    The remote web driver.

    By locator

    The locator to find the element.

    Returns
    Type Description
    RemoteWebElement

    A .

    | Improve this Doc View Source

    FindWebElements(RemoteWebDriver, By)

    Finds all the elements in the page that matches the locator.

    Declaration
    public static ReadOnlyCollection<RemoteWebElement> FindWebElements(this RemoteWebDriver driver, By locator)
    Parameters
    Type Name Description
    RemoteWebDriver driver

    The remote web driver.

    By locator

    The locator to find the elements.

    Returns
    Type Description
    ReadOnlyCollection<RemoteWebElement>

    A readonly collection of .

    | Improve this Doc View Source

    GetAllChildElements(RemoteWebDriver)

    Retrieves all child elements that can be located by the driver in the page.

    Declaration
    public static ReadOnlyCollection<IWebElement> GetAllChildElements(this RemoteWebDriver driver)
    Parameters
    Type Name Description
    RemoteWebDriver driver

    The remote web driver.

    Returns
    Type Description
    ReadOnlyCollection<IWebElement>

    A readonly collection of .

    | Improve this Doc View Source

    GetAllElements(RemoteWebDriver)

    Retrieves all elements that can be located by the driver in the page.

    Declaration
    public static ReadOnlyCollection<IWebElement> GetAllElements(this RemoteWebDriver driver)
    Parameters
    Type Name Description
    RemoteWebDriver driver

    The remote web driver.

    Returns
    Type Description
    ReadOnlyCollection<IWebElement>

    A readonly collection of .

    | Improve this Doc View Source

    TryWaitUntil(IWebDriver, Func<IWebDriver, Boolean>, Nullable<TimeSpan>, Int32, Action<Exception>)

    Attempts to wait until a specified driver condition is met, with an optional timeout.

    Declaration
    public static bool TryWaitUntil(this IWebDriver appDriver, Func<IWebDriver, bool> condition, TimeSpan? timeout = null, int retries = 0, Action<Exception> exceptionHandler = null)
    Parameters
    Type Name Description
    IWebDriver appDriver

    The driver to wait on.

    Func<IWebDriver, System.Boolean> condition

    The condition of the element to wait on.

    System.Nullable<TimeSpan> timeout

    The optional timeout wait on the condition being true.

    System.Int32 retries

    An optional count of retries after a timeout before accepting the failure.

    Action<Exception> exceptionHandler

    The optional exception handler thrown if an error occurs as a result of timeout.

    Returns
    Type Description
    System.Boolean

    Whether the wait was a success.

    | Improve this Doc View Source

    WaitUntil<TResult>(IWebDriver, Func<IWebDriver, TResult>, Nullable<TimeSpan>, Int32)

    Waits until a specified driver condition is met, with an optional timeout.

    Declaration
    public static TResult WaitUntil<TResult>(this IWebDriver appDriver, Func<IWebDriver, TResult> condition, TimeSpan? timeout = null, int retries = 0)
    Parameters
    Type Name Description
    IWebDriver appDriver

    The driver to wait on.

    Func<IWebDriver, TResult> condition

    The condition of the element to wait on.

    System.Nullable<TimeSpan> timeout

    The optional timeout wait on the condition being true.

    System.Int32 retries

    An optional count of retries after a timeout before accepting the failure.

    Returns
    Type Description
    TResult

    The TResult of the wait until operation.

    Type Parameters
    Name Description
    TResult

    The type of expected result from the wait condition.

    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright (c) MADE Apps