Допустим, я хочу проверить, был ли мой пароль успешно изменен. Какой подход лучше использовать?
[FindsBy(How = How.XPath, Using = "//span[@id='confirmation' and text()='Success!']")]
public IWebElement PasswordChangedSuccessfullyConfirmationElement { get; protected set; }
public bool IsPasswordChanged()
{
return PasswordChangedSuccessfullyConfirmationElement != null &&
PasswordChangedSuccessfullyConfirmationElement.Displayed;
}
или
[FindsBy(How = How.Id, Using = "confirmation")]
public IWebElement PasswordChangedSuccessfullyConfirmationElement { get; protected set; }
public bool IsPasswordChanged()
{
return PasswordChangedSuccessfullyConfirmationElement != null &&
PasswordChangedSuccessfullyConfirmationElement.Text == "Success!" &&
PasswordChangedSuccessfullyConfirmationElement.Displayed;
}