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()

Appium的ios配置的更多相关文章

  1. Appium的iOS环境搭建

    操作系统的名称:Mac OS X操作系统的版本:10.13.3 xcode 版本:9.2 java 版本:java8_161 appium destop版本:1.7.3 接下来我们开始踏上搭建Appi ...

  2. Appium+Python3+iOS定位元素

    前言: 最近在做IOS自动化测试,IOS的Appium环境都配置OK,执行起来真的慢,慢到怀疑人生,那么今天就来总结一下IOS定位方式和各个定位方式的速度排序. 据我观察,按查找元素的顺序速度,从快到 ...

  3. Appium自动化测试-iOS

    Appium的哲学 我们相信,对原生应用的自动化测试,应当不必要包含其他的SDK组件或者特别编译您的App,并且应当可以选择任何您喜欢的测试方法,框架和工具.基于这些出发点我们开发了Appium.现在 ...

  4. 使用Appium进行iOS的真机自动化测试

    windows不支持appium连接ios,只适用于mac 使用Appium进行iOS的真机自动化测试 安装类库 Homebrew 如果没有安装过Homebrew,先安装[ homebrew ] np ...

  5. Appium for iOS setup

    windows下appium设置 之前研究了一段时间的appium for native app 相应的总结如下:                                           ...

  6. 使用appium进行ios测试,启动inspector时遇到的问题(一)

    最近在公司,让做ios的自动化测试,因为以前做过android的自动化测试,用的也是appium,觉得没什么,结果一开始在搭建环境就遇到了很多的问题,现在将我遇到的问题,以及解决方法,给大家分享出来. ...

  7. 【转】NO.2、Appium之IOS第一个demo

    接第一篇:Appium之iOS环境搭建 http://blog.csdn.net/clean_water/article/details/52946191 这个实例继承了unittest,重写了它的s ...

  8. Appium移动自动化配置-ios&安卓

    官网安装参考:https://www.npmjs.com/package/appium Appium安装 1.安装nodejs 2.安装appium iOS侧环境安装 1.安装xcode 2.安装Xc ...

  9. Appium for IOS testing on Mac

    一:环境 1.Mac OS X 10.9.1 2.Xcod 5.0.2 3.Appium 1.3.6 下载地址:https://bitbucket.org/appium/appium.app/down ...

随机推荐

  1. sqlServer杂计

    In与Exists的区别 这两个函数是差不多的,但由于优化方案不同,通常NOT Exists要比NOT IN要快,因为NOT EXISTS可以使用结合算法二NOT IN就不行了,而EXISTS则不如I ...

  2. N天学习一个linux命令之ssh-keygen

    用途 生成ssh加密算法需要使用到的秘钥以及管理和转换 用法 ssh-keygen [-q] [-b bits] -t type [-N new_passphrase] [-C comment] [- ...

  3. v$open_cursor的几个问题

    SQL order by SADDR desc ; SADDR SID USER ADDRESS HASH_VALUE SQL_ID SQL_TEXT -------- ---------- ---- ...

  4. Android:阻止输入法将图片压缩变形

    Scrollview定义中添加一行: android:isScrollContainer="false"

  5. STL在迭代的过程中,删除指定的元素

    直接上Code,上 Picture #include <iostream> #include <list> using namespace std; // STL在迭代的过程中 ...

  6. Android中检測字符编码(GB2312,ASCII,UTF8,UNICODE,TOTAL——ENCODINGS)方法(一)

    package com.android.filebrowser;   import java.io.*; import java.net.*;   public class FileEncodingD ...

  7. 我对ThreadLocal的理解

    声明:小弟菜狗一个.对ThreadLocal的描写叙述和理解难免有所偏差 近期由于须要深入的了解android的handler消息机制而去查看了Looper的源代码.众所周知在主线程中是不须要在程序猿 ...

  8. 在Win7中修改 系统盘中 “系统” - “用户” 的环境变量映射关系

    1.在此列表中,选中对应登录帐号 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList 2.将Prof ...

  9. 关于sublime代码格式化

    就我接触到的,html,css,js,json,php语言来介绍. html,css,json,js这些,我感觉pretty是比较好用的,ctrl+shift+h快捷键,给人不一样的感受,不过这个插件 ...

  10. angular2之pdf文件操作大全

    最近的项目中需要显示pdf内容.下载pdf.甚至是前端生成pdf 适用于angular2.4或者更高版本 情景1.需要将页面的某个部分转成pdf文件并下载(即将页面的部分html内容转成pdf文件) ...