1
标准WebElement行为延迟加载如何与Yandex HtmlElements一起使用?
标准WebElement延迟加载的工作原理如下:
// Will not try to find button until perform an operation on it such as button.click();
@FindBy(id = "button")
private WebElement button;
// Button list will be created immediately
@FindBy(id = "button")
private List<WebElement> buttons;
// Button list will be created after waiting 5 seconds
@Timeout(5)
@FindBy(id = "button")
private List<WebElement> buttons;
Yandex的HTML元素/ TypifiedElement行为
将按以下立即被加载或懒洋洋地第一次使用时加载?
@FindBy(id = "button")
private CustomButton button; // Extends TypifiedElement
@FindBy(id = "block")
private CustomComponent block; // Extends HtmlElements
如果HtmlElement组件具有列表或其他基于HtmlElement的组件作为字段,它仍然是惰性加载?列表会立即加载,或者如果使用隐式超时将在加载之前等待超时的完整持续时间 - 两种方式都不会延迟加载。所以想知道这些对容器类是否有任何影响延迟加载... –
是的,HtmlElement的所有'内部'字段将被延迟加载。 – artkoshelev