Win10上启动UICrawler自动遍历时报 "or…

2019-01-15 07:03:47来源:博客园 阅读 ()

新老客户大回馈,云服务器低至5折

操作步骤:

1、直接启动 Appium (我用的是 version 1.10.0)

2、打开命令窗口,切换到 UICrawler 所在路径

3、执行命令 java -jar UICrawler-2.23.jar -f config.yml -u deviceSerialNumber

4、执行后不会安装appium所需要特定 apk 程序,报错 could not sign with default certificate

完整信息如下:

  1 E:\BaiduNetdiskDownload\UICrawler>java -jar UICrawler-2.23.jar -f config.yml -u DIYTH
  2 YTCCQBIV47D
  3 13:39:43.822 [main] INFO  Crawler - Version is 2.23 ---DEC/7/2018
  4 13:39:43.822 [main] INFO  Crawler - PC platform : Windows 10
  5 13:39:43.822 [main] INFO  Crawler - System File Encoding: GBK
  6 13:39:43.822 [main] INFO  Crawler - E:\BaiduNetdiskDownload\UICrawler\config.yml
  7 13:39:43.822 [main] INFO  Crawler - Crawler loop count is 1
  8 13:39:43.822 [main] INFO  Crawler - Crawler loop No is 1
  9 13:39:43.822 [main] INFO  util.ConfigUtil - Method: initialize
 10 13:39:43.822 [main] INFO  util.ConfigUtil - Reading config file E:\BaiduNetdiskDownlo
 11 ad\UICrawler\config.yml
 12 13:39:43.963 [main] INFO  util.ConfigUtil - Config : PORT = 4723
 13 13:39:43.963 [main] INFO  util.ConfigUtil - Config : MAX_CLICK_COUNT = 100000
 14 13:39:43.963 [main] INFO  util.ConfigUtil - Config : DB_LOG = false
 15 13:39:43.963 [main] INFO  util.ConfigUtil - Config : PERF_LOG = false
 16 13:39:43.963 [main] INFO  util.ConfigUtil - Config : DOM_DISPLAY = false
 17 13:39:43.979 [main] INFO  util.ConfigUtil - Config : VIDEO_VERTICAL = true
 18 13:39:43.979 [main] INFO  util.ConfigUtil - Config : DEVICE_NAME = null
 19 13:39:43.979 [main] INFO  util.ConfigUtil - Config : APPIUM_SERVER_IP = 0.0.0.0
 20 13:39:43.979 [main] INFO  util.ConfigUtil - Config : ITEM_BLACKLIST = [客服, 电话, 不
 21 允许, 拒绝, 拍照, 禁止, 呼叫, 低电量模式, 关闭, //*[@text="去付款"]]
 22 13:39:43.979 [main] INFO  util.ConfigUtil - rootDir is E:\BaiduNetdiskDownload\UICraw
 23 ler\crawler_output\DIYTHYTCCQBIV47D-2019-01-14-13_39_43
 24 13:39:43.979 [main] INFO  util.ConfigUtil - Config : ANDROID_PACKAGE = com.android.se
 25 ttings
 26 13:39:43.979 [main] INFO  util.ConfigUtil - Config : ANDROID_MAIN_ACTIVITY = /com.and
 27 roid.settings.Settings
 28 13:39:44.010 [main] INFO  util.Driver - ===== Method : prepareForAppiumAndroid
 29 13:39:44.010 [main] INFO  util.Driver - appPackage com.android.settings
 30 13:39:44.010 [main] INFO  util.Util - System name is :Windows 10
 31 13:39:44.010 [main] INFO  util.Util - Method exeCmd : [cmd, /c, adb -s DIYTHYTCCQBIV4
 32 7D shell getprop | findstr version.sdk]
 33 13:39:44.572 [main] INFO  util.Util - [cmd, /c, adb -s DIYTHYTCCQBIV47D shell getprop
 34  | findstr version.sdk]  ---output is : [ro.build.version.sdk]: [24]
 35 [ro.mediatek.version.sdk]: [4]
 36 13:39:44.572 [main] INFO  util.Driver - sdk version : 24
 37 13:39:44.588 [main] INFO  util.Driver - Using uiautomator2
 38 13:39:44.588 [main] INFO  util.Driver - http://0.0.0.0:4723/wd/hub
 39 Exception in thread "main" org.openqa.selenium.WebDriverException: It is impossible t
 40 o create a new session because 'createSession' which takes HttpClient, InputStream an
 41 d long was not found or it is not accessible
 42 Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
 43 System info: host: 'L1-dfdfdf-W', ip: '192.168.1.103', os.name: 'Windows 10', os.ar
 44 ch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
 45 Driver info: driver.version: Driver
 46         at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumC
 47 ommandExecutor.java:195)
 48         at io.appium.java_client.remote.AppiumCommandExecutor.createSession(AppiumCom
 49 mandExecutor.java:209)
 50         at io.appium.java_client.remote.AppiumCommandExecutor.execute(AppiumCommandEx
 51 ecutor.java:231)
 52         at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:54
 53 3)
 54         at io.appium.java_client.DefaultGenericMobileDriver.execute(DefaultGenericMob
 55 ileDriver.java:42)
 56         at io.appium.java_client.AppiumDriver.execute(AppiumDriver.java:1)
 57         at io.appium.java_client.android.AndroidDriver.execute(AndroidDriver.java:1)
 58         at org.openqa.selenium.remote.RemoteWebDriver.startSession(RemoteWebDriver.ja
 59 va:207)
 60         at org.openqa.selenium.remote.RemoteWebDriver.<init>(RemoteWebDriver.java:130
 61 )
 62         at io.appium.java_client.DefaultGenericMobileDriver.<init>(DefaultGenericMobi
 63 leDriver.java:38)
 64         at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:84)
 65         at io.appium.java_client.AppiumDriver.<init>(AppiumDriver.java:94)
 66         at io.appium.java_client.android.AndroidDriver.<init>(AndroidDriver.java:93)
 67         at util.Driver.prepareForAppiumAndroid(Driver.java:876)
 68         at Crawler.main(Crawler.java:226)
 69 Caused by: java.lang.reflect.InvocationTargetException
 70         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 71         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:
 72 62)
 73         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorIm
 74 pl.java:43)
 75         at java.lang.reflect.Method.invoke(Method.java:498)
 76         at io.appium.java_client.remote.AppiumCommandExecutor$1.createSession(AppiumC
 77 ommandExecutor.java:185)
 78         ... 14 more
 79 Caused by: org.openqa.selenium.WebDriverException: An unknown server-side error occur
 80 red while processing the command. Original error: Could not sign with default certifi
 81 cate. Original error Command ''C:\\Program Files\\Java\\jdk1.8.0_91\\bin\\java.exe' -
 82 jar 'C:\\Program Files (x86)\\Appium\\resources\\app\\node_modules\\appium-adb\\jars\
 83 \sign.jar' 'C:\\Program Files (x86)\\Appium\\resources\\app\\node_modules\\appium-uia
 84 utomator2-server\\apks\\appium-uiautomator2-server-debug-androidTest.apk' --override'
 85  exited with code 1
 86 Build info: version: 'unknown', revision: 'unknown', time: 'unknown'
 87 System info: host: 'L1-dfdfdf-W', ip: '192.168.1.103', os.name: 'Windows 10', os.ar
 88 ch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
 89 Driver info: driver.version: Driver
 90 remote stacktrace: UnknownError: An unknown server-side error occurred while processi
 91 ng the command. Original error: Could not sign with default certificate. Original err
 92 or Command ''C:\\Program Files\\Java\\jdk1.8.0_91\\bin\\java.exe' -jar 'C:\\Program F
 93 iles (x86)\\Appium\\resources\\app\\node_modules\\appium-adb\\jars\\sign.jar' 'C:\\Pr
 94 ogram Files (x86)\\Appium\\resources\\app\\node_modules\\appium-uiautomator2-server\\
 95 apks\\appium-uiautomator2-server-debug-androidTest.apk' --override' exited with code
 96 1
 97     at getResponseForW3CError (C:\Program Files (x86)\Appium\resources\app\node_modul
 98 es\appium-base-driver\lib\protocol\errors.js:826:9)
 99     at asyncHandler (C:\Program Files (x86)\Appium\resources\app\node_modules\appium-
100 base-driver\lib\protocol\protocol.js:447:37)
101     at process._tickCallback (internal/process/next_tick.js:68:7)
102         at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
103         at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcc
104 essorImpl.java:62)
105         at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstr
106 uctorAccessorImpl.java:45)
107         at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
108         at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$new$0(W3CHandshakeR
109 esponse.java:57)
110         at org.openqa.selenium.remote.W3CHandshakeResponse.lambda$getResponseFunction
111 $2(W3CHandshakeResponse.java:104)
112         at org.openqa.selenium.remote.ProtocolHandshake.lambda$createSession$0(Protoc
113 olHandshake.java:123)
114         at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
115         at java.util.Spliterators$ArraySpliterator.tryAdvance(Spliterators.java:958)
116         at java.util.stream.ReferencePipeline.forEachWithCancel(ReferencePipeline.jav
117 a:126)
118         at java.util.stream.AbstractPipeline.copyIntoWithCancel(AbstractPipeline.java
119 :498)
120         at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:485)
121         at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:47
122 1)
123         at java.util.stream.FindOps$FindOp.evaluateSequential(FindOps.java:152)
124         at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
125         at java.util.stream.ReferencePipeline.findFirst(ReferencePipeline.java:464)
126         at org.openqa.selenium.remote.ProtocolHandshake.createSession(ProtocolHandsha
127 ke.java:126)
128         ... 19 more
View Code

 

解决办法:

1、win10上带了管理员功能,普通权限对访问操作权限不够会导致读写失败

2、以管理员的形式启动 Appium 应用并启动服务,再次执行自动遍历即可成功


原文链接:https://www.cnblogs.com/TwCsLj/p/10267163.html
如有疑问请与原作者联系

标签:

版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com
特别注意:本站所有转载文章言论不代表本站观点,本站所提供的摄影照片,插画,设计作品,如需使用,请与原作者联系,版权归原作者所有

上一篇:10JavaScript作用域

下一篇:Java集合框架详解(全)