标签:开启 相机 网盘 efault 运行时 cti 用户交互 image 遇到
---
logLevel: "TRACE"
reportTitle: "Jingdata" #指生成的HTML(index.html)报告头部显示的标题信息
saveScreen: true
screenshotTimeout: 20
currentDriver: "android"
showCancel: true
tagLimitMax: 5
tagLimit:
- xpath: //*[../*[@selected=‘true‘]]
count: 12
maxTime: 10800
resultDir: "" #结果文件夹名,给定后,将不动态命名
capability:
newCommandTimeout: 120
launchTimeout: 120000
platformVersion: ""
platformName: "Android"
autoWebview: "false"
autoLaunch: "true"
noReset: "true"
androidInstallTimeout: 180000
androidCapability:
deviceName: ""
appPackage: "com.android36kr.investment"
appActivity: "" #写不写无所谓,因为APP会自动判别当前的activity是否正确,是不是launchActivity,如果不是则会报错
dontStopAppOnReset: true
app: ""
appium: "http://127.0.0.1:4723/wd/hub"
# automationName: uiautomator2
automationName: uiautomator2
reuse: 3
headFirst: true
enterWebView: true
urlBlackList:
- //*[contains(@resource-id, "tv_setting_logout") and @clickable=‘true‘] #登出
- //*[contains(@resource-id, "toolbar_close") and @clickable=‘true‘] # 关闭按钮,否则会陷入死循环一直遍历同一个页面
- //*[contains(@resource-id, "login_36kr_forgot_pass") and @clickable=‘true‘] # 忘记密码,避免登陆时按照遍历顺序影响登陆
- //*[contains(@resource-id, "mine_info_icon") and @clickable=‘true] # 我的资料 头像部分设置不可点击(每次一运行到这里就结束了)
- //*[contains(@resource-id, "tv_name") and @clickable=‘true] #头部卡片 姓名
- //*[contains(@resource-id, "tv_company_name") and @clickable=‘true] # 头部卡片 公司和职位
- //*[contains(@resource-id, "company_avatar") and @clickable=‘true] # 头部 禁止进入我的资料页面
- //*[contains(@resource-id, "chat_invest_card_rl") and @clickable=‘true] # 聊天页的项目头部,避免又进入详情页,跳出了循环
- //*[contains(@resource-id, "chat_send_contact_ll") and @clickable=‘true] #聊天详情页,交换名片,避免遍历线上包时与线上用户交互
- //*[contains(@resource-id, "ll_header") and @clickable=‘true] # 我的资料头像部分的整个头部区域,因为一点击头像后唤起照相就不运行了
urlWhiteList:
- //*[contains(@resource-id, "login_36kr_ll") and @clickable=‘true‘] #必须遍历账号密码登录的按钮(以此方式才能登录成功)
- //*[contains(@resource-id, "fl_msg") and @clickable=‘true‘] #右上角的私信按钮
- //*[contains(@resource-id, "iv_setting") and @clickable=‘true‘] # 左上角的设置按钮
backButton:
- //*[contains(@resource-id, "toolbar_back") and @clickable=‘true‘]
triggerActions: # 主要解决登录的问题,当遇到登录输入框时,输入内容,比testcase更好用
- action: "1771019****"
xpath: "//*[@resource-id=‘com.android36kr.investment:id/login_36kr_phone_edit‘]"
times: 1
- action: "123456"
xpath: "//*[@resource-id=‘com.android36kr.investment:id/login_36kr_pass_code‘]"
times: 1
- action: "click"
xpath: "//*[@resource-id=‘com.android36kr.investment:id/login_36kr_go_btn‘]"
times: 1
- action: "swipe("down")"
xpath: "//*[@resource-id=‘com.android36kr.investment:id/share‘]"
times: 1
startupActions:
- swipe("left")
- println(driver)
testcase:
name: swipeTest
steps:
- when:
xpath: //*[contains(@resource-id, ‘share‘)]
action: driver.swipe(0.5,0.8,0.5,0.2)
then: []
1、java -jar appcrawler-2.1.0.jar --capability appPackage=xxxxxx,appActivity=xxxxxx
2、appium --session-override:4:10,配置文件说明:11:00(看视频主要地方)
3、配置文件使用:true和false是开启和关闭的意思
logLevel:日志级别
saveScreen:是否截图
reportTitle:报告名字
screenshotTimeout:屏幕超时时间
currentDriver:当前设备(Android/iOS)
resultDir:结果文件夹名,给定后,将不动态命名
tagLimitMax:ios的元素tag控制
tagLimit:给tag
maxTime:最大运行时间
showCancel:应该是控制是否展示注释
capability:用于配置appium
androidCapability:Android专属配置,最后会和capability合并
iosCapability:iOS专属配置
urlWhiteList/blackList:白名单/黑名单
xpathAttributes:用来设定可以用那些种类型去定位控件
defineUrl:用来确定url的元素定位xpath 他的text会被取出当作url因素(没理解)
baseUrl:设置一个起始url和maxDepth, 用来在遍历时候指定初始状态和遍历深度
maxDepth:默认的最大深度10, 结合baseUrl可很好的控制遍历的范围
appWhiteList:app白名单,如果跳转到其他app,需要设定规则,是否允许停留在次app中
headFirst:是否是前向遍历或者后向遍历
enterWebView:是否遍历WebView控件
urlBlackList:url黑名单.用于排除某些页面
urlWhiteList:url白名单, 第一次进入了白名单的范围, 就始终在白名单中. 不然就算不在白名单中也得遍历.
上层是白名单, 当前不是白名单才需要返回
defaultBackAction:默认的返回动作(没看到例子,貌似不特指的话,是click)
backButton:给一些返回控件,用于返回动作使用
firstList:优先遍历元素
selectedList:默认遍历列表,如果不是指定的类型,而是确定控件,会分别点击控件
lastList:最后遍历的元素
blackList:排除某些控件
triggerActions:制定规则(action、xpath、times)
autoCrawl:自动抓取,看源码指定true后运行crawl(conf.maxDepth)命令
(crawl——清空堆栈 开始重新计数)应该是appcrawler的主要方法
asserts:断言,用于是否失败的判断
testcase:测试用例,看appcrawler日志,每次都是首先运行用例才会往下执行
beforeElementAction:貌似没什么人用,字面意思在元素动作之前
afterElementAction:与beforeElementAction的待遇差不多
afterUrlFinished:也是很冷门的待遇
monkeyEvents:monkey的点击数
monkeyRunTimeSeconds:monkey运行时间
given是条件 或输入 when是触发条件和动作 then是断言
4、一次ctrl+c生成报告,两次ctrl+c是强行退出
5、终端输入Scala进入Scala解释器,输入:q或:quit退出解释器
6、遍历的深度应该怎么设置好,总是跳到其它页面,就回不到当前页面继续遍历了,看文档 通过黑白名单
7、设置一个起始url和maxDepth, 用来在遍历时候指定初始状态和遍历深度
四. 遇到的问题有哪些?如何解决
标签:开启 相机 网盘 efault 运行时 cti 用户交互 image 遇到
原文地址:http://www.cnblogs.com/alwayswyy/p/7576964.html