HtmlElement.Net
|
Default page object implementation creating lazy loading proxies for every web element or list of web elements. It can't handle multiple FindsByAttribute attributes as well as FindsBySequenceAttribute and FindsByAllAttribute. More...
Inherits HtmlElements.AbstractPageObjectFactory.
Public Member Functions | |
PageObjectFactory () | |
Creates page factory instance using ProxyFactory for creating lazy loading error handling proxies and LoaderFactory for creating lazy loaded elements and element lists. More... | |
PageObjectFactory (IProxyFactory proxyFactory, ILoaderFactory loaderFactory) | |
Creates page factory instance using provided proxyFactory for creating proxies and loaderFactory for creating lazy elements and list of elements. More... | |
override IWebElement | CreateWebElement (ISearchContext searchContext, By locator) |
Creates lazy loaded WebElement found with provided locator in given search context. More... | |
override TPageObject | CreateWebElement< TPageObject > (ISearchContext searchContext, By locator) |
Creates and initializes page object of a given type and all nested page objects using WebElement found within given context by provided locator. More... | |
override ReadOnlyCollection< IWebElement > | CreateWebElementList (ISearchContext searchContext, By locator) |
Creates lazy loaded list of WebElements found with provided locator in given search context More... | |
override IList< TPageObject > | CreateWebElementList< TPageObject > (ISearchContext searchContext, By locator) |
Creates and initializes list of page elements and it's 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... | |
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... | |
Protected Member Functions | |
override object | CreateMemberInstance (Type memberType, MemberInfo memberInfo, ISearchContext searchContext) |
Creates value assigned to page object member (field or property). More... | |
override object | CreatePageObjectInstance (Type pageObjectType, ISearchContext searchContext) |
Creates page object using two-arguments constructor ( ISearchContext and IPageObjectFactory) or single argument constructor ( ISearchContext) or default constructor. More... | |
Default page object implementation creating lazy loading proxies for every web element or list of web elements. It can't handle multiple FindsByAttribute attributes as well as FindsBySequenceAttribute and FindsByAllAttribute.
It supports CacheLookupAttribute for elements and element lists by using same raw web element once it have been found. It also supports smart frames (derived from HtmlFrame class) which can host nested elements and automatically switch context.
Factory requires nested page objects to have default constructor or constructor accepting IWebElement as a single argument or IWebElement as first argument and IPageObjectFactory as second.
When IPageObjectFactory.Create<TPageObject> is called directly it will pass instance of search context being provided as first constructor argument and itself as second (if needed). It also can use default constructor.
HtmlElements.PageObjectFactory.PageObjectFactory | ( | ) |
Creates page factory instance using ProxyFactory for creating lazy loading error handling proxies and LoaderFactory for creating lazy loaded elements and element lists.
HtmlElements.PageObjectFactory.PageObjectFactory | ( | IProxyFactory | proxyFactory, |
ILoaderFactory | loaderFactory | ||
) |
Creates page factory instance using provided proxyFactory for creating proxies and loaderFactory for creating lazy elements and list of elements.
proxyFactory | Factory creating WebElement and WebElement list proxies. |
loaderFactory | Factory creating WebElement and WebElement list loaders. |
|
protectedvirtual |
Creates value assigned to page object member (field or property).
memberType | Declared type of property or field. |
memberInfo | Field or property meta information. |
searchContext | Parent page object context. |
Implements HtmlElements.AbstractPageObjectFactory.
|
protectedvirtual |
Creates page object using two-arguments constructor ( ISearchContext and IPageObjectFactory) or single argument constructor ( ISearchContext) or default constructor.
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. |
Implements HtmlElements.AbstractPageObjectFactory.
|
virtual |
Creates lazy loaded WebElement found with provided locator in given search context.
searchContext | Context used for finding element. |
locator | Element locator to use for finding element. |
Implements HtmlElements.AbstractPageObjectFactory.
|
virtual |
Creates and initializes page object of a given type and all nested page objects using WebElement found within given context by provided locator.
TPageObject | Page object class. |
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. |
Implements HtmlElements.AbstractPageObjectFactory.
|
virtual |
Creates lazy loaded list of WebElements found with provided locator in given search context
searchContext | Context used for finding elements |
locator | Element locator to use for finding elements |
Implements HtmlElements.AbstractPageObjectFactory.
|
virtual |
Creates and initializes list of page elements and it's nested page objects.
TPageObject | The type of the page object. |
searchContext | The search context used for finding underlying WebElements. |
locator | The locator used for finding underlying WebElements. |
Implements HtmlElements.AbstractPageObjectFactory.