I'm trying to use WinApp driver for testing some Windows 10 UWP applications - Mail & Edge.
When I start session with app settings, I got error from driver:
Result 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.StartSession(ICapabilities desiredCapabilities)
at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor,
ICapabilities desiredCapabilities)
at OpenQA.Selenium.Appium.AppiumDriver`1..ctor(Uri remoteAddress, ICapabilities
desiredCapabilities)
at OpenQA.Selenium.Appium.Windows.WindowsDriver`1..ctor(Uri remoteAddress, DesiredCapabilities
desiredCapabilities)
at Task3_WinApp.WinApp_UWPMailTest.TestInit() in ...
Result Message: System.InvalidOperationException : This app does not support the contract specified or is not installed. (Exception from HRESULT: 0x80270254)
This is a part of my test, the error occurs on the last line:
DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.SetCapability("app", "microsoft.windowscommunicationsapps_8wekyb3d8bbwe!App"); // Mail
//appCapabilities.SetCapability("app", "Microsoft.MicrosoftEdge_8wekyb3d8bbwe!App"); //Edge
appCapabilities.SetCapability("deviceName", "WindowsPC");
session = new WindowsDriver<WindowsElement>(new Uri("http://127.0.0.1:4723"),
The same code with different applications works fine (for example with Microsoft.WindowsCalculator_8wekyb3d8bbwe!App)
Solved:
Windows 10 UWP apps has different app id schema for a different applications. For example, suffix !App works for Calculator & Photos, but you may need to use other for different apps:
for Mail: Microsoft.WindowsCommunicationsApps_8wekyb3d8bbwe!Microsoft.WindowsLive.Mail
for Edge: Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge
The full list of product IDs in Windows 10 you can find here:
Most helpful comment
Solved:
Windows 10 UWP apps has different app id schema for a different applications. For example, suffix !App works for Calculator & Photos, but you may need to use other for different apps:
for Mail: Microsoft.WindowsCommunicationsApps_8wekyb3d8bbwe!Microsoft.WindowsLive.Mail
for Edge: Microsoft.MicrosoftEdge_8wekyb3d8bbwe!MicrosoftEdge
The full list of product IDs in Windows 10 you can find here:
https://docs.microsoft.com/en-us/windows/configuration/mobile-devices/product-ids-in-windows-10-mobile