简体   繁体   English

原始错误:io.appium.uiautomator2.common.exceptions.UiAutomator2Exception

[英]Original error: io.appium.uiautomator2.common.exceptions.UiAutomator2Exception

  • Getting unknown server-side error while running the script. 运行脚本时出现未知的服务器端错误。
  • The script would terminate while scrolling else it would work fine. 该脚本将在滚动时终止,否则它将正常工作。

Log error: 记录错误:

org.openqa.selenium.WebDriverException: An unknown server-side error occurred while processing the command. Original error: io.appium.uiautomator2.common.exceptions.UiAutomator2Exception: java.lang.IllegalStateException: UiAutomation not connected!
    at io.appium.uiautomator2.utils.UiExpressionParser.invokeMethod(UiExpressionParser.java:251)
    at io.appium.uiautomator2.utils.UiScrollableParser.consumeMethodCall(UiScrollableParser.java:124)
    at io.appium.uiautomator2.utils.UiScrollableParser.parse(UiScrollableParser.java:60)
    at io.appium.uiautomator2.utils.UiAutomatorParser.consumeStatement(UiAutomatorParser.java:93)
    at io.appium.uiautomator2.utils.UiAutomatorParser.parse(UiAutomatorParser.java:49)
    at io.appium.uiautomator2.utils.LocationHelpers.toSelectors(LocationHelpers.java:95)
    at io.appium.uiautomator2.utils.LocationHelpers.toSelector(LocationHelpers.java:88)
    at io.appium.uiautomator2.handler.FindElement.findElement(FindElement.java:144)
    at io.appium.uiautomator2.handler.FindElement.safeHandle(FindElement.java:75)
    at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:37)
    at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:250)
    at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:241)
    at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:44)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)

* **Element info: * **元素信息:

{Using=-android uiautomator, value=new UiScrollable(new UiSelector()).scrollIntoView(new UiSelector().text(" val "));}

Appium Log: Appium日志:

restarting adb before the test run with adb kill-server; adb start-server 在使用adb kill-server; adb start-server运行测试之前重新启动adb adb kill-server; adb start-server adb kill-server; adb start-server . adb kill-server; adb start-server because sometimes the appium server having issue with adb so by restarting you can avoid this problem not every time when this error comes you can again start executing if not solved then please restart adb and then start executing script that will work.. Happy to help... In case you have any doubts comment down below.. 因为有时appium服务器出现adb问题,所以通过重新启动可以避免此问题,并非每次出现此错误时都可以,如果未解决,您可以再次开始执行,请重新启动adb ,然后开始执行将起作用的脚本。 ..如果您有任何疑问,请在下面写下。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM