参考内容:
https://testerhome.com/topics/10193
https://testerhome.com/topics/8223
https://testerhome.com/topics/8812
https://github.com/appium/appium/blob/71fac8d2759b18bb2a506a5c8359bfdf41a6443b/docs /cn/writing-running-appium/windows-app-testing.md
https://developer.microsoft.com/zh-cn/windows/downloads/windows-10-sdk
https://github.com/Microsoft/WinAppDriver /发布
解决步骤:
https://testerhome.com/topics/10193
该贴遗留问题:
MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET Framework 2.0 SDK;2) 安装 Microsoft Vis ual Studio 2005;或 3)
如果将该组件安装到了其他位置,请将其位置添加到系统路径中。 [D:\nodejs\node-global\node_modules\appium\node_modules\heapdump\build\bi nding.sln]
这个问题意思是需要利用报错的组件来编译WinAppDriver,WinAppDriver是用来支持windows应用UI自动化的,Appium引用了该底层支持驱动。
但是这个问题,你不关心它,还是可以继续用来做ios app或android app基于UI元素识别的自动化的,没有任何影响。
如果想解决该问题,我大致花了半天时间搜了些帖子和科学上谷大哥,绕了点弯道,最终解决了该报错,也成功的在Appium下编译安装成功了WinAppDriver组件。
达到了Win10完美安装Appium1.7.2。即不会报任何错误和警告。这样也可以直接支持Appium使用WinAppDriver做windows客户端或uwp客户端应用的UI自动化了。
解决掉了这种报错:
MSBUILD : error MSB3428: 未能加载 Visual C++ 组件“VCBuild.exe”。要解决此问题,1) 安装 .NET Framework 2.0 SDK;2) 安装 Microsoft Vis ual Studio 2005;或 3)
如果将该组件安装到了其他位置,请将其位置添加到系统路径中。 [D:\nodejs\node-global\node_modules\appium\node_modules\heapdump\build\bi nding.sln]
解决掉了这种警告:
> appium-windows-driver@1.0.0 install D:\nodejs\node-global\node_modules\appium\node_modules\appium-windows-driver
> node install-npm.js
info WinAppDriver You must use WinAppDriver version 1.0
info WinAppDriver Verifying WinAppDriver version 1.0 is installed via comparing the checksum.
info WinAppDriver WinAppDriver.exe doesn't exist at the correct version 1.0, setting up
WARNING: You are not running as an administrator so WinAppDriver cannot be installed for you; please reinstall as admin
WinAppDriver was not installed; please check your system and re-run npm install if you need WinAppDriver
> heapdump@0.3.9 install D:\nodejs\node-global\node_modules\appium\node_modules\heapdump
> node-gyp rebuild
D:\nodejs\node-global\node_modules\appium\node_modules\heapdump>if not defined npm_config_node_gyp (node "D:\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\\..\..\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "D:\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" rebuild )
在此解决方案中一次生成一个项目。若要启用并行生成,请添加“/m”开关。
具体解决步骤:
最终的方法,期间参考一些折腾了一些其他的,反复试了几次,应该是这样的步骤:
1卸载npm uninstall appium -g
哦实际我也开启了win10的开发人员模式,此步是不是必要我暂时不清楚,参考乱七八糟的帖子折腾了许多,所以并不知道是否此步必要
2控制面板 - >程序和功能开启标红两项
3去https://developer.microsoft.com/zh-cn/windows/downloads/windows-10-sdk 下载.iso
一共760多MB 16299.15.170928-1534.rs3_release_WindowsSDK.iso win10可以直接双击该iso便会加载为一个光盘DVD驱动器,进去,直接双击WinSDKSetup.exe安装即可。默
认路径,默认功能全选择
安装成功后,程序和功能会多出这几项,可以确认下
4 https://github.com/Microsoft/WinAppDriver/releases 下载v1.0的WindowsApplicationDriver.msi。
安装到默认C:\ Program Files(x86)\ Windows Application Driver
路径,然后命令行到该路径,尝试启动下
保证启动正常。保证正常启动不报错后,就可以关掉了,安装其他过程中不需要保证开启该服务器
5管理员权限powershell执行npm install --global --production windows-build-tools
过程很长,需要在线下载一些组件。我全程科学上网。
Windows PowerShell
版权所有 (C) Microsoft Corporation。保留所有权利。
PS C:\WINDOWS\system32> npm install --global --production windows-build-tools
> windows-build-tools@2.2.1 postinstall D:\nodejs\node-global\node_modules\windows-build-tools
> node ./lib/index.js
Downloading BuildTools_Full.exe
Downloading python-2.7.14.amd64.msi
[> ] 0.0% (0 B/s)
Downloaded python-2.7.14.amd64.msi. Saved to C:\Users\cmd\.windows-build-tools\python-2.7.14.amd64.msi.
Starting installation...
Launched installers, now waiting for them to finish.
This will likely take some time - please be patient!
Status from the installers:
---------- Visual Studio Build Tools ----------
Successfully installed Visual Studio Build Tools.
------------------- Python --------------------
Successfully installed Python 2.7
+ windows-build-tools@2.2.1
added 132 packages in 1365.525s
6管理员权限powershell执行npm i appium -g
然后就正常了没警告了。
PS C:\WINDOWS\system32> npm i appium -g
D:\nodejs\node-global\appium -> D:\nodejs\node-global\node_modules\appium\build\lib\main.js
> appium-chromedriver@3.1.4 install D:\nodejs\node-global\node_modules\appium\node_modules\appium-chromedriver
> node install-npm.js
info Chromedriver Install Installing Chromedriver version '2.33' for platform 'win' and architecture '32'
info Chromedriver Install Opening temp file to write chromedriver_win32 to...
info Chromedriver Install Downloading https://chromedriver.storage.googleapis.com/2.33/chromedriver_win32.zip...
info Chromedriver Install Writing binary content to C:\Users\cmd\AppData\Local\Temp\2018317-14572-briz5r.jt6ow\chromedriver_win32.zip...
info Chromedriver Install Extracting C:\Users\cmd\AppData\Local\Temp\2018317-14572-briz5r.jt6ow\chromedriver_win32.zip to C:\Users\cmd\AppData\Local\Temp\2018317-14572-briz5r.jt6ow\chromedriver_win32
info Chromedriver Install Creating D:\nodejs\node-global\node_modules\appium\node_modules\appium-chromedriver\chromedriver\win...
info Chromedriver Install Copying unzipped binary, reading from C:\Users\cmd\AppData\Local\Temp\2018317-14572-briz5r.jt6ow\chromedriver_win32