Package com.codeborne.selenide.impl
Class SelenidePageFactory
java.lang.Object
com.codeborne.selenide.impl.SelenidePageFactory
- All Implemented Interfaces:
PageObjectFactory
- Direct Known Subclasses:
SelenideAppiumPageFactory
Factory class to make using Page Objects simpler and easier.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected BaseElementsCollection<? extends SelenideElement,? extends BaseElementsCollection<?, ?>> createCollection(CollectionSource collection, Class<?> klass) protected BaseElementsCollection<? extends SelenideElement,? extends BaseElementsCollection<?, ?>> createElementsCollection(Driver driver, @Nullable WebElementSource searchContext, org.openqa.selenium.By selector, Field field, @Nullable String alias) createElementsContainer(Driver driver, @Nullable WebElementSource searchContext, Field field, org.openqa.selenium.By selector) createElementsContainerList(Driver driver, @Nullable WebElementSource searchContext, Field field, Type[] genericTypes, org.openqa.selenium.By selector) protected @Nullable ObjectcreateFieldValue(Driver driver, @Nullable WebElementSource searchContext, Object page, Type[] genericTypes, Field field) protected <T extends SelenideElement>
SelenideElementcreateSelf(WebElementSource searchContext, Class<T> targetType) @Nullable Objectdecorate(ClassLoader loader, Driver driver, @Nullable WebElementSource searchContext, Field field, org.openqa.selenium.By selector, Type[] genericTypes) protected SelenideElementdecorateWebElement(Driver driver, @Nullable WebElementSource searchContext, org.openqa.selenium.By selector, Field field, @Nullable String alias) protected org.openqa.selenium.support.pagefactory.FieldDecoratordefaultFieldDecorator(Driver driver, @Nullable WebElementSource searchContext) protected Class<?>protected org.openqa.selenium.ByfindSelector(Driver driver, Field field) protected @Nullable ObjectgetFieldValue(Object page, Field field) protected @Nullable Class<?>getListGenericType(Field field, Type[] genericTypes) protected org.openqa.selenium.SearchContextgetSearchContext(Driver driver, @Nullable WebElementSource searchContext) protected intvoidinitElements(Driver driver, @Nullable WebElementSource searchContext, Object page, Type[] genericTypes) Similar to the other "initElements" methods, but takes anFieldDecoratorwhich is used for decorating each of the fields.initElementsContainer(Driver driver, @Nullable Field field, WebElementSource self, Class<?> type, Type[] genericTypes) protected voidinitField(Driver driver, @Nullable WebElementSource searchContext, Object page, Type[] genericTypes, Field field) protected voidinitFields(Driver driver, @Nullable WebElementSource searchContext, Object page, Class<?> proxyIn, Type[] genericTypes) protected booleanisDecoratableList(Field field, @Nullable org.openqa.selenium.By selector, Type[] genericTypes, Class<?> type) <PageObjectClass>
PageObjectClass<PageObjectClass,T extends PageObjectClass>
PageObjectClassprotected voidsetFieldValue(Object page, Field field, Object value) protected booleanshouldCache(Field field) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.codeborne.selenide.impl.PageObjectFactory
createElementsContainer, createElementsContainer, createElementsContainerList, createElementsContainerList
-
Constructor Details
-
SelenidePageFactory
public SelenidePageFactory()
-
-
Method Details
-
page
public <PageObjectClass> PageObjectClass page(Driver driver, Class<PageObjectClass> pageObjectClass) - Specified by:
pagein interfacePageObjectFactory
-
page
public <PageObjectClass,T extends PageObjectClass> PageObjectClass page(Driver driver, T pageObject) - Specified by:
pagein interfacePageObjectFactory
-
initElements
public void initElements(Driver driver, @Nullable WebElementSource searchContext, Object page, Type[] genericTypes) Similar to the other "initElements" methods, but takes anFieldDecoratorwhich is used for decorating each of the fields.- Parameters:
page- The object to decorate the fields of
-
initFields
protected void initFields(Driver driver, @Nullable WebElementSource searchContext, Object page, Class<?> proxyIn, Type[] genericTypes) -
initField
protected void initField(Driver driver, @Nullable WebElementSource searchContext, Object page, Type[] genericTypes, Field field) -
createFieldValue
-
findSelector
- Parameters:
driver- May be used by subclasses (e.g. in selenide-appium plugin)field- expected to be an element in a Page Object- Returns:
Byinstance used by webdriver to locate elements
-
shouldCache
-
setFieldValue
-
getFieldValue
-
createElementsContainer
public Container createElementsContainer(Driver driver, @Nullable WebElementSource searchContext, Field field, org.openqa.selenium.By selector) - Specified by:
createElementsContainerin interfacePageObjectFactory
-
initElementsContainer
public Container initElementsContainer(Driver driver, @Nullable Field field, WebElementSource self, Class<?> type, Type[] genericTypes) throws ReflectiveOperationException - Specified by:
initElementsContainerin interfacePageObjectFactory- Throws:
ReflectiveOperationException
-
decorate
public @Nullable Object decorate(ClassLoader loader, Driver driver, @Nullable WebElementSource searchContext, Field field, org.openqa.selenium.By selector, Type[] genericTypes) -
createSelf
protected <T extends SelenideElement> SelenideElement createSelf(WebElementSource searchContext, Class<T> targetType) -
decorateWebElement
protected SelenideElement decorateWebElement(Driver driver, @Nullable WebElementSource searchContext, org.openqa.selenium.By selector, Field field, @Nullable String alias) -
createElementsCollection
protected BaseElementsCollection<? extends SelenideElement,? extends BaseElementsCollection<?, createElementsCollection?>> (Driver driver, @Nullable WebElementSource searchContext, org.openqa.selenium.By selector, Field field, @Nullable String alias) -
createCollection
protected BaseElementsCollection<? extends SelenideElement,? extends BaseElementsCollection<?, createCollection?>> (CollectionSource collection, Class<?> klass) -
defaultFieldDecorator
protected org.openqa.selenium.support.pagefactory.FieldDecorator defaultFieldDecorator(Driver driver, @Nullable WebElementSource searchContext) -
getSearchContext
protected org.openqa.selenium.SearchContext getSearchContext(Driver driver, @Nullable WebElementSource searchContext) -
createElementsContainerList
-
isDecoratableList
-
getListGenericType
-
indexOf
-
elementsBaseType
-