美文网首页
安装webDriverAgent和跑测试脚本遇到的坑

安装webDriverAgent和跑测试脚本遇到的坑

作者: Mikasa___ | 来源:发表于2018-06-12 21:18 被阅读0次

1、首先,背景是需要在 iOS 11.3 的手机上跑,xcode版本较低出现

版本较低,xcode和手机系统不兼容 xcode和 mac 系统不兼容

需要安装最新版本的xcode,那么就涉及到电脑系统也要是相应匹配的。建议到appStore下载,以后更新的时候可以直接在appStore更新。自己直接拿包去安装的话,appStore检测不到更新,更新起来还要找相匹配的版本,比较麻烦。

写这篇文章的时候用的 【macOS 10.13.5】【 xcode  9.4】亲测没什么问题

2、编译 webDriverAgent ,根据文章 https://www.jianshu.com/p/efa9ac4900a6 11.2和11.3正常的话编译不会出问题。我这边出的问题是没配置好相应目录下的内容报错,搜了很多没找到,也走了一些弯路,贴出来网上大家可以搜到了作为一个参考吧。

注意下面不同的目录和不同的tab

     编译WebDriverAgentLib

WDALib的General Tab 下

  编译WebDriverAgentRunner

WDARunner 的  build settings Tab 下

当时我在WDARunner的General Tab 下已经修改过 bundle identifier ,没在Build Settings Tab 下改 product bundle identifier 所以会出错

app ID包含facebook不能被注册 

搜这个报错信息搜到了这个可以作为参考

Make sure you are signed in with developer account in Xcode.

Navidate to the folder /node_modules/appium-xcuitest-driver/WebDriverAgent/

Open the WebDriverAgent.xcodeproj project in Xcode.

Change the bunlder identifier for WebDriverAgentLib, WebDriverAgentRunner from com.facebook.Webdriver** to your choice so you can sign it with your provisioning profile.

Build the project for WebDriverAgentLib, WebDriverAgentRunner and IntegrationApp targets.

然后通过终端建立服务WebDriverAgent:进入WebDriverAgent 文件夹,建立服务。

$ cd /usr/local/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent

$ xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=真机的udid' test

3、第一次用在手机上运行起来了(可能不应该直接运行到手机吧),这些报错估计运行其他工程也会出现,在手机上跑的时候提示不能锁屏,但手机其实没有锁屏。

提示不能锁屏

这种时候可以拔掉数据线,重启xcode,数据线连上手机,解锁手机后再跑一遍WDA。如果还是不行,就重启手机,重启xcode解锁手机后再跑一遍WDA。毕竟重启大法好。

4、在跑测试脚本对相应app进行测试时,一定要注意脚本里面'bundleId'和编译时设置的 bundleId 是一致的

我在跑的时候出现以下错误

另外注意编译一个工程文件 bundle id 必须是唯一的,可以自己命名。

相关文章

网友评论

      本文标题:安装webDriverAgent和跑测试脚本遇到的坑

      本文链接:https://www.haomeiwen.com/subject/hxireftx.html