Implements IPageObjectFactory contract and delegates responsibility for creating actual page object and initializing it's members to subclasses. It class takes care of locating suitable for initialization members and assigning value to it. It looks for all instance fields and properties which are web elements or web element lists and have not been assigned value yet. Both fields and properties can be private protected or public, but in order to be initialized fields should not be marked readonlyand properties should have setters.
More...
Inherits HtmlElements.IPageObjectFactory.
Inherited by HtmlElements.PageObjectFactory.
|
object | Create (Type pageObjectType, ISearchContext searchContext) |
| Creates and initializes page object of a given type and all nested page objects. More...
|
|
TPageObject | Create< TPageObject > (ISearchContext searchContext) |
| Creates and initializes page object of a given type and all nested page objects. More...
|
|
void | Init (object pageObject, ISearchContext searchContext) |
| Initialize web elements in given page object instance More...
|
|
void | Init (WebDriverWrapper pageObject) |
| Initialize page object using it's wrapped context More...
|
|
abstract IWebElement | CreateWebElement (ISearchContext searchContext, By locator) |
| Creates WebElement found with provided locator in given search context More...
|
|
abstract ReadOnlyCollection< IWebElement > | CreateWebElementList (ISearchContext searchContext, By locator) |
| Creates list of WebElements found with provided locator in given search context More...
|
|
abstract TPageObject | CreateWebElement< TPageObject > (ISearchContext searchContext, By locator) |
| Creates and initializes page object of a given type and all nested page objects. More...
|
|
abstract IList< TPageObject > | CreateWebElementList< TPageObject > (ISearchContext searchContext, By locator) |
| Creates and initializes list of page elements and it's nested page objects. More...
|
|
|
abstract object | CreateMemberInstance (Type memberType, MemberInfo memberInfo, ISearchContext searchContext) |
| Creates value assigned to page object member (field or property). More...
|
|
abstract object | CreatePageObjectInstance (Type pageObjectType, ISearchContext searchContext) |
| Create instance of page object class. It is not responsible for initializing page object members. More...
|
|
Implements IPageObjectFactory contract and delegates responsibility for creating actual page object and initializing it's members to subclasses. It class takes care of locating suitable for initialization members and assigning value to it. It looks for all instance fields and properties which are web elements or web element lists and have not been assigned value yet. Both fields and properties can be private protected or public, but in order to be initialized fields should not be marked
readonly
and properties should have setters.
◆ Create()
object HtmlElements.AbstractPageObjectFactory.Create |
( |
Type |
pageObjectType, |
|
|
ISearchContext |
searchContext |
|
) |
| |
Creates and initializes page object of a given type and all nested page objects.
- Parameters
-
pageObjectType | Page object type |
searchContext | Context used for finding elements |
- Returns
- Fully initialized page object
Implements HtmlElements.IPageObjectFactory.
◆ Create< TPageObject >()
Creates and initializes page object of a given type and all nested page objects.
- Template Parameters
-
TPageObject | Page object type |
- Parameters
-
searchContext | Context used for finding elements |
- Returns
- Fully initialized page object
Implements HtmlElements.IPageObjectFactory.
◆ CreateMemberInstance()
abstract object HtmlElements.AbstractPageObjectFactory.CreateMemberInstance |
( |
Type |
memberType, |
|
|
MemberInfo |
memberInfo, |
|
|
ISearchContext |
searchContext |
|
) |
| |
|
protectedpure virtual |
Creates value assigned to page object member (field or property).
- Parameters
-
memberType | Declared type of property or field |
memberInfo | Field or property meta information |
searchContext | Parent page object context |
- Returns
- Initialized field or property value or null
Implemented in HtmlElements.PageObjectFactory.
◆ CreatePageObjectInstance()
abstract object HtmlElements.AbstractPageObjectFactory.CreatePageObjectInstance |
( |
Type |
pageObjectType, |
|
|
ISearchContext |
searchContext |
|
) |
| |
|
protectedpure virtual |
Create instance of page object class. It is not responsible for initializing page object members.
- Parameters
-
pageObjectType | Type of page object being initialized |
searchContext | Optional constructor argument representing search context being wrapped. It could be IWebElement or IWebDriver instance or other page object. |
- Returns
- New instance of given type
Implemented in HtmlElements.PageObjectFactory.
◆ CreateWebElement()
abstract IWebElement HtmlElements.AbstractPageObjectFactory.CreateWebElement |
( |
ISearchContext |
searchContext, |
|
|
By |
locator |
|
) |
| |
|
pure virtual |
Creates WebElement found with provided locator in given search context
- Parameters
-
searchContext | Context used for finding element |
locator | Element locator to use for finding element |
- Returns
- Custom WebElement found in given search context with provided locator
Implements HtmlElements.IPageObjectFactory.
Implemented in HtmlElements.PageObjectFactory.
◆ CreateWebElement< TPageObject >()
Creates and initializes page object of a given type and all nested page objects.
- Template Parameters
-
TPageObject | Page object class. |
- Parameters
-
searchContext | Parent context used for finding the element used as page element root. |
locator | Locator 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.
Implements HtmlElements.IPageObjectFactory.
Implemented in HtmlElements.PageObjectFactory.
◆ CreateWebElementList()
abstract ReadOnlyCollection<IWebElement> HtmlElements.AbstractPageObjectFactory.CreateWebElementList |
( |
ISearchContext |
searchContext, |
|
|
By |
locator |
|
) |
| |
|
pure virtual |
Creates list of WebElements found with provided locator in given search context
- Parameters
-
searchContext | Context used for finding elements |
locator | Element locator to use for finding elements |
- Returns
- Custom list of WebElements
Implements HtmlElements.IPageObjectFactory.
Implemented in HtmlElements.PageObjectFactory.
◆ CreateWebElementList< TPageObject >()
Creates and initializes list of page elements and it's nested page objects.
- Template Parameters
-
TPageObject | The type of the page object. |
- Parameters
-
searchContext | The search context used for finding underlying WebElements. |
locator | The locator used for finding underlying WebElements. |
- Returns
- List of initialized page objects wrapping elements found in searchContext with locator .
Implements HtmlElements.IPageObjectFactory.
Implemented in HtmlElements.PageObjectFactory.
◆ Init() [1/2]
void HtmlElements.AbstractPageObjectFactory.Init |
( |
object |
pageObject, |
|
|
ISearchContext |
searchContext |
|
) |
| |
Initialize web elements in given page object instance
- Parameters
-
pageObject | Not initialized page object |
searchContext | Context used for finding elements |
Implements HtmlElements.IPageObjectFactory.
◆ Init() [2/2]