英文:
Pywinauto typing in the wrong field
问题
我会尽量为您提供翻译,以下是翻译好的部分:
"I'd appreciate any comments on this issue." -> "我会感激任何对此问题的评论。"
"I'm using PywinAuto to automate a DeskTop application." -> "我正在使用PywinAuto来自动化一个桌面应用程序。"
"And I'm executing this command to fill out a field in the screen=>" -> "我正在执行这个命令来填写屏幕上的一个字段=>"
"But it is filling the wrong field." -> "但它正在填写错误的字段。"
"Looking to the picture and take in account the command that I'm using, is it possible to identify what is wrong..?" -> "查看图片并考虑我正在使用的命令,是否可能识别出问题所在..?"
"Thank in advance for any comments." -> "提前感谢任何评论。"
英文:
I'd appreciate any comments on this issue.
I'm using PywinAuto to automate a DeskTop application.
And I'm executing this command to fill out a field in the screen==>
app.SISLOGSistemadeinformaçõeslogísticasRodoviário.Pessoa.Edit.set_edit_text("077775555000100")
But it is filling the wrong field. Below is a print of the application tree.
Looking to the picture and take in account the command that I'm using, is it possible to identify what is wrong..?
Thank in advance for any comments.
答案1
得分: 0
尝试 .Edit2.set_edit_text("...")
。魔法属性查找是拼写错误抵抗力较强的(在某种程度上),它还遵循“找到第一个”的方法。另一个不明显的事情是,Edit0
和 Edit1
匹配到同一个元素,而 Edit2
是下一个,Edit3
是第三个,依此类推。
P.S. 或许将 Inspect.exe
切换到“UI Automation”模式以查看更多属性会更好。
英文:
Try .Edit2.set_edit_text("...")
. Magic attribute lookup is typo resistant (approximate to some degree), also it follows "find first" approach. Another non-obvious thing is that Edit0
and Edit1
is matched to the same element, while Edit2
is the next one, Edit3
is the third one and so on.
P.S. Maybe it's better to switch Inspect.exe
to "UI Automation" mode to see more properties.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论