51Testing软件测试论坛

 找回密码
 (注-册)加入51Testing

QQ登录

只需一步,快速开始

微信登录,快人一步

手机号码,快捷登录

查看: 2360|回复: 2
打印 上一主题 下一主题

求助:flutter 框架自动化测试时,无法输入内容

[复制链接]
  • TA的每日心情
    开心
    2017-7-11 14:07
  • 签到天数: 8 天

    连续签到: 1 天

    [LV.3]测试连长

    跳转到指定楼层
    1#
    发表于 2020-11-14 14:42:52 | 只看该作者 回帖奖励 |正序浏览 |阅读模式
    self.driver.find_element_by_xpath("//android.widget.EditText[@text='请输入工号']").click()
    self.driver.find_element_by_xpath("//android.widget.EditText[@text='请输入工号']").send_keys("15112319")

    点击事件可以操作成功,但是输入事件报错,报错如下:


    [HTTP] <-- POST /wd/hub/session/6d940830-c56b-48ff-aa9f-9af689f35853/element 200 856 ms - 137
    [HTTP]
    [HTTP] --> POST /wd/hub/session/6d940830-c56b-48ff-aa9f-9af689f35853/element/be3e6087-7e3e-4821-898e-d5595e51a58b/value
    [HTTP] {"text":"15112319","value":["1","5","1","1","2","3","1","9"],"id":"be3e6087-7e3e-4821-898e-d5595e51a58b"}
    [W3C (6d940830)] Calling AppiumDriver.setValue() with args: [["1","5","1","1","2","3","1","9"],"be3e6087-7e3e-4821-898e-d5595e51a58b","6d940830-c56b-48ff-aa9f-9af689f35853"]
    [WD Proxy] Matched '/element/be3e6087-7e3e-4821-898e-d5595e51a58b/value' to command name 'setValue'
    [Protocol Converter] Added 'value' property ["1","5","1","1","2","3","1","9"] to 'setValue' request body
    [WD Proxy] Proxying [POST /element/be3e6087-7e3e-4821-898e-d5595e51a58b/value] to [POST [color=rgb(0, 105, 214) !important]http://127.0.0.1:8201/wd/hub/session/b04fa774-c570-4173-ac98-a2eb517c5057/element/be3e6087-7e3e-4821-898e-d5595e51a58b/value
    ] with body: {"elementId":"be3e6087-7e3e-4821-898e-d5595e51a58b","text":"15112319","replace":false,"value":["1","5","1","1","2","3","1","9"]}
    [WD Proxy] Got response with status 400: {"sessionId":"b04fa774-c570-4173-ac98-a2eb517c5057","value":{"error":"invalid element state","message":"Cannot set the element to '15112319'. Did you interact with the correct element?","stacktrace":"io.appium.uiautomator2.common.exceptions.InvalidElementStateException: Cannot set the element to '15112319'. Did you interact with the correct element?\n\tat io.appium.uiautomator2.handler.SendKeysToElement.setText(SendKeysToElement.java:88)\n\tat io.appium.uiautomator2.handler.SendKeysToElement.safeHandle(SendKeysToElement.java:119)\n\tat io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:41)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:253)\n\tat io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:247)\n\tat io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)\n\tat io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)\n\tat io.net...
    [W3C] Matched W3C error code 'invalid element state' to InvalidElementStateError
    [W3C (6d940830)] Encountered internal error running command: io.appium.uiautomator2.common.exceptions.InvalidElementStateException: Cannot set the element to '15112319'. Did you interact with the correct element?
    [W3C (6d940830)] at io.appium.uiautomator2.handler.SendKeysToElement.setText(SendKeysToElement.java:88)
    [W3C (6d940830)] at io.appium.uiautomator2.handler.SendKeysToElement.safeHandle(SendKeysToElement.java:119)
    [W3C (6d940830)] at io.appium.uiautomator2.handler.request.SafeRequestHandler.handle(SafeRequestHandler.java:41)
    [W3C (6d940830)] at io.appium.uiautomator2.server.AppiumServlet.handleRequest(AppiumServlet.java:253)
    [W3C (6d940830)] at io.appium.uiautomator2.server.AppiumServlet.handleHttpRequest(AppiumServlet.java:247)
    [W3C (6d940830)] at io.appium.uiautomator2.http.ServerHandler.channelRead(ServerHandler.java:68)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    [W3C (6d940830)] at io.netty.handler.codec.MessageToMessageDecoder.channelRead(MessageToMessageDecoder.java:102)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    [W3C (6d940830)] at io.netty.channel.CombinedChannelDuplexHandler$DelegatingChannelHandlerContext.fireChannelRead(CombinedChannelDuplexHandler.java:435)
    [W3C (6d940830)] at io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:293)
    [W3C (6d940830)] at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:267)
    [W3C (6d940830)] at io.netty.channel.CombinedChannelDuplexHandler.channelRead(CombinedChannelDuplexHandler.java:250)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    [W3C (6d940830)] at io.netty.handler.timeout.IdleStateHandler.channelRead(IdleStateHandler.java:266)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:345)
    [W3C (6d940830)] at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1294)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:366)
    [W3C (6d940830)] at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:352)
    [W3C (6d940830)] at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:911)
    [W3C (6d940830)] at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:131)
    [W3C (6d940830)] at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:611)
    [W3C (6d940830)] at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:552)
    [W3C (6d940830)] at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:466)
    [W3C (6d940830)] at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:438)
    [W3C (6d940830)] at io.netty.util.concurrent.SingleThreadEventExecutor$2.run(SingleThreadEventExecutor.java:140)
    [W3C (6d940830)] at io.netty.util.concurrent.DefaultThreadFactory$DefaultRunnableDecorator.run(DefaultThreadFactory.java:144)
    [W3C (6d940830)] at java.lang.Thread.run(Thread.java:929)
    [W3C (6d940830)]



    分享到:  QQ好友和群QQ好友和群 QQ空间QQ空间 腾讯微博腾讯微博 腾讯朋友腾讯朋友
    收藏收藏
    回复

    使用道具 举报

  • TA的每日心情
    奋斗
    2019-12-31 08:59
  • 签到天数: 975 天

    连续签到: 1 天

    [LV.10]测试总司令

    3#
    发表于 2020-12-25 13:39:16 | 只看该作者
    Cannot set the element to '15112319'. Did you interact with the correct element?

    未找到元素
    回复 支持 反对

    使用道具 举报

    本版积分规则

    关闭

    站长推荐上一条 /1 下一条

    小黑屋|手机版|Archiver|51Testing软件测试网 ( 沪ICP备05003035号 关于我们

    GMT+8, 2024-11-26 14:23 , Processed in 0.068361 second(s), 23 queries .

    Powered by Discuz! X3.2

    © 2001-2024 Comsenz Inc.

    快速回复 返回顶部 返回列表