Open MikimotoH opened 4 years ago
After I modified DesiredCapabilities to AppiumOptions, then there is no compile error.
var appOpts = new OpenQA.Selenium.Appium.AppiumOptions();
appOpts.AddAdditionalCapability("app", AlarmClockAppId);
session = new WindowsDriver<WindowsElement>(new Uri(WindowsApplicationDriverUrl), appOpts);
However, I encounter OpenQA.Selenium.WebDriverException during Debug All Tests. File : ScenarioAlarm.cs Line: 55
WindowsElement alarmEntry = session.FindElementByXPath($"//ListItem[starts-with(@Name, \"{NewAlarmName}\")]");
Exception Detail is:
OpenQA.Selenium.WebDriverException
HResult=0x80131500
Message=An element could not be located on the page using the given search parameters.
Source=WebDriver
StackTrace:
at OpenQA.Selenium.Remote.RemoteWebDriver.UnpackAndThrowOnError(Response errorResponse)
at OpenQA.Selenium.Remote.RemoteWebDriver.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Appium.AppiumDriver`1.Execute(String driverCommandToExecute, Dictionary`2 parameters)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElement(String mechanism, String value)
at OpenQA.Selenium.Remote.RemoteWebDriver.FindElementByXPath(String xpath)
at OpenQA.Selenium.Appium.AppiumDriver`1.FindElementByXPath(String xpath)
at AlarmClockTest.ScenarioAlarm.AlarmAdd() in C:\work\WinAppDriver\Samples\C#\AlarmClockTest\ScenarioAlarm.cs:line 55
In the file ScenarioAlarm.cs change line 123 to
// Navigate to Alarm tab session.FindElementByAccessibilityId("AlarmPivotItem").Click();
I git clone microsoft/WinAppDriver, and then open WinAppDriver/Samples/C#/AlarmClockTestAlarmClockTest.sln; I got this error in this line:
My Nuget Packages and versions are:
WinAppDriver git version is a6f3d7b.