Appium机器人框架:EditText随机未填充

问题描述 投票:0回答:1

我正在测试 Android 应用程序,有时我可以填写字段,有时则不能

这是错误:InvalidElementStateException:消息:无法将元素设置为“1”。您是否与正确的元素进行了交互?

实际上我正在使用输入文本和xPath

InvalidElementStateException:消息:无法将元素设置为“1”。您是否与正确的元素进行了交互? 堆栈跟踪: io.appium.uiautomator2.common.exceptions.InvalidElementStateException:无法将元素设置为“1”。您是否与正确的元素进行了交互? 在 io.appium.uiautomator2.handler.SendKeysToElement.setText(SendKeysToElement.java:87) 在io.appium.uiautomator2.handler.SendKeysToElement.safeHandle(SendKeysToElement.java:115) 在io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:59) 在 io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:266) 在 io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:260) 在 io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68) 在io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) 在 io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(Abstra... [超过限制的留言内容已被删除。 ] 在io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366) 在io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352) 在 io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911) 在 io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131) 在 io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611) 在io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552) 在io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466) 在io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438) 在io.netty.util.concurrent.SingleThreadEventExecutor $2.run(SingleThreadEventExecutor.java:140) 在 io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144) 在java.lang.Thread.run(Thread.java:1012)

我希望代码每次都能工作

android appium robotframework python-appium
1个回答
0
投票

我认为这与通过Xpath查找元素有关,在appium上解决了类似的问题:Appium问题

解决方案是单击元素内部并通过操作打印文本,而不是使用元素的属性。

© www.soinside.com 2019 - 2024. All rights reserved.