好的,我试试,谢谢!~
没有,我以为只有我这样呢!~
+1 期待 python 版本的。
好的,谢谢!~
windows 命令行文字是乱码,APP 文字是繁体字,请问怎么解决?
如下:id="android:id/title_template"]/android.widget.TextView[@index="0" and @resource-id="android:id/alertTitle" and contains(@text, '瀹夎 Google ')]" classname="AppCrawler_5" time="0.0">
name="clickedIndex=15 xpath=//android.widget.LinearLayout[@index="1" and @resource-id="android:id/contentPanel"]/android.widget.ScrollView[@index="0" and @resource-id="android:id/scrollView"]/android.widget.LinearLayout[@index="0"]/android.widget.TextView[@index="0" and @resource-id="android:id/message" and contains(@text, '浣跨敤鍦板湒鍔熻兘闇€瀹夎G')]" classname="AppCrawler_5" time="0.0">
#57 楼 @seveniruby 了解,謝謝!~
2016-11-08 18:47:29 ERROR [AndroidCrawler.start.167] key not found: xpath
2016-11-08 18:47:29 ERROR [AndroidCrawler.start.168]
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] scala.collection.MapLike$cl
ass.default(MapLike.scala:228)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] scala.collection.AbstractMa
p.default(Map.scala:59)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] scala.collection.mutable.Ha
shMap.apply(HashMap.scala:65)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] com.xueqiu.qa.appcrawler.Cr
awler$$anonfun$getElementByElementActions$2.apply(Crawler.scala:1171)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] com.xueqiu.qa.appcrawler.Cr
awler$$anonfun$getElementByElementActions$2.apply(Crawler.scala:1170)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] scala.collection.immutable.
List.foreach(List.scala:381)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] scala.collection.generic.Tr
aversableForwarder$class.foreach(TraversableForwarder.scala:35)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] scala.collection.mutable.Li
stBuffer.foreach(ListBuffer.scala:45)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] com.xueqiu.qa.appcrawler.Cr
awler.getElementByElementActions(Crawler.scala:1170)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] com.xueqiu.qa.appcrawler.Cr
awler.crawl(Crawler.scala:723)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] com.xueqiu.qa.appcrawler.Cr
awler$$anonfun$1.apply$mcV$sp(Crawler.scala:160)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] com.xueqiu.qa.appcrawler.Cr
awler$$anonfun$1.apply(Crawler.scala:160)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] com.xueqiu.qa.appcrawler.Cr
awler$$anonfun$1.apply(Crawler.scala:160)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] scala.util.Try$.apply(Try.s
cala:192)
2016-11-08 18:47:29 ERROR [AndroidCrawler.apply.169] com.xueqiu.qa.appcrawler.Cr
awler.start(Crawler.scala:160)
是我的定位用錯了方式嗎?配置文件一定要使用 xpath 定位嗎?
#24 楼 @l84222780 跪求解決方案。
#23 楼 @mengde0077 我也遇到這個問題。。
#132 楼 @quqing 这两天在 mac 上跑也是这样的报错。请问是为什么呢?打包有问题?addcndeMacBook-Pro:AutoTraveler-master addcn$ java -jar AutoTraveler.jar android confige/android.xml
Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/Capabilities
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:264)
at pers.traveler.robot.RobotFactory.build(RobotFactory.java:13)
at pers.traveler.test.Main.main(Main.java:20)
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.Capabilities
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 4 more
Exception in thread "main" java.lang.NoClassDefFoundError: org/openqa/selenium/C
apabilities
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Unknown Source)
at pers.traveler.robot.RobotFactory.build(RobotFactory.java:13)
at pers.traveler.test.Main.main(Main.java:20)
Caused by: java.lang.ClassNotFoundException: org.openqa.selenium.Capabilities
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 4 more
報這樣的錯,請問是什麼原因呢?java 是 1.8