public class HtmlElementLoader extends Object
| Constructor and Description |
|---|
HtmlElementLoader() |
| Modifier and Type | Method and Description |
|---|---|
static <T> T |
create(Class<T> clazz,
org.openqa.selenium.WebDriver driver)
Creates and initializes a block of elements if the given class is
HtmlElement or its successor
and initializes page object otherwise. |
static <T extends HtmlElement> |
createHtmlElement(Class<T> clazz,
org.openqa.selenium.SearchContext searchContext)
Creates an instance of the given class representing a block of elements and initializes its fields
with lazy proxies.
|
static <T extends HtmlElement> |
createHtmlElement(Class<T> elementClass,
org.openqa.selenium.WebElement elementToWrap,
String name) |
static <T> T |
createPageObject(Class<T> clazz,
org.openqa.selenium.WebDriver driver)
Creates an instance of the given page object class and initializes its fields with lazy proxies.
|
static <T extends TypifiedElement> |
createTypifiedElement(Class<T> clazz,
org.openqa.selenium.SearchContext searchContext) |
static <T extends TypifiedElement> |
createTypifiedElement(Class<T> elementClass,
org.openqa.selenium.WebElement elementToWrap,
String name) |
static <T> void |
populate(T instance,
org.openqa.selenium.WebDriver driver)
Initializes
instance as a block of elements it is instance of HtmlElement
or its successor and as a page object otherwise. |
static void |
populateHtmlElement(HtmlElement htmlElement,
CustomElementLocatorFactory locatorFactory)
Initializes fields of the given block of elements using specified locator factory.
|
static void |
populateHtmlElement(HtmlElement htmlElement,
org.openqa.selenium.SearchContext searchContext)
Initializes fields of the given block of elements with lazy proxies.
|
static void |
populatePageObject(Object page,
CustomElementLocatorFactory locatorFactory)
Initializes fields of the given page object using specified locator factory.
|
static void |
populatePageObject(Object page,
org.openqa.selenium.SearchContext searchContext)
Initializes fields of the given page object with lazy proxies.
|
public static <T> T create(Class<T> clazz, org.openqa.selenium.WebDriver driver)
HtmlElement or its successor
and initializes page object otherwise.clazz - A class to be instantiated and initialized.driver - The WebDriver instance that will be used to look up the elements.createHtmlElement(Class, SearchContext),
createPageObject(Class, WebDriver)public static <T> void populate(T instance,
org.openqa.selenium.WebDriver driver)
instance as a block of elements it is instance of HtmlElement
or its successor and as a page object otherwise.instance - Object to be initialized.driver - The WebDriver instance that will be used to look up the elements.populateHtmlElement(HtmlElement, SearchContext),
createPageObject(Class, WebDriver)public static <T extends HtmlElement> T createHtmlElement(Class<T> clazz, org.openqa.selenium.SearchContext searchContext)
FindBy,
FindBys and FindAll
annotations of its fields for setting the way of locating elements of the block.
Fields to be proxied:
WebElementWebElementsHtmlElement and its successors)TypifiedElement successors)clazz - A class to be instantiated and initialized.searchContext - SearchContext that will be used to look up the elements.public static <T extends HtmlElement> T createHtmlElement(Class<T> elementClass, org.openqa.selenium.WebElement elementToWrap, String name)
public static <T extends TypifiedElement> T createTypifiedElement(Class<T> clazz, org.openqa.selenium.SearchContext searchContext)
public static <T extends TypifiedElement> T createTypifiedElement(Class<T> elementClass, org.openqa.selenium.WebElement elementToWrap, String name)
public static <T> T createPageObject(Class<T> clazz, org.openqa.selenium.WebDriver driver)
FindBy,
FindBys and FindAll
annotations of the fields for setting the way of locating them.
Fields to be proxied:
WebElementWebElementsHtmlElement and its successors)TypifiedElement successors)clazz - A class to be instantiated and initialized.driver - The WebDriver instance that will be used to look up the elements.public static void populateHtmlElement(HtmlElement htmlElement, org.openqa.selenium.SearchContext searchContext)
FindBy,
FindBys and FindAll annotations of its
fields for setting the way of locating elements of the block.
Fields to be proxied:
WebElementWebElementsHtmlElement and its successors)TypifiedElement successors)htmlElement - Block of elements to be initialized.searchContext - SearchContext that will be used to look up the elements.public static void populateHtmlElement(HtmlElement htmlElement, CustomElementLocatorFactory locatorFactory)
htmlElement - Block of elements to be initialized.locatorFactory - Locator factory that will be used to locate block elements.public static void populatePageObject(Object page, org.openqa.selenium.SearchContext searchContext)
FindBy,
FindBys and FindAll
annotations of the fields for setting the way of locating them.
Fields to be proxied:
WebElementWebElementsHtmlElement and its successors)TypifiedElement successors)page - Page object to be initialized.searchContext - The WebDriver instance that will be used to look up the elements.public static void populatePageObject(Object page, CustomElementLocatorFactory locatorFactory)
page - Page object to be initialized.locatorFactory - Locator factory that will be used to locate elements.Copyright © 2023 Yandex. All rights reserved.