iOS 自动化测试

Appium iOS WebDriverAgent 配置

安装iOS授权工具

1
npm install -g authorize-ios

安装工具

1
2
3
4
5
brew install libimobiledevice

brew install ios-deploy

brew install ios-webkit-debug-proxy

安装npm
安装Carthage

1
brew install carthage

拉取代码

1
2
3
cd ~/Xcode

git clone https://github.com/facebook/WebDriverAgent.git

下载依赖

1
2
3
4
5
cd WebDriverAgent

mkdir -p Resources/WebDriverAgent.bundle

./Scripts/bootstrap.sh -d

wda 位置

1
~/.nvm/versions/node/v8.13.0/lib/node_modules/appium/node_modules/appium-xcuitest-driver/WebDriverAgent

双击打开WebDriverAgent.xcodeproj这个文件。

修改配置

Build Settings->Product Bundle Identifier

WebDriverAgent->WebDriverAgentLib->Signing->Automatically manage signinng

WebDriverAgent->WebDriverAgentRunner->Build Settings->Product Bundle Identifier

查看设备

1
2
3
instruments -s devices
ios-deploy -c
libimobiledevice -l
  • Finally, you can verify that everything works. Build the project:
1
xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'id=<udid>' test

运行

WebDriverAgentRunner->Test方式运行。

Xcode终端会看到这个输出就证明运行成功**Runner[2424:2946752] ServerURLHere->http://127.0.0.1:8100<-ServerURLHere**

查看状态http://127.0.0.1:8100/status

查看元素位置http://127.0.0.1:8100/inspector

获取状态信息

1
http://localhost:8100/status

获取source

1
2
3
http://localhost:8100/source

http://127.0.0.1:8100/source?format=json

获取session详细信息

1
http://localhost:8100/session/D2BDF992-D087-4013-B354-05F48FC5A748/

获取source

1
http://localhost:8100/session/D2BDF992-D087-4013-B354-05F48FC5A748/source

获取截图

1
2
3
http://localhost:8100/session/D2BDF992-D087-4013-B354-05F48FC5A748/screenshot

http://127.0.0.1:8100/screenshot

FAQ

1
2
3
4
5
6
7
npm WARN deprecated minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated css-list@0.1.3: Deprecated.
npm WARN deprecated browserslist@0.4.0: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.

npm WARN react-dom@15.6.2 requires a peer of react@^15.6.2 but none is installed. You must install peer dependencies yourself.

npm WARN web-driver-inspector@1.0.0 No repository field.

iOS自动化测试的那些干货

facebook/xctool

1
brew install xctool

iOS Development Bridge

idb使用,以前叫fbsimctl

参考

Starting WebDriverAgent

iOS WebDriverAgent 环境搭建

iOS 真机如何安装 WebDriverAgent

iOS 真机调试如何安装 WebDriverAgent

Appium iOS 真机测试

线上班第六期_IOS 进阶 Webview 测试_20180603

线下第三期_iOS 真机测试_20180819

Appium XCUITest Driver Real Device Setup

ATX 文档 - iOS 真机如何安装 WebDriverAgent

JSONWP cannot find “wda/screen”

×

纯属好玩

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

文章目录
  1. 1. Appium iOS WebDriverAgent 配置
  • FAQ
  • iOS自动化测试的那些干货
    1. 1. facebook/xctool
    2. 2. iOS Development Bridge
  • 参考
  • ,