mercredi 9 décembre 2015

Find child element in parent using @FindBy annotation

Is it possible to find a child in parent element using @FindBy annotation? For instance, I have the following elements on my page:
@FindBy(xpath = ".//div") WebElement parent;

and
@FindBy(xpath = "./a") WebElement link;

And I need to find a link in that specific parent. Do I have to use parent.findElement(By.xpath("./a")) or it is possible to mark link element as a child in parent using @FindBy annotation?

Aucun commentaire:

Enregistrer un commentaire