zoukankan      html  css  js  c++  java
  • Appium的ios配置

    automationName   text         XCUITest

    platformName             text           iOS          

    platformVersion           text          11.3

    deviceName                text         iphone Simulator

    app                            firepath          路径

    -----------------------------------------------------------------------------------------------------

    from appium import webdriver

    import time

    capability={

      "automationName ": "XCUITest",

      "platformName " : "iOS",          

      "platformVersion " : "11.3",

      "noReset":"true",

      "deviceName " : "iphone Simulator",

      "app"        :" 路径"

    }

    driver=webdriver.Remote('http://127.0.0.1/wd/hub',capability)

    driver.switch_to.alert.accept()

    -------------------------------------------------------------------------

    from appium import webdriver

    import time

    capability={

      "automationName ": "XCUITest",

      "platformName " : "iOS",          

      "platformVersion " : "11.3",

      "noReset":"true",

      "deviceName " : "iphone Simulator",

      "app"        :" 路径"

    }

    driver=webdriver.Remote('http://127.0.0.1/wd/hub',capability)

    driver.execute_script("mobile:scroll",{"direction":"right"})

    def get_size():
    size=driver.get_window_size()
    width=size['width']
    height=size['height']
    return width,height
    #向左滑动
    def swipe_left():
    x1=get_size()[0]/10*9
    y1=get_size()[1]/2
    x2=get_size()[0]/10
    driver.swipe(x1,y1,x2,y1)
    #向右滑动
    def swipe_right():
    x1=get_size()[0]/10
    y1=get_size()[1]/2
    x2=get_size()[0]/10*9
    driver.swipe(x1,y1,x2,y1)
    #向上滑动
    def swipe_up():
    x1=get_size()[0]/2
    y=get_size()[1]/10*9
    y1=get_size()[0]/10
    driver.swipe(x1,y,x1,y1)
    #向下滑动
    def swipe_down():
    x1=get_size()[0]/2
    y=get_size()[1]/10
    y1=get_size()[1]/10*9
    driver.swipe(x1,y,x1,y1)
    def swipe_on(direction):
    if direction=='up':
    swipe_up()
    elif direction=='down':
    swipe_down()
    elif direction=='left':
    swipe_left()
    else:
    swipe_right()
    swipe_left()
    driver.quit()
  • 相关阅读:
    UVA 10564 Paths through the Hourglass DP
    HDU 3397 Sequence operation 线段树 成段更新 区间合并
    HDU 3308 LCIS 线段树 单点更新+区间合并
    POJ 3667 Hotel 线段树 区间合并
    UVALive 3942 Remember the Word Tire+DP
    POJ 1703 Find them, Catch them
    UVA 1366 Martian Mining DP
    UVA 1456 Cellular Network 贪心+DP
    UVA 11573 Ocean Currents
    【ACM】hdu_zs1_1003_放大的X _201307271557
  • 原文地址:https://www.cnblogs.com/xuzhongtao/p/9763686.html
Copyright © 2011-2022 走看看