0

我正在尝试从https://github.com/Microsoft/WinAppDriver/tree/master/Samples/C%23/CalculatorTest获取此计算器示例,但我无法解决“ImplicitWait”。VS建议使用ImplicitlyWait但仍然无法正常工作。我有一个 appium.webdriver v3.0.0.2 并且示例仍在使用预览版。

完整的错误信息:

ITimeouts does not contain a definition for 'ImplicitWait' and no accessible extension method 'ImplicitWait' accepting a first argument of type 'ITimeouts' could be found (are you missing a using directive or an assembly reference?)

代码:

public static void Launch(TestContext context)
{
   var appCapabilities = new DesiredCapabilities();
   appCapabilities.SetCapability("app", AppId);
   appCapabilities.SetCapability("deviceName", "WindowsPC");
   appCapabilities.SetCapability("platformName", "Windows");
   session = new WindowsDriver<WindowsElement>(new Uri(DriverUrl), appCapabilities);
   Assert.IsNotNull(session);
   session.Manage().Timeouts().ImplicitWait = TimeSpan.FromSeconds(1.5);
}
4

0 回答 0