HtmlElement.Net
Public Member Functions | List of all members
HtmlElements.IPageObjectFactory Interface Reference

Creates and recursively initializes page object instances. More...

Inherited by HtmlElements.AbstractPageObjectFactory.

Public Member Functions

IWebElement CreateWebElement (ISearchContext searchContext, By locator)
 Creates WebElement found with provided locator in given search context. More...
 
TPageObject CreateWebElement< TPageObject > (ISearchContext searchContext, By locator)
 Creates and initializes page object of a given type and all nested page objects. More...
 
ReadOnlyCollection< IWebElement > CreateWebElementList (ISearchContext searchContext, By locator)
 Creates list of WebElements found with provided locator in given search context. More...
 
IList< TPageObject > CreateWebElementList< TPageObject > (ISearchContext searchContext, By locator)
 Creates and initializes list of page elements and it's nested page objects. More...
 
TPageObject Create< TPageObject > (ISearchContext searchContext)
 Creates and initializes page object of a given type and all nested page objects. More...
 
object Create (Type pageObjectType, ISearchContext searchContext)
 Creates and initializes page object of a given type and all nested page objects. More...
 
void Init (object pageObject, ISearchContext searchContext)
 Initialize all nested page objects in given instance. More...
 
void Init (WebDriverWrapper pageObject)
 Initialize page object wrapped WebDriver instance. More...
 

Detailed Description

Creates and recursively initializes page object instances.

Member Function Documentation

◆ Create()

object HtmlElements.IPageObjectFactory.Create ( Type  pageObjectType,
ISearchContext  searchContext 
)

Creates and initializes page object of a given type and all nested page objects.

Parameters
pageObjectTypePage object class.
searchContextContext used for finding elements.
Returns
Fully initialized page object.

Implemented in HtmlElements.AbstractPageObjectFactory.

◆ Create< TPageObject >()

TPageObject HtmlElements.IPageObjectFactory.Create< TPageObject > ( ISearchContext  searchContext)

Creates and initializes page object of a given type and all nested page objects.

Template Parameters
TPageObjectPage object class.
Parameters
searchContextContext used for finding elements.
Returns
Fully initialized page object.

Implemented in HtmlElements.AbstractPageObjectFactory.

◆ CreateWebElement()

IWebElement HtmlElements.IPageObjectFactory.CreateWebElement ( ISearchContext  searchContext,
By  locator 
)

Creates WebElement found with provided locator in given search context.

Parameters
searchContextContext used for finding element.
locatorElement locator to use for finding element.
Returns
Custom WebElement found in given search context with provided locator.

Implemented in HtmlElements.PageObjectFactory, and HtmlElements.AbstractPageObjectFactory.

◆ CreateWebElement< TPageObject >()

TPageObject HtmlElements.IPageObjectFactory.CreateWebElement< TPageObject > ( ISearchContext  searchContext,
By  locator 
)

Creates and initializes page object of a given type and all nested page objects.

Template Parameters
TPageObjectPage object class.
Parameters
searchContextParent context used for finding the element used as page element root.
locatorLocator used for finding underlying WebElement used as page element root.
Returns
Fully initialized page object using WebElement found in searchContext with locator for finding nested elements.

Implemented in HtmlElements.PageObjectFactory, and HtmlElements.AbstractPageObjectFactory.

Type Constraints
TPageObject :class 

◆ CreateWebElementList()

ReadOnlyCollection<IWebElement> HtmlElements.IPageObjectFactory.CreateWebElementList ( ISearchContext  searchContext,
By  locator 
)

Creates list of WebElements found with provided locator in given search context.

Parameters
searchContextContext used for finding elements.
locatorElement locator to use for finding elements.
Returns
Custom list of WebElements.

Implemented in HtmlElements.PageObjectFactory, and HtmlElements.AbstractPageObjectFactory.

◆ CreateWebElementList< TPageObject >()

IList<TPageObject> HtmlElements.IPageObjectFactory.CreateWebElementList< TPageObject > ( ISearchContext  searchContext,
By  locator 
)

Creates and initializes list of page elements and it's nested page objects.

Template Parameters
TPageObjectThe type of the page object.
Parameters
searchContextThe search context used for finding underlying WebElements.
locatorThe locator used for finding underlying WebElements.
Returns
List of initialized page objects wrapping elements found in searchContext with locator .

Implemented in HtmlElements.PageObjectFactory, and HtmlElements.AbstractPageObjectFactory.

◆ Init() [1/2]

void HtmlElements.IPageObjectFactory.Init ( object  pageObject,
ISearchContext  searchContext 
)

Initialize all nested page objects in given instance.

Parameters
pageObjectPage object instance to be initialized.
searchContextContext used for finding elements.

Implemented in HtmlElements.AbstractPageObjectFactory.

◆ Init() [2/2]

void HtmlElements.IPageObjectFactory.Init ( WebDriverWrapper  pageObject)

Initialize page object wrapped WebDriver instance.

Parameters
pageObjectPage object instance to be initialized.

Implemented in HtmlElements.AbstractPageObjectFactory.