0

是否可以使用 Appium 检查 Windows 应用程序?如果是的话,有人可以告诉我应该设置什么“期望的能力”来启动例如记事本吗?

我所做的是:

  • 安装/启动 Appium
  • 在 0.0.0.0:4723 启动服务器
  • 单击启动检查器
  • 提供以下能力:

    { "platformName": "Windows", "deviceName": "WindowsPC", "app": "C:\Windows\System32\notepad.exe" }

我得到的是以下日志:

[HTTP] --> POST /wd/hub/session
[HTTP] {"desiredCapabilities":{"app":"C:\\Windows\\System32\\notepad.exe","deviceName":"WindowsPC","platformName":"Windows","newCommandTimeout":0,"connectHardwareKeyboard":true}}
[MJSONWP] Calling AppiumDriver.createSession() with args: [{"app":"C:\\Windows\\System32\\notepad.exe","deviceName":"WindowsPC","platformName":"Windows","newCommandTimeout":0,"connectHardwareKeyboard":true},null,null]
[BaseDriver] Event 'newSessionRequested' logged at 1562752317506 (11:51:57 GMT+0200 (W. Europe Daylight Time))
[Appium] Appium v1.14.0 creating new WindowsDriver (v1.5.1) session
[Appium] Capabilities:
[Appium]   app: C:\Windows\System32\notepad.exe
[Appium]   deviceName: WindowsPC
[Appium]   platformName: Windows
[Appium]   newCommandTimeout: 0
[Appium]   connectHardwareKeyboard: true
[BaseDriver] Creating session with MJSONWP desired capabilities: {"app":"C:\\Windows\\System...
[BaseDriver] The following capabilities were provided, but are not recognized by Appium:
[BaseDriver]   app
[BaseDriver]   connectHardwareKeyboard
[BaseDriver] Session created with session id: b4f9003f-6a56-47b8-b9f3-bf70ac3dc91d
[WinAppDriver] You must use WinAppDriver version 1.1
[WinAppDriver] Verifying WinAppDriver version 1.1 is installed via comparing the checksum.
[WinAppDriver] Deleting WinAppDriver session
[BaseDriver] Event 'newSessionStarted' logged at 1562752317614 (11:51:57 GMT+0200 (W. Europe Daylight Time))
[MJSONWP] Encountered internal error running command: Error: Could not verify WinAppDriver install; re-run install
[MJSONWP]     at C:\Users\myUser\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\appium-windows-driver\lib\winappdriver.js:35:13
[MJSONWP]     at Generator.next ()
[MJSONWP]     at asyncGeneratorStep (C:\Users\myUser\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\@babel\runtime\helpers\asyncToGenerator.js:3:24)
[MJSONWP]     at _next (C:\Users\myUser\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\@babel\runtime\helpers\asyncToGenerator.js:25:9)
[MJSONWP]     at run (C:\Users\myUser\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\core-js\modules\es6.promise.js:75:22)
[MJSONWP]     at C:\Users\myUser\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\core-js\modules\es6.promise.js:92:30
[MJSONWP]     at flush (C:\Users\myUser\AppData\Local\Programs\Appium\resources\app\node_modules\appium\node_modules\core-js\modules\_microtask.js:18:9)
[MJSONWP]     at process._tickCallback (internal/process/next_tick.js:61:11)
[HTTP] <-- POST /wd/hub/session 500 113 ms - 190
[HTTP] 
[HTTP] --> DELETE /wd/hub/session
[HTTP] {}
[HTTP] No route found. Setting content type to 'text/plain'
[HTTP] <-- DELETE /wd/hub/session 404 1 ms - 57

卸载和重新安装没有帮助。我做错什么了吗?windows驱动要手动启动吗?

4

1 回答 1

0

您可以从 Windows 命令提示符运行 selenium 服务器,例如

C:\Users\Administrator> “C:\Program Files (x86)\Windows Application Driver\WinAppDriver.exe” 4723/wd/hub

服务器运行后。在 Visual Studio 中使用断点,然后开始调试。当您开始调试时,您将在命令窗口中看到 sessionID。复制该会话 ID

打开 appium > 文件 > 新会话窗口 > 自定义服务器 > 附加到会话 > 粘贴会话 ID > 单击“附加到会话”>

你会得到你的结果。(appium 需要一些时间来获取当前会话)。

于 2019-10-02T00:26:05.563 回答