我正在使用Selenium C#和MSTest的页面对象模式,我想声明我已经通过使用实际页面标题声明预期的页面标题来到达正确的页面.我有以下代码,但它不起作用:
框架:
public class MyAccountPage
{
public const string MyAccountPageTitle = "My Account";
public static bool IsAt()
{
return Driver.Instance.Title == MyAccountPageTitle;
}
Run Code Online (Sandbox Code Playgroud)
测试:
Assert.IsTrue(MyAccountPage.IsAt);
Run Code Online (Sandbox Code Playgroud)