Search Results for

    Show / Hide Table of Contents

    Class BasePage

    Defines a base page for creating tests following the page object pattern.

    Inheritance
    System.Object
    BasePage
    Namespace: Legerity.Pages
    Assembly: Legerity.Core.dll
    Syntax
    public abstract class BasePage : object

    Constructors

    | Improve this Doc View Source

    BasePage()

    Initializes a new instance of the BasePage class using the App instance that verifies the page has loaded within 2 seconds.

    Declaration
    protected BasePage()
    Exceptions
    Type Condition
    DriverNotInitializedException

    Thrown when AppManager.StartApp() has not been called.

    PageNotShownException

    Thrown when the page is not shown in 2 seconds.

    | Improve this Doc View Source

    BasePage(RemoteWebDriver)

    Initializes a new instance of the BasePage class using a instance that verifies the page has loaded within 2 seconds.

    Declaration
    protected BasePage(RemoteWebDriver app)
    Parameters
    Type Name Description
    RemoteWebDriver app

    The instance of the started application driver that will be used to drive the page interaction.

    Exceptions
    Type Condition
    DriverNotInitializedException

    Thrown when AppManager.StartApp() has not been called.

    PageNotShownException

    Thrown when the page is not shown in 2 seconds.

    | Improve this Doc View Source

    BasePage(RemoteWebDriver, Nullable<TimeSpan>)

    Initializes a new instance of the BasePage class using a instance that verifies the page has loaded within the given timeout.

    Declaration
    protected BasePage(RemoteWebDriver app, TimeSpan? traitTimeout)
    Parameters
    Type Name Description
    RemoteWebDriver app

    The instance of the started application driver that will be used to drive the page interaction.

    System.Nullable<TimeSpan> traitTimeout

    The amount of time the driver should wait when searching for the Trait if it is not immediately present.

    Exceptions
    Type Condition
    DriverNotInitializedException

    Thrown when AppManager.StartApp() has not been called.

    PageNotShownException

    Thrown when the page is not shown in the given timeout.

    | Improve this Doc View Source

    BasePage(Nullable<TimeSpan>)

    Initializes a new instance of the BasePage class using the App instance that verifies the page has loaded within the given timeout.

    Declaration
    protected BasePage(TimeSpan? traitTimeout)
    Parameters
    Type Name Description
    System.Nullable<TimeSpan> traitTimeout

    The amount of time the driver should wait when searching for the Trait if it is not immediately present.

    Exceptions
    Type Condition
    DriverNotInitializedException

    Thrown when AppManager.StartApp() has not been called.

    PageNotShownException

    Thrown when the page is not shown in the given timeout.

    Properties

    | Improve this Doc View Source

    AndroidApp

    Gets the instance of the started Android application.

    Declaration
    protected AndroidDriver<AndroidElement> AndroidApp { get; }
    Property Value
    Type Description
    AndroidDriver<AndroidElement>
    | Improve this Doc View Source

    App

    Gets the instance of the started application.

    The App instance serves as base for the drivers and can be referenced for basic Selenium functions.

    This could be a , , , or web driver.

    Declaration
    public RemoteWebDriver App { get; }
    Property Value
    Type Description
    RemoteWebDriver
    | Improve this Doc View Source

    IOSApp

    Gets the instance of the started iOS application.

    Declaration
    protected IOSDriver<IOSElement> IOSApp { get; }
    Property Value
    Type Description
    IOSDriver<IOSElement>
    | Improve this Doc View Source

    Trait

    Gets a given trait of the page to verify that the page is in view.

    Declaration
    protected abstract By Trait { get; }
    Property Value
    Type Description
    By
    | Improve this Doc View Source

    WaitTimeout

    Gets or sets the amount of time the driver should wait when searching for elements if they are not immediately present.

    Declaration
    public TimeSpan WaitTimeout { get; set; }
    Property Value
    Type Description
    TimeSpan
    | Improve this Doc View Source

    WebApp

    Gets the instance of the started web application.

    Declaration
    protected RemoteWebDriver WebApp { get; }
    Property Value
    Type Description
    RemoteWebDriver
    | Improve this Doc View Source

    WindowsApp

    Gets the instance of the started Windows application.

    Declaration
    protected WindowsDriver<WindowsElement> WindowsApp { get; }
    Property Value
    Type Description
    WindowsDriver<WindowsElement>

    Methods

    | Improve this Doc View Source

    FindElement(By)

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

    Declaration
    public RemoteWebElement FindElement(By locator)
    Parameters
    Type Name Description
    By locator

    The locator to find the element.

    Returns
    Type Description
    RemoteWebElement

    A .

    | Improve this Doc View Source

    FindElementById(String)

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

    Declaration
    public RemoteWebElement FindElementById(string id)
    Parameters
    Type Name Description
    System.String id

    The ID of the element.

    Returns
    Type Description
    RemoteWebElement

    A .

    | Improve this Doc View Source

    FindElementByName(String)

    Finds the first of element in the page that matches the specified name.

    Declaration
    public RemoteWebElement FindElementByName(string name)
    Parameters
    Type Name Description
    System.String name

    The name of the element.

    Returns
    Type Description
    RemoteWebElement

    A .

    | Improve this Doc View Source

    FindElementByXPath(String)

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

    Declaration
    public RemoteWebElement FindElementByXPath(string xpath)
    Parameters
    Type Name Description
    System.String xpath

    The XPath to find the element.

    Returns
    Type Description
    RemoteWebElement

    A .

    | Improve this Doc View Source

    FindElements(By)

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

    Declaration
    public ReadOnlyCollection<RemoteWebElement> FindElements(By locator)
    Parameters
    Type Name Description
    By locator

    The locator to find the elements.

    Returns
    Type Description
    ReadOnlyCollection<RemoteWebElement>

    A readonly collection of .

    | Improve this Doc View Source

    FindElementsByXPath(String)

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

    Declaration
    public ReadOnlyCollection<RemoteWebElement> FindElementsByXPath(string xpath)
    Parameters
    Type Name Description
    System.String xpath

    The XPath to find the elements.

    Returns
    Type Description
    ReadOnlyCollection<RemoteWebElement>

    A readonly collection of .

    | Improve this Doc View Source

    VerifyElementNotShown(By)

    Determines whether the given element is not shown.

    Declaration
    public void VerifyElementNotShown(By locator)
    Parameters
    Type Name Description
    By locator

    The locator for the element to locate.

    Exceptions
    Type Condition
    DriverNotInitializedException

    Thrown when AppManager.StartApp() has not been called.

    | Improve this Doc View Source

    VerifyElementShown(By)

    Determines whether the given element is shown.

    Declaration
    public void VerifyElementShown(By locator)
    Parameters
    Type Name Description
    By locator

    The locator for the element to find.

    Exceptions
    Type Condition
    DriverNotInitializedException

    Thrown when AppManager.StartApp() has not been called.

    ElementNotShownException

    Thrown when the element is not shown.

    | Improve this Doc View Source

    VerifyElementShown(By, Nullable<TimeSpan>)

    Determines whether the given element is shown with the specified timeout.

    Declaration
    public void VerifyElementShown(By locator, TimeSpan? timeout)
    Parameters
    Type Name Description
    By locator

    The locator for the element to find.

    System.Nullable<TimeSpan> timeout

    The amount of time the driver should wait when searching for the locator element if it is not immediately present.

    Exceptions
    Type Condition
    DriverNotInitializedException

    Thrown when AppManager.StartApp() has not been called.

    ElementNotShownException

    Thrown when the element is not shown.

    | Improve this Doc View Source

    VerifyPageShown()

    Determines whether the current page is shown immediately.

    Declaration
    public void VerifyPageShown()
    Exceptions
    Type Condition
    DriverNotInitializedException

    Thrown when AppManager.StartApp() has not been called.

    PageNotShownException

    Thrown when the page is not shown.

    | Improve this Doc View Source

    VerifyPageShown(Nullable<TimeSpan>)

    Determines whether the current page is shown with the specified timeout.

    Declaration
    public void VerifyPageShown(TimeSpan? timeout)
    Parameters
    Type Name Description
    System.Nullable<TimeSpan> timeout

    The amount of time the driver should wait when searching for the Trait if it is not immediately present.

    Exceptions
    Type Condition
    DriverNotInitializedException

    Thrown when AppManager.StartApp() has not been called.

    PageNotShownException

    Thrown when the page is not shown.

    Extension Methods

    PageExtensions.TryWaitUntil<TPage>(TPage, Func<TPage, Boolean>, Nullable<TimeSpan>, Int32, Action<Exception>)
    PageExtensions.WaitUntil<TPage, TResult>(TPage, Func<TPage, TResult>, Nullable<TimeSpan>, Int32)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright (c) MADE Apps