0

I'm using Thucydides 0.9.229 with Selenium shipped with it. To obtain some webelements I try to get them via List

@FindAll({@FindBy(xpath = "//div[text()='Расположение']/../../td[2]//input[@type='text']")})
private List<WebElement> placement;

with no result, the placement is returned null, while here

@FindBy(xpath = "//div[text()='Расположение']/../../td[2]//input[@type='text']")})
private WebElement placement;

there placement is not null, but the correct webelement handled well. As far as I understand, the firs example should return the 1-value list anyway, but even more values if there were some additional elements fitting the criteria. So, what is wrong, why I can't get the list of webelements there?

4

1 回答 1

1

I have the same issue with @FindAll, and it also returns null.

However, you can use @FindBy for list of elements too. It may be used to mark a field on a Page Object to indicate an element or a list of elements.

@FindBy(xpath = "//div[text()='Расположение']/../../td[2]//input[@type='text']")})
private List<WebElement> placement;
于 2014-08-06T14:45:33.600 回答