2

for testing purposes, is it possible to run GUI applications on GitHub-hosted runners? I tried to run Windows Calculator (Microsoft.WindowsCalculator_8wekyb3d8bbwe!App) on "windows-2022" via WinAppDriver and it fails with "WebDriverException: Package was not found".

Any suggestion(s)?

TIA, Adrian.

P.S. here is my GitHub Actions workflow for the above:

  # ISSUE fails with WebDriverException: Package was not found
  # see https://github.com/QA-Automation-Starter/qa-automation/actions/runs/3234841483/jobs/5298454871

  build-and-test-on-windows:
    name: windows build&test
    # see https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners
    runs-on: windows-2022
    environment: development

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-java@v3
        with:
          java-version: '8'
          distribution: 'temurin'
          cache: maven
          settings-path: ${{ github.workspace }}

      # ISSUE somehow should run WinAppDriver
      # see https://github.com/microsoft/WinAppDriver/issues/1722
      # and https://github.com/actions/runner-images/blob/main/images/win/Windows2022-Readme.md

      # TODO maybe, should re-publish the site from here (?)
      - run: |
          choco install -y autologon
          autologon %USERNAME% $USERDOMAIN%
          start cmd /c "C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe"
          cd qa-testing-example
          mvn install ^
            -s %GITHUB_WORKSPACE%\settings.xml ^
            -Pmode-build-fast,mode-build-quiet,environment-default,testing-windows,device-windows
        shell: cmd

Adrian Herscu
  • 738
  • 1
  • 6
  • 19
  • Show your manifest for GitHub Actions please. Have you installed all the dependencies before executing test cases? – Lex Li Oct 16 '22 at 19:02
  • @LexLi added workflow per your request – Adrian Herscu Oct 18 '22 at 10:59
  • https://serverfault.com/questions/31608/can-i-run-a-gui-program-in-the-background-on-the-windows-command-line – doptimusprime Jan 24 '23 at 03:21
  • https://stackoverflow.com/questions/21031171/how-to-run-a-command-in-the-background-on-windows – doptimusprime Jan 24 '23 at 03:21
  • Check if above link can help you. – doptimusprime Jan 24 '23 at 03:21
  • The calculator is not available with that AUMID on GitHub windows runners, probably because it is a windows server. You can run Get-StartApps on a pwsh step and it will print a path-based AUMID for the Calculator, instead of the package that is used everywhere as a canonical example of winappdriver. Notice that the path points to win32calc.exe, which is a different app (thus with different accessibility features), so even if you change the AUMID, the examples on the internet won't work. That's how far I went with this, i have not tried to install the win desktop calculator. – mangini Jun 08 '23 at 00:04

0 Answers0