Search code examples
winappdriver

WinAppDriver : work on an uwp under development


With the test tool WinAppDriver, for launching the app you use the code bellow:

DesiredCapabilities appCapabilities = new DesiredCapabilities();
appCapabilities.SetCapability("app", "appID");

but for an uwp under devlopement, how het the app id? how use the tool on an universal windows app?


Solution

  • When your app is installed, you can find the packageFullName using the following Powershell command:

    Get-AppxPackage -Name

    Where PackageName will be the PackageName that you specify in the AppXManifest (in the packaging tab).

    Look for the PackageFamilyName, and that will be the prefix of AppId that you need to specify before the !App.

    For example from the WinAppDriver input sample app:

    Get-AppxPackage -Name WinAppDriver.Input

    Name              : WinAppDriver.Input
    Publisher         : CN=WinAppDriver, O=Microsoft Corporation, L=Redmond, S=Washington, C=US
    Architecture      : X64
    ResourceId        :
    Version           : 1.0.2.0
    PackageFullName   : WinAppDriver.Input_1.0.2.0_x64__xh1ske9axcpv8
    InstallLocation   : C:\Program Files\WindowsApps\WinAppDriver.Input_1.0.2.0_x64__xh1ske9axcpv8
    IsFramework       : False
    PackageFamilyName : WinAppDriver.Input_xh1ske9axcpv8
    PublisherId       : xh1ske9axcpv8
    IsResourcePackage : False
    IsBundle          : False
    IsDevelopmentMode : False
    Dependencies      : {Microsoft.NET.CoreRuntime.1.1_1.1.25305.1_x64__8wekyb3d8bbwe,
                    Microsoft.VCLibs.140.00.Debug_14.0.25547.0_x64__8wekyb3d8bbwe}
    IsPartiallyStaged : False
    SignatureKind     : Developer
    Status            : Ok
    

    The AppID would be: WinAppDriver.Input_xh1ske9axcpv8!App