有问题请回复
配置文件参考
---
pluginList:
- "com.testerhome.appcrawler.plugin.FlowDiff"
#- "com.testerhome.appcrawler.plugin.ProxyPlugin"
logLevel: "TRACE"
saveScreen: true
showCancel: true
reportTitle: AppCrawler雪球内部版
screenshotTimeout: 20
tagLimitMax: 2
currentDriver: "android"
maxTime: 10800
resultDir: ""
capability:
newCommandTimeout: 120
launchTimeout: 120000
platformVersion: ""
platformName: ""
autoWebview: "false"
autoLaunch: "true"
noReset: "false"
androidCapability:
deviceName: "demo"
appPackage: "com.xueqiu.android"
appActivity: ".view.WelcomeActivityAlias"
app: ""
appium: "http://127.0.0.1:4723/wd/hub"
fullReset: false
noReset: true
automationName: uiautomator2
iosCapability:
deviceName: "iPhone 7 Plus"
bundleId: "com.xueqiu"
screenshotWaitTimeout: "10"
platformVersion: "10.2"
autoAcceptAlerts: "true"
automationName: xcuitest
app: "/Users/seveniruby/Library/Developer/Xcode/DerivedData/Snowball-ckpjegabufjxgxfeqyxgkmjuwmct/Build/Products/Debug-iphonesimulator/Snowball.app"
appium: "http://127.0.0.1:4723/wd/hub"
defineUrl:
- "//*[@selected='true']/@text"
- "//*[@selected='true']/@text"
- "//*[contains(name(), 'NavigationBar')]/@label"
baseUrl:
- ".*MainActivity"
- ".*SNBHomeView.*"
maxDepth: 8
headFirst: true
enterWebView: true
urlBlackList:
- ".*球友.*"
- ".*png.*"
- ".*Talk.*"
- ".*Chat.*"
- ".*Safari.*"
- "WriteStatus.*"
- "Browser.*"
- "MyselfUser"
- ".*MyselfUser.*"
- ".*股市直播.*"
#urlWhiteList:
#- ".*Main.*"
backButton:
- //*[@resource-id='action_back']
- //*[@resource-id='android:id/up']
- //*[@resource-id='android:id/home']
- //*[@resource-id='android:id/action_bar_title']
- //*[@name='nav_icon_back']
- //*[@name='Back']
- //*[@name='返回']
- "//*[contains(name(), 'Button') and @name='取消']"
- "//*[contains(name(), 'Button') and @label='返回']"
- "//*[contains(name(), 'Button') and @name='关闭']"
- "//*[contains(name(), 'Button') and @name='首页']"
firstList:
- "//*[contains(name(), 'Popover')]//*"
- "//*[contains(name(), 'Window')][3]//*"
- "//*[contains(name(), 'Window')][2]//*"
selectedList:
#android非空标签
- //*[@clickable="true"]//android.widget.TextView[string-length(@text)>0 and string-length(@text)<20]
- //android.widget.EditText
#ios
- //*[contains(name(), 'Text') and string-length(@value)>0 and string-length(@value)<20 ]
#通用的button和image
- //*[contains(name(), 'Button')]
- //*[contains(name(), 'Image')]
#todo:如果多个规则都包含相同控件, 如何排序
#处于选中状态的同级控件最后点击
lastList:
- //*[contains(@resource-id, 'header')]//*
- //*[contains(@resource-id, 'indicator')]//*
#股票 组合
- //*[../*[@selected='true']]
#港股 美股
- //*[../../*/*[@selected='true'] and @resource-id='']
#tab标签
- //*[../../*/*[@selected='true'] and contains(@resource-id, 'tab_')]
#ios 沪深 港股等栏目
- //*[../*[@value='1']]
#ios 底层tab栏
- //*[contains(name(), 'Button') and ../*[contains(name(), 'Button') and @value='1']]
#tab低栏
- //*[contains(@resource-id,'tabs')]//*
blackList:
- //*[contains(name(), 'TextField')]
- //*[contains(name(), 'EditText')]
#排除掉ios的状态栏
- "//*[contains(name(), 'StatusBar')]//*"
#股票分组编辑. 同一个imageview有2个图代表不同的状态. 没法区分, 只能设置为黑名单
- //*[@resource-id='com.xueqiu.android:id/edit_group']
- ".*Safari"
- ".*电话.*"
- ".*Safari.*"
- "发布"
- "action_bar_title"
- ".*浏览器.*"
- "message"
- ".*home"
- "首页"
- "Photos"
- "地址"
- "网址"
- "拉黑"
- "举报"
- "camera"
- "Camera"
- "nav_icon_home"
- "stock_item_.*"
- ".*[0-9]{2}.*"
- "发送"
- "保存"
- "确定"
- "up"
- "user_profile_icon"
- "selectAll"
- "cut"
- "copy"
- "send"
- "买[0-9]*"
- "卖[0-9]*"
- "聊天.*"
- "拍照.*"
- "发表.*"
- "回复.*"
- "加入.*"
- "赞助.*"
- "微博.*"
- "球友.*"
- ".*开户.*"
triggerActions:
- xpath: "//*[contains(@resource-id, 'iv_close')]"
- xpath: "//*[@resource-id='com.xueqiu.android:id/button_login']"
times: 1
- action: "15600534760"
xpath: "//*[@resource-id='com.xueqiu.android:id/login_account']"
times: 1
- xpath: "//*[@resource-id='com.xueqiu.android:id/login_account']"
times: 1
- action: "hys2xueqiu"
xpath: "//*[@resource-id='com.xueqiu.android:id/login_password']"
times: 1
- xpath: "button_next"
times: 1
- action: "15600534760"
xpath: "//*[contains(name(), 'StaticText') and contains(@name, '登录')]"
times: 1
- action: "15600534760"
xpath: "//*[contains(name(), 'TextField') and contains(@value, '手机')]"
times: 1
- action: "hys2xueqiu"
xpath: "//*[contains(name(), 'SecureTextField')]"
times: 1
- xpath: "//*[contains(name(), 'Button') and contains(@name, '登 录')]"
times: 1
- xpath: ".*立即登录"
times: 2
- xpath: "//*[@name='登 录']"
times: 2
- xpath: "//*[@name='登录']"
times: 2
- action: "scroll left"
xpath: "专题"
times: 1
- xpath: "点此.*"
- xpath: "^放弃$"
- xpath: "不保存"
- xpath: "^确定$"
- xpath: "^关闭$"
- xpath: "^取消$"
- xpath: "稍后再说"
- xpath: "Cancel"
- xpath: "这里可以.*"
- xpath: ".*搬到这里.*"
- xpath: "我要退出"
- xpath: "tip_click_position"
- xpath: "common guide icon ok"
- xpath: "icon quotationinformation day"
times: 1
- xpath: "icon stock close"
- xpath: "隐藏键盘"
#一个神奇的符号
- xpath: //*[@label='✕' and visible='true']
times: 10
- action: 123
xpath: //*[contains(name(), "EditText")]
times: 10
pri: 0
- xpath: 我知道了
tagLimit:
- xpath: //*[../*[@selected='true']]
count: 12
- xpath: //*[../../*/*[@selected='true']]
count: 12
作业
遍历自己公司的app,或者雪球。保证所有的菜单被遍历到,在tagLimitMax=2的情况下尽量遍历足够多的页面。