zoukankan      html  css  js  c++  java
  • 设置苹果机参数

     其中 【newCommandTimeout】是 查找某个页面的元素时,定位可能会时间超长。默认的命令间隔时间是60s,如果在60s内没有找到,就会自动退出

    自己成功启动过的头部

    # -*- coding: utf-8 -*-
    from time import sleep
    from appium import webdriver
    from selenium.webdriver.common.by import By
    from selenium.webdriver.support.ui import WebDriverWait
    from selenium.webdriver.support import expected_conditions as EC
    import sys
    sys.path.append("/Users/kaibinliu/Desktop/patty")
    # from patty import draft
    import public
    import os

    # 调用日志功能
    logger=public.log()

    # iphone5S
    desired_caps = {}
    desired_caps['automationName'] = 'XCUITest' # Xcode8.2以上无UIAutomation,需使用XCUITest
    desired_caps['platformName'] = 'iOS'
    desired_caps['deviceName'] = 'iPhone 5S'
    desired_caps['bundleId'] = 'com.ibroker.iBerHK'
    desired_caps['platformVersion'] = '10.3.2'
    desired_caps['udid'] = 'd51e693a7638597890aac74de3f13ec5f884f036' #自己iphone 5s
    desired_caps['newCommandTimeout'] = 3600 # 1 hour
    # sys.exit()

    # # iphone6 Plus
    # desired_caps = {}
    # desired_caps['automationName'] = 'XCUITest' # Xcode8.2以上无UIAutomation,需使用XCUITest
    # desired_caps['platformName'] = 'iOS'
    # desired_caps['deviceName'] = 'iphone 6 Plus'
    # desired_caps['bundleId'] = 'com.ibroker.iBerHK'
    # desired_caps['platformVersion'] = '11.2.6'
    # desired_caps['udid'] = '2f8e523a430d1c2577803bbcdd7dd5a48eabdc9a'
    # desired_caps['newCommandTimeout'] = 360 # 1 hour
    # desired_caps["xcodeSigningId"] = "iPhone Developer" #必须
    # desired_caps["xcodeOrgId"] = "ATK47JS422" #必须

    # 打开Appium服务器,start server后,尝试启动被测App
    dr = webdriver.Remote('http://127.0.0.1:4723/wd/hub', desired_caps)

  • 相关阅读:
    饿了么 PostgreSQL 优化之旅
    kubernetes 滚动更新发布及回滚
    kubernetes yaml
    mongodb安装
    node.js安装
    linux输出换行
    把token放入请求头
    $.ajaxSetup
    js前端读取文件内容
    v-echarts安装
  • 原文地址:https://www.cnblogs.com/kaibindirver/p/8758684.html
Copyright © 2011-2022 走看看