我正在使用带有 C# 的 WebDriver 来自动测试 gmail。我填写表格,然后单击按钮进入。如何验证登录成功或失败?
[FindsBy(How = How.Id, Using = "Email")]
public IWebElement username;
[FindsBy(How = How.Id, Using = "Passwd")]
public IWebElement password;
[FindsBy(How = How.Id, Using = "signIn")]
public IWebElement loginButton;
public LoginForm()
{
PageFactory.InitElements(Driver.driver, this);
}
public GmailPage Login(String username, String password)
{
this.username.SendKeys(username);
this.password.SendKeys(password);
this.loginButton.Click();
GmailPage result = new GmailPage();
return result;
}