【问题标题】:Robotframework: ValueError: Element locator 'locator(332,400)' did not match any elementsRobotframework:ValueError:元素定位器'locator(332,400)'不匹配任何元素
【发布时间】:2020-05-15 23:37:33
【问题描述】:

我正在尝试设置自动测试。我正在使用 RobotFramework 和 AppiumLibrary 我在点击按钮时使用点击点,因为我在我的应用程序上使用 Flutter。 当我尝试在以下位置输入文本时:

http://serhatbolsu.github.io/robotframework-appiumlibrary/AppiumLibrary.html

说我必须使用定位器,文本 但是当我尝试将定位器与我的坐标一起使用时

click a point          332      400
sleep                  2s
input text             locator(332,400)     testing

然后出现此通知

ValueError: Element locator 'locator(332,400)' did not match any elements.

我已经在谷歌上搜索了,但找不到答案,请帮助我,谢谢

【问题讨论】:

  • 你可以试试用 xpath 代替这个吗?
  • 我尝试使用 xpath 并发生这种情况 ValueError: Element locator '/hierarchy/android.widget.FrameLayout/android.widget.LinearLayout/android.widget.FrameLayout/android.view.View/android.view .View/android.view.View/android.widget.ImageView/android.widg et.EditText[1]' 没有匹配任何元素。
  • 你用什么工具来检查?我认为你添加了错误的 xpath
  • 我用的是Appium先生,我在Selected Element上发现,文本框有xpath
  • 我使用“在坐标处单击元素”,它似乎工作得很好。你可以试试吗?

标签: appium robotframework


【解决方案1】:

使用定位器介绍中的有效定位器 http://serhatbolsu.github.io/robotframework-appiumlibrary/AppiumLibrary.html#Introduction

即:输入文本 id=my_element TextToInput

【讨论】:

  • appium 上没有出现 id,因为我正在使用颤振..所以我需要使用坐标 X,Y 点击我的按钮。不知道怎么选择文本框输入值,因为没有id
猜你喜欢
  • 1970-01-01
  • 2023-03-04
  • 2015-10-26
  • 2020-03-06
  • 2016-06-09
  • 2016-06-09
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多