标准Web元素行为
标准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 HtmlElements / TypifiedElement行为
首次使用时会立即加载下载或延迟加载吗?
@FindBy(id = "button")
private CustomButton button; // Extends TypifiedElement
@FindBy(id = "block")
private CustomComponent block; // Extends HtmlElements
答案 0 :(得分:2)
它的工作方式与标准WebElements相同 - 当您尝试访问元素时,将首次执行元素搜索。