python - 在 UIAutomator 中设置文本

标签 python android-uiautomator

我刚刚探索用于 Android 应用程序测试的 UIAutomator 并遇到了这个问题。

基于 API。

https://github.com/xiaocong/uiautomator#screen-actions-of-the-device

作为探索的一部分,我正在尝试以编程方式添加新联系人。

enter image description here

我已使用此代码到达此页面。

from uiautomator import device as d
d.click(x,y) #used to click all the way to contacts. 

如何将文本插入名称文本框?由于我不知道类图像并且github上的例子也不多。

最佳答案

根据文档,应该是

d(text="Settings").set_text("My text...")  # set the text

关于python - 在 UIAutomator 中设置文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32068527/

相关文章:

python - python中1到N之间数字求和的问题

python - Jupyter笔记本: Timeout waiting for kernel_info_reply

python - sqlite 不保存小数,但在 MySQL 中工作正常

spinner - 如何使用 appium 从混合应用程序的下拉列表中选择值?

java - 用 UiAutomator 测试 Snackbar,有办法吗?

python - Pandas :如何按类别分组(和求和)并保留子类别的信息

python - PySide/PyQt : PointingHandCursor recipes?

android - 我们可以从 UIAutomator 的 UIObject 类获取 View 吗

android - Android 中 UIAutomator 测试中的 RunTimeException

android - 从 uiautomator 中的 AutoCompleteTextView 中选择项目