There are tests for selenide. (The solution for selenium will do).

Suppose there is a certain element.

@FindBy(css = "login_field") @Name("Логин") private SelenideElement loginField; 

Can I somehow pull out the text of the @FindBy annotation? In methods I did not find it, I thought somehow when creating it, the specified selector saved somewhere in the form of a variable, but I did not find it. You can try through reflection, but there is an option is not so hard?

    1 answer 1

      @FindBy(xpath = "//*[@class=\"value\"]") private WebElement value; public String getText(String value){ return value.getText(); } String text = getText(value);