AppCrawler AppCrawler 自动遍历工具 2.1.1 版本发布

思寒_seveniruby · October 16, 2017 · Last by taozitao replied at March 12, 2019 · 6769 hits

这只是一个临时的针对appium1.7.1的适配版本。因为appium最近的几个版本更改了api,所以做个适配。

文档

文档和代码都更新到了github。 https://github.com/seveniruby/AppCrawler
因为有同学提到不能适配appium1.7.1,所以我先修复了适配问题。
经过测试已经可以跑在appium 1.7.1上了。

配置文件模板: https://github.com/seveniruby/AppCrawler/blob/master/src/test/scala/com/testerhome/appcrawler/it/xueqiu_private.yml
自动生成代码的功能暂时不要用,最近还在改进中

下载地址

百度网盘: https://pan.baidu.com/s/1bpmR3eJ
超过一百兆github上没法放了

历史版本: AppCrawler 自动遍历工具 2.0 版本发布

基本用法

----------------
AppCrawler 2.1.1 [霍格沃兹测试学院特别纪念版]
app爬虫, 用于自动遍历测试. 支持AndroidiOS, 支持真机和模拟器
帮助文档: http://seveniruby.gitbooks.io/appcrawler
移动测试技术交流: https://testerhome.com
感谢: 晓光 泉龙 杨榕 恒温 mikezhou yaming116 沐木
感谢如下公司提供商业支持: Keep
--------------------------------


Usage: appcrawler [options]

-a, --app <value> Android或者iOS的文件地址, 可以是网络地址, 赋值给appiumapp选项
-c, --conf <value> 配置文件地址
-p, --platform <value> 平台类型android或者ios, 默认会根据app后缀名自动判断
-t, --maxTime <value> 最大运行时间. 单位为秒. 超过此值会退出. 默认最长运行3个小时
-u, --appium <value> appiumurl地址
-o, --output <value> 遍历结果的保存目录. 里面会存放遍历生成的截图, 思维导图和日志
--capability k1=v1,k2=v2...
appium capability选项, 这个参数会覆盖-c指定的配置模板参数, 用于在模板配置之上的参数微调
-r, --report <value> 输出htmlxml报告
--template <value> 输出代码模板
--master <value> masterdiff.yml文件地址
--candidate <value> candidate环境的diff.yml文件
--diff 执行diff对比
-vv, --verbose 是否展示更多debug信息
--demo 生成demo配置文件学习使用方法
--help
示例
appcrawler -a xueqiu.apk
appcrawler -a xueqiu.apk --capability noReset=true
appcrawler -c conf/xueqiu.json -p android -o result/
appcrawler -c xueqiu.json --capability udid=[你的udid] -a Snowball.app
appcrawler -c xueqiu.json -a Snowball.app -u 4730
appcrawler -c xueqiu.json -a Snowball.app -u http://127.0.0.1:4730/wd/hub

#生成demo例子
appcrawler --demo

#启动已经安装过的app
appcrawler --capability appPackage=com.xueqiu.android,appActivity=.welcomeActivity

#从已经结束的结果中重新生成报告
appcrawler --report result/

#新老版本对比
appcrawler --candidate result/ --master pre/ --report ./

#自动生成Page Object代码模板文件
appcrawler --template PageObjectDemo.ssp --output result/

#根据wdainspector生成测试用例代码
appcrawler --template PageObjectDemo.ssp -u http://localhost:8100

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!
共收到 74 条回复 时间 点赞

有changelog 吗 ?

提供个yml配置文件的样本吧

现在新手好像回复不了贴了

tonglei 回复

没头像就回复不了,注册时间小于一天也回复不了。

测试是否能回复😂

7Floor has been deleted

@seveniruby 谢谢,看到了。。

<XCUIElementTypeOther type=\"XCUIElementTypeOther\" value=\"AX error -25205\" name=\"AX error -25205\" label=\"AX error -25205\" enabled=\"true\" visible=\"true\" x=\"0\" y=\"0\" width=\"320\" height=\"568\">

有一个新的问题,最新版的appium在IOS上获取的信息好奇怪啊,所有元素的name都是AX error -25205,请问你遇到么?

dengwei729 回复

问题已解决,wda的问题,xocde9目前只能用ios11设备跑

10Floor has been deleted

@seveniruby 提个bug

2017-10-19 17:58:53 WARN [AppiumClient.$anonfun$getPageSource$1.335] get page source error
2017-10-19 17:59:13 ERROR [AppiumClient.asyncTask.149] 20 seconds timeout
2017-10-19 17:59:13 WARN [AppiumClient.$anonfun$getPageSource$1.335] get page source error
2017-10-19 17:59:13 ERROR [Crawler.crawl.196] crawl not finish, return with exception
2017-10-19 17:59:13 ERROR [Crawler.crawl.197]
2017-10-19 17:59:13 ERROR [Crawler.crawl.198] NullPointerException:
2017-10-19 17:59:13 ERROR [Crawler.crawl.199]
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] java.lang.NullPointerException
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at scala.collection.immutable.StringOps$.length$extension(StringOps.scala:47)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at scala.collection.immutable.StringOps.length(StringOps.scala:47)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at scala.collection.IndexedSeqOptimized.isEmpty(IndexedSeqOptimized.scala:26)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at scala.collection.IndexedSeqOptimized.isEmpty$(IndexedSeqOptimized.scala:26)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at scala.collection.immutable.StringOps.isEmpty(StringOps.scala:29)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at scala.collection.TraversableOnce.nonEmpty(TraversableOnce.scala:111)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at scala.collection.TraversableOnce.nonEmpty$(TraversableOnce.scala:111)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at scala.collection.immutable.StringOps.nonEmpty(StringOps.scala:29)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at com.testerhome.appcrawler.Crawler.refreshPage(Crawler.scala:553)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at com.testerhome.appcrawler.Crawler.doElementAction(Crawler.scala:1048)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at com.testerhome.appcrawler.Crawler.crawl(Crawler.scala:809)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at com.testerhome.appcrawler.Crawler.$anonfun$crawl$1(Crawler.scala:173)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:12)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at scala.util.Try$.apply(Try.scala:209)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at com.testerhome.appcrawler.Crawler.crawl(Crawler.scala:173)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at com.testerhome.appcrawler.Crawler.start(Crawler.scala:157)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at com.testerhome.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:342)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:310)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:90)
2017-10-19 17:59:13 ERROR [Crawler.$anonfun$crawl$4.200] at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)

@seveniruby 发现一个bug,backButton在ios上始终不生效。
该问题block我们后续调研啦,辛苦优先修复一下哈

看代码发现,(设置ElementAction时机应该提前吧)

  • backButton 设置始终不生效,有bug: //判断是否需要返回上层 if (nextElement == None) { if (needReturn()) { log.info("need to back") nextElement = getBackButton() setElementAction("back") } else { log.info("no need to back") } }

back方法:


def back(): Unit = {
pluginClasses.foreach(_.beforeBack())
if (conf.currentDriver.toLowerCase == "android") {
if (backDistance.intervalMS() < 4000) {
log.warn("two back action too close")
Thread.sleep(4000)
}
driver.asyncTask() {
driver.back()
}
backDistance.append("back")
appNameRecord.pop()
} else {
log.warn("you should define you back button in the conf file")
}
}

用此工具执行了几次遍历,速度略慢。。对某些场景可能测不出来,有没有能提升执行速度的配置?谢谢。

牛蒡酱 回复

社区里有速度更快的遍历工具 基于uiautomator的 可以试试

请问楼主,测试app的时候遇到别的app有弹窗的话,会切换到别的app,这种情况能通过配置切换会测试app吗?

He Bin 回复

早就支持了。挑出会自动跳回的

多谢,是默认的功能还是需要自己配置?

想问一下,自己写了插件重新打包jar包,用sbt assembly就报错,上版本不会。这种情况请问怎么解决

AppCrawler-master/src/main/scala/com/testerhome/appcrawler/plugin/AndroidTrace.scala:3:16: object jdi is not a member of package com.sun
[error] import com.sun.jdi.event._
[error] ^

hulk 回复

新版本加了一些依赖. 用到了jdi接口. 你把tools.jar放到项目的lib目录下就可以了.

可以了,thx!

21Floor has been deleted

@seveniruby 您好,咨询个问题,我们app登录按钮是输入账号密码后才会亮显,所以我在action中调了下键盘使登录按钮亮显,然后再去点击,但是为什么老是会返回呢?

想用java利用uiautomator搞一个类似的。遇到一些问题,楼主可以给指导下吗?或者给点思路呢

思寒大神,当我APP里面 某些没有back的按钮时,我需要用设备物理按钮返回,可以通过这个yml配置么,好像没有相关说明呢。

战 神 回复

默认就是用back物理键返回。

好的!感谢回复 ,我再研究下!

@seveniruby 求教楼主,跑起来几分钟就提示如下错误,求解~🙏感谢!

lemon 回复

以前遇到过,是配置文件写的有问题,仅供参考

lemon 回复

yaml文件配置错了,看来我应该出个检查工具。

J-wade Li 回复

嗯,谢谢,应该是,不加配置文件,是可以跑起来的,正在检查配置文件中....

😜 出个配置说明文档吧,楼主~比如说某些参数的意义,具体含义是什么;某些操作的可选项,比如:

  • action: "scroll left" xpath: "专题" times: 1 是不是还有"scroll right/up/down"什么的

思寒大神,个人觉得 这个工具 ,是给比较了解Appium的同学用的,通用性还不够强,是否后续会出UI版本,让不会appium的同学也能很好的上手,让这个工具变得更加通用化呢?

战 神 回复

这个东西不是给新手用的。我自己目前还不是专业做这个,没法投入太多的时间。源代码我已经全部公开提供给大家参考了。如果未来我靠这个糊口可能会付出精力去做易用性的改造吧,短时间还是我的个人业余爱好和自动化工具,所以不会做UI的。目前的重点还是增加功能。

34Floor has been deleted

请问有没有同学遇到这种情况,跑了一段时间后读取文件出错抛异常退出

2017-12-21 21:16:42 INFO [AppiumClient.mark.245] read from Android_20171221211126/67_com.aa365-PluginNormalThemeActivity_pay_panel-revenue_panel-revenue_panel_view-若下单:-tv_addOrder.clicked.png
2017-12-21 21:16:42 ERROR [Crawler.crawl.203] crawl not finish, return with exception
2017-12-21 21:16:42 ERROR [Crawler.crawl.204] Can't read input file!
2017-12-21 21:16:42 ERROR [Crawler.crawl.205] IIOException: Can't read input file!

然后appcrawler重启一个session,但是报错,appium启动时已经设置session覆盖。
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created. (Original error: No app set; either start appium with --app or pass in an 'app' value in desired capabilities, or set androidPackage to launch pre-existing app on device) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 1.10 seconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'BIH-D-6313', ip: '169.254.60.58', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_141'
Driver info: driver.version: AndroidDriver

@seveniruby 请问思寒,这是因为图片没有下载下来,读取错误么

36Floor has been deleted

@seveniruby 思寒,问个问题,使用过程发现,大于appcrawler2.1.0版本,Jenkins执行后会报错,导致不能执行后面的操作了,2.1.0版本就正常。应该是不同版本的返回值导致的。
报错信息:
2018-01-05 16:01:13 INFO [FreeMind.stop.17] genereate freemind file freemind.mm
2018-01-05 16:01:13 INFO [Crawler.stop.1156] generate report finish
Build step 'Execute shell' marked build as failure

勇少 回复

用2.1.3版本试试吧,那个版本我没发到社区介绍。另外一个是执行的时候 你可以用 ||: 语法屏蔽错误信号,这是shell技巧

请问,appCrawler的代码我用eclispe for scala工具导入不了是什么原因?

求助,最近跑完测试后生成的 index.html 没有包含测试的内容,如下图所示,但其实执行了操作

rabbitTUTU 回复

看最后输出的日志,通常是异常导致的

思寒,我想在遍历的时候做一些校验,例如点击按钮后,校验是否正确跳转到,所以校验点击后页面是否包含某个元素。因为遍历结果有很多的截图,需要人工查看是否正确,加上验证点直接报异常,容易查看。

勇少 回复

本来就支持,工具设计的时候我就想好这种场景了,配置里面有asserts功能。怕工具介绍太复杂,所以没对外说。你可以去翻翻这个配置和对应的代码。

我查看了,你的写法是这样的。但试了不生效,执行后没有Fail的报错,是我搞错什么了吗?

思寒大大 能抽空对yaml配置文件添加一些描述吗 看您的模板有些不明白 感谢!😀


请问这是怎么回事?

2018-04-17 19:29:47 INFO [AppCrawler$.parseParams.219] Set Platform=Android
2018-04-17 19:29:47 INFO [AppCrawler$.parseParams.234] app path = /Users/liming/Desktop/apk/app-easylive-debug.apk
2018-04-17 19:29:47 INFO [AppCrawler$.parseParams.245] use default appium address 4723
2018-04-17 19:29:47 INFO [AppCrawler$.parseParams.252] appium address = Some(http://127.0.0.1:4723/wd/hub)
2018-04-17 19:29:47 INFO [AppCrawler$.parseParams.264] result directory = Android_20180417192947
2018-04-17 19:29:48 INFO [DataRecord.initLog.30] alread exist
2018-04-17 19:29:48 INFO [DataRecord.append.13] append 1
2018-04-17 19:29:48 INFO [Crawler.start.126] set xpath attribute with List(name, label, value, resource-id, content-desc, index, text)
2018-04-17 19:29:48 INFO [Crawler.start.129] set xpath
2018-04-17 19:29:48 INFO [Crawler.loadPlugins.82] dynamic load plugin in /Users/liming/Downloads/appcrawler%e8%b5%84%e6%ba%90/plugins/
2018-04-17 19:29:50 WARN [Runtimes$.loadPlugins.83] no /Users/liming/Downloads/appcrawler%e8%b5%84%e6%ba%90/plugins/ directory, skip
2018-04-17 19:29:50 INFO [Crawler.loadPlugins.84] found dynamic plugins size 0
2018-04-17 19:29:50 INFO [Crawler.$anonfun$loadPlugins$5.86] com.testerhome.appcrawler.plugin.TagLimitPlugin@79e66b2f
2018-04-17 19:29:50 INFO [Crawler.$anonfun$loadPlugins$5.86] com.testerhome.appcrawler.plugin.ReportPlugin@7544ac86
2018-04-17 19:29:50 INFO [Crawler.$anonfun$loadPlugins$5.86] com.testerhome.appcrawler.plugin.FreeMind@b1534d3
2018-04-17 19:29:50 INFO [TagLimitPlugin.init.17] com.testerhome.appcrawler.plugin.TagLimitPlugin init
2018-04-17 19:29:50 INFO [ReportPlugin.init.17] com.testerhome.appcrawler.plugin.ReportPlugin init
2018-04-17 19:29:50 INFO [FreeMind.init.17] com.testerhome.appcrawler.plugin.FreeMind init
2018-04-17 19:29:50 INFO [ReportPlugin.start.21] reportPath=/Users/liming/Downloads/appcrawler资源/Android_20180417192947
2018-04-17 19:29:50 INFO [ReportPlugin.start.24] create /Users/liming/Downloads/appcrawler资源/Android_20180417192947/tmp/ directory
2018-04-17 19:29:50 INFO [Crawler.start.132] prepare setup Appium
2018-04-17 19:29:50 INFO [Crawler.setupAppium.262] use AppiumClient
Exception in thread "main" org.openqa.selenium.WebDriverException: Connection refused (Connection refused)
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'bogon', ip: 'fe80:0:0:0:893:bcc0:8356:6df2%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.3', java.version: '1.8.0_131'
Driver info: driver.version: AndroidDriver
at io.appium.java_client.remote.AppiumCommandExecutor.lambda$2(AppiumCommandExecutor.java:101)
at java.util.Optional.orElseGet(Optional.java:267)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:100)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:586)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:217)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:140)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:83)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:93)
at io.appium.java_client.android.AndroidDriver.(AndroidDriver.java:72)
at com.testerhome.appcrawler.driver.AppiumClient.appium(AppiumClient.scala:163)
at com.testerhome.appcrawler.driver.AppiumClient.(AppiumClient.scala:39)
at com.testerhome.appcrawler.Crawler.setupAppium(Crawler.scala:263)
at com.testerhome.appcrawler.Crawler.start(Crawler.scala:133)
at com.testerhome.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:344)
at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:312)
at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:92)
at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)
Caused by: java.net.ConnectException: Connection refused (Connection refused)
at java.net.PlainSocketImpl.socketConnect(Native Method)
at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)
at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)
at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)
at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
at java.net.Socket.connect(Socket.java:589)
at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:75)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:142)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56)
at org.openqa.selenium.remote.internal.ApacheHttpClient.fallBackExecute(ApacheHttpClient.java:138)
at org.openqa.selenium.remote.internal.ApacheHttpClient.execute(ApacheHttpClient.java:86)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:337)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:136)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89)
... 18 more

appcrawler-2.1.3无法运行

嗨,我装的appcrawler的版本是2.1.3,同时我装了两种方式的appium(dmg1.5.3和终端的v1.7。2),xcode的版本是8,可我在每次运行appcrawler的时候显示的log如下:--------------------------------

2018-04-23 18:41:20 INFO [AppCrawler$.parseParams.219] Set Platform=iOS
2018-04-23 18:41:20 INFO [AppCrawler$.parsePath.336] use app in the config file
2018-04-23 18:41:20 INFO [AppCrawler$.parseParams.234] app path =
2018-04-23 18:41:20 INFO [AppCrawler$.parseParams.245] use default appium address 4723
2018-04-23 18:41:20 INFO [AppCrawler$.parseParams.252] appium address = Some(http://127.0.0.1:4723/wd/hub)
2018-04-23 18:41:20 INFO [AppCrawler$.parseParams.264] result directory = iOS_20180423184120
2018-04-23 18:41:21 INFO [DataRecord.initLog.30] alread exist
2018-04-23 18:41:21 INFO [DataRecord.append.13] append 1
2018-04-23 18:41:21 INFO [Crawler.start.126] set xpath attribute with List(name, label, value, resource-id, content-desc, index, text)
2018-04-23 18:41:21 INFO [Crawler.start.129] set xpath
2018-04-23 18:41:21 INFO [Crawler.loadPlugins.82] dynamic load plugin in /Users/chenxiangxiang/Desktop/plugins/
2018-04-23 18:41:23 WARN [Runtimes$.loadPlugins.83] no /Users/chenxiangxiang/Desktop/plugins/ directory, skip
2018-04-23 18:41:23 INFO [Crawler.loadPlugins.84] found dynamic plugins size 0
2018-04-23 18:41:23 INFO [Crawler.$anonfun$loadPlugins$5.86] com.testerhome.appcrawler.plugin.TagLimitPlugin@254f906e
2018-04-23 18:41:23 INFO [Crawler.$anonfun$loadPlugins$5.86] com.testerhome.appcrawler.plugin.ReportPlugin@1f346ad2
2018-04-23 18:41:23 INFO [Crawler.$anonfun$loadPlugins$5.86] com.testerhome.appcrawler.plugin.FreeMind@7ab34619
2018-04-23 18:41:23 INFO [TagLimitPlugin.init.17] com.testerhome.appcrawler.plugin.TagLimitPlugin init
2018-04-23 18:41:23 INFO [ReportPlugin.init.17] com.testerhome.appcrawler.plugin.ReportPlugin init
2018-04-23 18:41:23 INFO [FreeMind.init.17] com.testerhome.appcrawler.plugin.FreeMind init
2018-04-23 18:41:23 INFO [ReportPlugin.start.21] reportPath=/Users/chenxiangxiang/Desktop/iOS_20180423184120
2018-04-23 18:41:23 INFO [ReportPlugin.start.24] create /Users/chenxiangxiang/Desktop/iOS_20180423184120/tmp/ directory
2018-04-23 18:41:23 INFO [Crawler.start.132] prepare setup Appium
2018-04-23 18:41:23 INFO [Crawler.setupAppium.262] use AppiumClient
Exception in thread "main" org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: The desired capabilities must include either an app or a bundleId for iOS (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 271 milliseconds
Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
System info: host: 'chenxiangxiangdeMacBook-Pro.local', ip: 'fe80:0:0:0:cf2:54c7:f6ad:a394%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.12.2', java.version: '1.8.0_151'
Driver info: driver.version: IOSDriver
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:214)
at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:166)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$new$0(JsonWireProtocolResponse.java:53)
at org.openqa.selenium.remote.JsonWireProtocolResponse.lambda$getResponseFunction$2(JsonWireProtocolResponse.java:91)
at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$24(ProtocolHandshake.java:359)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.java:126)
at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java:498)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:471)
at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:362)
at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandshake.java:136)
at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:142)
at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandExecutor.java:89)
at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:586)
at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMobileDriver.java:42)
at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
at io.appium.java_client.ios.IOSDriver.execute(IOSDriver.java:1)
at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.java:217)
at org.openqa.selenium.remote.RemoteWebDriver.(RemoteWebDriver.java:140)
at io.appium.java_client.DefaultGenericMobileDriver.(DefaultGenericMobileDriver.java:38)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:83)
at io.appium.java_client.AppiumDriver.(AppiumDriver.java:93)
at io.appium.java_client.ios.IOSDriver.(IOSDriver.java:78)
at com.testerhome.appcrawler.driver.AppiumClient.appium(AppiumClient.scala:166)
at com.testerhome.appcrawler.driver.AppiumClient.(AppiumClient.scala:39)
at com.testerhome.appcrawler.Crawler.setupAppium(Crawler.scala:263)
at com.testerhome.appcrawler.Crawler.start(Crawler.scala:133)
at com.testerhome.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:344)
at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:312)
at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:92)
at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)

我觉得应该是appium就没起来。我实际想用的是终端的appium,我以为我在终端上运行了appium就默认使用了它,实际没有。。。我看log上显示的是use appiumclient,

问题1:我现在要怎么去设置才能解决这个问题呢。

问题2:我是ios真机运行,手机上已经装了app,包名的后缀是.ipa,可是我发现他总是提示找不到。这个我又要怎么设置呢

appcrawler的群加不了。 715测试大会 那时候还没入行呢- -

mac os x:10.13.4
Xcode: 9.2
执行命令:java -jar appcrawler_2.1.3.jar -a xxx.ipa
报错:
2018-05-03 10:43:34 INFO [Crawler.setupAppium.262] use AppiumClient
Exception in thread "main" org.openqa.selenium.SessionNotCreatedException: A new session could not be created. Details: Appium's IosDriver does not support xcode version 9.2. Apple has deprecated UIAutomation. Use the "XCUITest" automationName capability instead. (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 199 milliseconds

不想重新装回xcode 8,不知道楼主修改下jar包desired capabilities参数,配置为XCUITest是否可行?其他朋友有遇到过此问题的吗?求解~

社区里有速度更快的遍历工具 基于uiautomator的 可以试试
------能说一下这个遍历工具是什么吗

lemon 回复

capability中加上这个automationName: XCUITest参数

王薇 回复

@seveniruby 思寒大神,我也想问这个——社区里基于uiaotumator的遍历工具

@seveniruby 我在ubuntu上运行起来,找了一个京东的apk测试,挺容易报错退出的。
感觉遍历测试开发和完善工作量挺大的。

@seveniruby 请问,有没有介绍AppCrawler代码架构方面的文档,我想深入学习一下

使用2.1.3版本的jar包,android端,操作一段时间后,卡在一个页面不动了

@seveniruby 请问配置文件中怎么配置能让它上下滑动,还有就是本身就是xpath的路径在这里怎么用xpath表达,如我的xpath路径是: //android.support.v7.widget.RecyclerView[@resource-id='xx:xx:xx:id/rv_images']/android.widget.ImageView[1]]

lemon 回复

您好,请问解决了吗,我遇到和你一样的问题,Xcode9.2,ios10.3 ,appium 1.7.2,各路大神帮帮忙,非常感谢
capability中加上这个automationName: XCUITest参数,仍然报错

@seveniruby 思寒大神,我每次跑都报这个错,用json格式的配置文件就没问题,appium1.7.2:

我问个问题啊,这个跑完后的结果报告里的Duration字段里的时间具体指什么?

请教下,在查找app元素时出现 nullpoint异常 是什么情况,核对过id那些都有的,就是启动查找时异常,然后crawler就暂停了

当时的日志如下,能看看是怎么回事吗?

似乎不能上传文件。。。

执行android,报错了,获取不到页面元素

2018-09-15 14:11:32 WARN [AppiumClient.$anonfun$getPageSource$1.340] get page source error
2018-09-15 14:11:32 WARN [Crawler.refreshPage.562] page source get fail, go back
2018-09-15 14:11:32 INFO [Crawler.setElementAction.660] set action to back
2018-09-15 14:11:32 INFO [Crawler.runStartupScript.236] first refresh
2018-09-15 14:11:32 INFO [Crawler.doElementAction.976] current element = _startupActions-Start-0
2018-09-15 14:11:32 INFO [Crawler.doElementAction.977] current index = 0
2018-09-15 14:11:32 INFO [Crawler.doElementAction.978] current action =
2018-09-15 14:11:32 INFO [Crawler.doElementAction.979] current url =
2018-09-15 14:11:32 INFO [Crawler.doElementAction.980] current xpath = startupActions-Start-0
2018-09-15 14:11:32 INFO [Crawler.doElementAction.981] current tag path = _startupActions-Start-0
2018-09-15 14:11:32 INFO [Crawler.doElementAction.982] current file name = _
2018-09-15 14:11:32 INFO [Crawler.doElementAction.983] current uri = startupActions-Start-0 startupActions
Exception in thread "main" java.util.NoSuchElementException: last of empty ListBuffer
at scala.collection.mutable.ListBuffer.last(ListBuffer.scala:401)
at com.testerhome.appcrawler.DataRecord.last(DataRecord.scala:40)
at com.testerhome.appcrawler.Crawler.doElementAction(Crawler.scala:985)
at com.testerhome.appcrawler.Crawler.runStartupScript(Crawler.scala:238)
at com.testerhome.appcrawler.Crawler.start(Crawler.scala:152)
at com.testerhome.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:344)
at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:312)
at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:92)
at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)

[HTTP] <-- POST /wd/hub/session/74fdb256-4956-44db-a632-e8e85437d963/execute/sync 405 10 ms - 3527
[HTTP]
[debug] [AndroidBootstrap] Emitting alert message...
[debug] [AndroidBootstrap] [BOOTSTRAP LOG] [debug] Emitting system alert message

bala 回复

@zhangzhao_lenovo ,请问一下你的
A new session could not be created. Details: Appium's IosDriver does not support xcode version 9.2. Apple has deprecated UIAutomation. Use the "XCUITest" automationName capability instead.
这个问题解决了,要是解决了,可以帮忙共享一下解决方案吗?谢谢啦

下面是我的配置:
capability:
newCommandTimeout: 120
launchTimeout: 120000
platformVersion: ""
platformName: "iOS"
autoWebview: "false"
autoLaunch: "true"
noReset: "true"
androidInstallTimeout: 180000
iosCapability:
"deviceName": "iPhone X"
"platformVersion": "11.2"
"newCommandTimeout": "7200"
"automationName": "XCUITest"
appium: "http://127.0.0.1:4723/wd/hub"
"app": "/Users/maxiangsha/Downloads/debug.app"

@seveniruby
2018-10-25 11:07:59 INFO [Crawler.start.141] waiting for app load
2018-10-25 11:08:07 INFO [Crawler.start.143] driver=null
2018-10-25 11:08:07 INFO [Crawler.start.144] get screen info
2018-10-25 11:08:07 INFO [Crawler.refreshPage.554] refresh page
2018-10-25 11:08:07 WARN [Crawler.refreshPage.562] page source get fail, go back
2018-10-25 11:08:07 INFO [Crawler.setElementAction.660] set action to back
2018-10-25 11:08:07 INFO [Crawler.runStartupScript.236] first refresh
2018-10-25 11:08:07 INFO [Crawler.doElementAction.976] current element = _startupActions-Start-0
2018-10-25 11:08:07 INFO [Crawler.doElementAction.977] current index = 0
2018-10-25 11:08:07 INFO [Crawler.doElementAction.978] current action =
2018-10-25 11:08:07 INFO [Crawler.doElementAction.979] current url =
2018-10-25 11:08:07 INFO [Crawler.doElementAction.980] current xpath = startupActions-Start-0
2018-10-25 11:08:07 INFO [Crawler.doElementAction.981] current tag path = _startupActions-Start-0
2018-10-25 11:08:07 INFO [Crawler.doElementAction.982] current file name = _
2018-10-25 11:08:07 INFO [Crawler.doElementAction.983] current uri = startupActions-Start-0 startupActions

求问是因为appium 1.9.1不支持导致的吗?

@seveniruby 请问一下AppCrawler目前支持多apk的应用吗,有跨进程通信

@seveniruby 大神,启动app后,只在遍历元素,点击操作都没有生效,求帮助。用的是雪球apk以及相应配置模板;其他的测试apk也是一样;appium 版本1.8.1,appCrawler版本2.1.2

王希涛 回复

您好同学,我出现的问题跟你的一样,请问您这里解决了不, 跪求解决方法啊

王希涛 回复

2.5.0本周发布,大家可以试用下新版本,增加了更多调试信息

大神,本周啥时候发布啊,等着呢。

大神们,那个diff对比方面,怎么生成出来的报告没有获取到截图,如果需要获取截图该改哪一部分代码

王希涛 回复

您好 请问您的问题解决了吗 我这边出现

同样出现错误
Exception in thread "main" java.util.NoSuchElementException: last of empty ListBuffer
at scala.collection.mutable.ListBuffer.last(ListBuffer.scala:401)
at com.testerhome.appcrawler.DataRecord.last(DataRecord.scala:40)
at com.testerhome.appcrawler.Crawler.doElementAction(Crawler.scala:985)
at com.testerhome.appcrawler.Crawler.runStartupScript(Crawler.scala:238)
at com.testerhome.appcrawler.Crawler.start(Crawler.scala:152)
at com.testerhome.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:344)
at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:312)
at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:92)
at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)

这工具没更新了么?

目前最新版本是哪个,我用的2.1.3,需要匹配appium哪个版本才行

Dandi 回复

1.9.1 以下都可以

小马 回复

我 appium 是1.8.1 Xcode使用 10.1 总是报错。

taozitao 回复


我看官方release说明 1.9.0 才开始支持xcode 10 beta 可能你的xcode太新了 你再确认下appium 和 xcode版本对应关系

青谷 回复

我也有这个错误,我用的还是2.1.3 不知道是不是要更新appcrawler阿 反正 appium 目前是已经支持 Xcode10.1了

小马 回复

谢谢,我已经更新Appium 到 1.11版本,现在模拟器调起没问题,但是总会Appcrawler总会报错。Appcrawler

Exception in thread "main" java.util.NoSuchElementException: last of empty ListBuffer
at scala.collection.mutable.ListBuffer.last(ListBuffer.scala:401)
at com.testerhome.appcrawler.DataRecord.last(DataRecord.scala:40)
at com.testerhome.appcrawler.Crawler.doElementAction(Crawler.scala:985)
at com.testerhome.appcrawler.Crawler.runStartupScript(Crawler.scala:238)
at com.testerhome.appcrawler.Crawler.start(Crawler.scala:152)
at com.testerhome.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:344)
at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:312)
at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:92)
at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)

Appium 报错信息

[debug] [W3C (a792fc62)] Calling AppiumDriver.execute() with args: ["var source = document.documentElement.outerHTML; \nif (!source) { source = new XMLSerializer().serializeToString(document); }\nreturn source;",[],"a792fc62-e7fd-4553-b1f4-109ef59e0bc9"]
[debug] [W3C (a792fc62)] Encountered internal error running command: NotImplementedError: Method is not implemented
[debug] [W3C (a792fc62)] at AndroidUiautomator2Driver.extensions.execute (/usr/local/lib/node_modules/appium/node_modules/appium-android-driver/lib/commands/execute.js:12:9)
[debug] [W3C (a792fc62)] at curCommandCancellable._bluebird.default.resolve.then (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/lib/basedriver/driver.js:291:18)
[debug] [W3C (a792fc62)] at tryCatcher (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/node_modules/bluebird/js/main/util.js:26:23)
[debug] [W3C (a792fc62)] at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/node_modules/bluebird/js/main/promise.js:510:31)
[debug] [W3C (a792fc62)] at Promise._settlePromiseAt (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/node_modules/bluebird/js/main/promise.js:584:18)
[debug] [W3C (a792fc62)] at Promise._settlePromiseAtPostResolution (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/node_modules/bluebird/js/main/promise.js:248:10)
[debug] [W3C (a792fc62)] at Async._drainQueue (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/node_modules/bluebird/js/main/async.js:128:12)
[debug] [W3C (a792fc62)] at Async._drainQueues (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/node_modules/bluebird/js/main/async.js:133:10)
[debug] [W3C (a792fc62)] at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/appium/node_modules/appium-base-driver/node_modules/bluebird/js/main/async.js:15:14)
[debug] [W3C (a792fc62)] at runCallback (timers.js:810:20)
[debug] [W3C (a792fc62)] at tryOnImmediate (timers.js:768:5)
[debug] [W3C (a792fc62)] at processImmediate [as _immediateCallback] (timers.js:745:5)
[HTTP] <-- POST /wd/hub/session/a792fc62-e7fd-4553-b1f4-109ef59e0bc9/execute/sync 405 10 ms - 1654
[HTTP]
[HTTP] --> POST /wd/hub/session/a792fc62-e7fd-4553-b1f4-109ef59e0bc9/execute/sync
[HTTP] {"script":"var source = document.documentElement.outerHTML; \nif (!source) { source = new XMLSerializer().serializeToString(document); }\nreturn source;","args":[]}

Appcrawler 报错信息


2019-03-12 15:06:39 INFO [Crawler.doElementAction.983] current uri = startupActions-Start-0 startupActions
Exception in thread "main" java.util.NoSuchElementException: last of empty ListBuffer
at scala.collection.mutable.ListBuffer.last(ListBuffer.scala:401)
at com.testerhome.appcrawler.DataRecord.last(DataRecord.scala:40)
at com.testerhome.appcrawler.Crawler.doElementAction(Crawler.scala:985)
at com.testerhome.appcrawler.Crawler.runStartupScript(Crawler.scala:238)
at com.testerhome.appcrawler.Crawler.start(Crawler.scala:152)
at com.testerhome.appcrawler.AppCrawler$.startCrawl(AppCrawler.scala:344)
at com.testerhome.appcrawler.AppCrawler$.parseParams(AppCrawler.scala:312)
at com.testerhome.appcrawler.AppCrawler$.main(AppCrawler.scala:92)
at com.testerhome.appcrawler.AppCrawler.main(AppCrawler.scala)

运行在安卓设备上运行也报错

需要 Sign In 后方可回复, 如果你还没有账号请点击这里 Sign Up