Open Mayur5712 opened 2 years ago
if you put your find/text in a retry loop with a sleep does it work eventually? it looks like you're encountering a stale element reference issue. i wonder if elements might be regenerating in a way which makes them inaccessible.
We are working on a game which contains textview. We are trying to append some text in that view. But we are getting error.
We are using below code to send text.
self.Driver.find_element('id', 'ConfigJSONKey').send_keys('TestWord')
But we are getting below error: [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] Calling AppiumDriver.findElement() with args: ["id","ConfigJSONKey","e562e43e-7385-465a-97fe-1ff5daedb79b"] info Appium Plugins which can handle cmd 'findElement': altunity info Appium Plugin altunity is now handling cmd 'findElement' [Plugin [altunity]] Sending message 1658163661115 with command findObjects [debug] [Plugin [altunity]] {"by":"ID","path":"//[@id=ConfigJSONKey]","cameraBy":"NAME","cameraPath":"//","commandName":"findObjects","messageId":"1658163661115"} [Plugin [altunity]] Received response for message 1658163661115 [debug] [Plugin [altunity]] {"messageId":"1658163661115","commandName":"findObjects","error":null,"data":"[{\"name\":\"keyInput\",\"id\":2262,\"x\":540,\"y\":1236,\"z\":0,\"mobileY\":1104,\"type\":\"\",\"enabled\":true,\"worldX\":540.0,\"worldY\":1236.0,\"worldZ\":0.0,\"idCamera\":2360,\"transformParentId\":2646,\"transform... info Appium Command 'findElement' was not handled by the following behaviours or plugins, even though they were registered to handle it: ["default"]. The command was* handled by these: ["altunity"]. [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] Responding to client with driver.findElement() result: {"ELEMENT":"unity-element-2262","element-6066-11e4-a52e-4f735466cecf":"unity-element-2262"} info HTTP <-- POST /session/e562e43e-7385-465a-97fe-1ff5daedb79b/element 200 51 ms - 101 info HTTP info HTTP --> POST /session/e562e43e-7385-465a-97fe-1ff5daedb79b/appium/element/unity-element-2262/replace_value info HTTP {"id":"unity-element-2262","value":["adsd"]} [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] Calling AppiumDriver.replaceValue() with args: [["adsd"],"unity-element-2262","e562e43e-7385-465a-97fe-1ff5daedb79b"] [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] Matched '/element/unity-element-2262/value' to command name 'setValue' [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] Added 'value' property ["a","d","s","d"] to 'setValue' request body [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] Proxying [POST /element/unity-element-2262/value] to [POST http://127.0.0.1:8235/session/f6e86696-3573-44f7-9fac-064941c1d327/element/unity-element-2262/value] with body: {"elementId":"unity-element-2262","text":"adsd","replace":true,"value":["a","d","s","d"]} [AndroidUiautomator2Driver@87d4 (e562e43e)] Got response with status 404: {"sessionId":"f6e86696-3573-44f7-9fac-064941c1d327","value":{"error":"no such element","message":"The element identified by 'unity-element-2262' is not present in the cache or has expired. Try to find it again","stacktrace":"io.appium.uiautomator2.common.exceptions.ElementNotFoundException: The element identified by 'unity-element-2262' is not present in the cache or has expired. Try to find it again\n\tat io.appium.uiautomator2.model.ElementsCache.get(ElementsCache.java:160)\n\tat io.appium.uiautomator2.handler.SendKeysToElement.safeHandle(SendKeysToElement.java:104)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:267)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:261)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChann... [debug] [W3C] Matched W3C error code 'no such element' to NoSuchElementError [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] Encountered internal error running command: io.appium.uiautomator2.common.exceptions.ElementNotFoundException: The element identified by 'unity-element-2262' is not present in the cache or has expired. Try to find it again [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.appium.uiautomator2.model.ElementsCache.get(ElementsCache.java:160) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.appium.uiautomator2.handler.SendKeysToElement.safeHandle(SendKeysToElement.java:104) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:267) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:261) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] at java.lang.Thread.run(Thread.java:919) [debug] [AndroidUiautomator2Driver@87d4 (e562e43e)] info HTTP <-- POST /session/e562e43e-7385-465a-97fe-1ff5daedb79b/appium/element/unity-element-2262/replace_value 404 30 ms - 3934 info HTTP