美文网首页我爱编程
Appium自动化测试示例(五)

Appium自动化测试示例(五)

作者: 二斤寂寞 | 来源:发表于2018-03-02 10:52 被阅读245次

    一定要看appium_ios_sample_code!!!!
    一定要看appium_ios_sample_code!!!!
    一定要看appium_ios_sample_code!!!!

    image.png

    此处使用

    python3
    selenium 3.9.0
    Appium 1.5.3
    node v9.5.0
    xcode-select
    carthage
    python-client
    ideviceinstaller #只对iOS9有用
    ios-deploy #iOS10 以后的安装
    xcpretty #真机需要安装

    坑:


    image.png image.png

    安装appium客户端,上面的操作只是安装了server端,接下来需要安装测试代码运行所依赖的客户端,我们以python为例:

    git clone https://github.com/appium/python-client
    cd python-client-master 
    appium  #启动server
    

    坑:


    image.png

    解决方法:
    查看版本号:

    pip3 show selenium
    

    卸载:

    pip3 uninstall selenium
    

    安装固定版本

    sudo pip3 install -U selenium==3.9.0
    

    或者

    sudo mkdir /usr/local/selenium
    

    Give yourself ownership of the directory:

    chown your_username /usr/local/selenium
    

    Install Selenium:

    pip3 install -U selenium
    

    查看安装了些啥

    pip3 list 
    
    image.png

    坑:通过命令行执行server,就不能再使用appium软件启动服务,同时不会存在2个server,所以
    一定要关闭iOS模拟器和appium inspector窗口!!!

    坑:
    ImportError: cannot import name 'webdriver'

    image.png

    安装appium客户端,上面的操作只是安装了server端,接下来需要安装测试代码运行所依赖的客户端,我们以python为例:

    git clone https://github.com/appium/python-client
    cd python-client-master 
    appium #启动服务
    

    对于 iOS10 以上的测试,需要下载安装 appium-xcuitest-driver 驱动:Appium iOS driver, backed by Apple XCUITest , 当然也可以在 /usr/local/lib/node_modules/appium/node_modules/.2.5.1@appium-xcuitest-driver/WebDriverAgent/ 找到该项目,执行 carthage update , 选择 WebDriverAgentRunner 编译即可。

    其他相关的安装:

    $ brew install libimobiledevice --HEAD  # install from HEAD to get important updates
    $ brew install ideviceinstaller         # 只是对iOS9有用
    
    $ npm install -g ios-deploy             # iOS10 以后的版本安装ios-deploy
    $ sudo gem install xcpretty             # 真机需要安装 xcpretty
    
    image.png

    参考文章:
    用实例告诉你,如何利用Appium实现移动终端UI自动化测试

    Appium探索——Mac OS Python版

    mac appium ios python 之首次运行测试用例

    iOS+Python+Appium真机自动化测试实战

    http://appium.io

    https://saucelabs.com/mobile

    https://testerhome.com

    https://www.tapd.cn/20005091/prong/stories/view/1120005091001015619

    http://blog.csdn.net/iosswift/article/details/48765993

    Appium+python自动化21-DesiredCapabilities详解

    http://appium.io/docs/cn/writing-running-appium/caps/index.html

    Appiumappium+python+jenkins一套自动化测试框架搭

    http://wanwu.tech/2017/05/15/ios-testing-appium-python/

    Appium 服务器初始化参数(Capability)

    http://appium.io/docs/cn/writing-running-appium/caps/index.html

    相关文章

      网友评论

        本文标题:Appium自动化测试示例(五)

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