美文网首页
appium2.0自动化测试框架iOS版教程

appium2.0自动化测试框架iOS版教程

作者: chic_wx | 来源:发表于2023-04-12 09:57 被阅读0次

一、环境搭建

1安装appium

npm i -g appium@next

2安装Appium驱动程序及其依赖项

appium driver install uiautomator2
appium driver install xcuitest

3安装webdriveragent

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

初始化

./Scripts/bootstrap.sh
DevToolsSecurity --enable
carthage bootstrap --platform ios

4 安装appium-inspector

下载地址

Releases · appium/appium-inspector (github.com)

注意appium2.0版本已经不支持网页访问inspector,需要下载官方客户端

二、实际操作

  1. 将WebDriverAgentRunner程序运行到真机

    首次安装需要从电脑安装,之后可以在手机上直接打开WebDriverAgentRunner程序即可

xcodebuild -project WebDriverAgent.xcodeproj -scheme WebDriverAgentRunner -destination 'platform=iOS,id=00008030-XXXXXXXXXXX' test
  1. 在电脑端启动appium服务
    在Terminal中输入appium

  2. 打开Appium Inspector客户端
    在JSON Representation里填写启动参数
    例如自动打开手机的设置应用,参数如下

{
  "platformName": "iOS",
  "appium:automationName": "XCUITest",
  "appium:udid": "auto",
  "appium:platformVersion": "16.0",
  "appium:bundleId": "com.apple.Preferences"
}
启动页面

启动之后即可在电脑客户端进行操作,例如编写自动化脚本

启动之后

相关文章

网友评论

      本文标题:appium2.0自动化测试框架iOS版教程

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