- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
我正在使用pywinauto
版本0.6.6来控制FMSLogo应用。我无法从 FMSLogo 应用程序中的 wxWindow 控件访问文本。 .texts()
和 .window_text()
方法返回 'text'
,它不是控件的文本内容。这是我的代码:
from pywinauto.application import Application
app = Application().start(r"C:/app/dev/FMSLogo/FMSLogo.exe")
dlg = app.top_window()
dlg.text.DrawOutline("red")
dlg.text.texts()
# ['text']
dlg.child_window(title="text", class_name="wxWindow").texts()
# ['text']
这是dlg.print_control_identifiers()
的输出
Control Identifiers:
wxWindowNR - 'FMSLogo' (L108, T3, R1082, B771)
['wxWindowNR', 'FMSLogowxWindowNR', 'FMSLogo', 'wxWindowNR0', 'wxWindowNR1']
child_window(title="FMSLogo", class_name="wxWindowNR")
|
| wxWindowNR - 'splitter' (L116, T54, R1074, B763)
| ['wxWindowNR2', 'splitterwxWindowNR', 'splitter']
| child_window(title="splitter", class_name="wxWindowNR")
| |
| | wxWindowNR - 'panel' (L118, T56, R1072, B166)
| | ['wxWindowNR3', 'panel', 'panelwxWindowNR', 'panel0', 'panel1', 'panelwxWindowNR0', 'panelwxWindowNR1']
| | child_window(title="panel", class_name="wxWindowNR")
| |
| | wxWindowNR - 'panel' (L118, T173, R1072, B761)
| | ['wxWindowNR4', 'panel2', 'panelwxWindowNR2']
| | child_window(title="panel", class_name="wxWindowNR")
| | |
| | | wxWindow - 'text' (L122, T173, R910, B733)
| | | ['wxWindow', 'textwxWindow', 'text']
| | | child_window(title="text", class_name="wxWindow")
| | |
| | | wxWindowNR - 'stcwindow' (L122, T735, R910, B757)
| | | ['wxWindowNR5', 'stcwindow', 'stcwindowwxWindowNR']
| | | child_window(title="stcwindow", class_name="wxWindowNR")
| | |
| | | Button - 'Zaustavi' (L912, T177, R990, B202)
| | | ['Zaustavi', 'ZaustaviButton', 'Button', 'Button0', 'Button1']
| | | child_window(title="Zaustavi", class_name="Button")
| | |
| | | Button - 'Trace' (L990, T177, R1068, B202)
| | | ['Button2', 'TraceButton', 'Trace']
| | | child_window(title="Trace", class_name="Button")
| | |
| | | Button - 'Pauziraj' (L912, T202, R990, B227)
| | | ['PauzirajButton', 'Button3', 'Pauziraj']
| | | child_window(title="Pauziraj", class_name="Button")
| | |
| | | Button - 'Stanje' (L990, T202, R1068, B227)
| | | ['Stanje', 'Button4', 'StanjeButton']
| | | child_window(title="Stanje", class_name="Button")
| | |
| | | Button - 'Step' (L912, T227, R990, B252)
| | | ['Step', 'Button5', 'StepButton']
| | | child_window(title="Step", class_name="Button")
| | |
| | | Button - 'Ispočetka' (L990, T227, R1068, B252)
| | | ['Button6', 'IspočetkaButton', 'Ispočetka']
| | | child_window(title="Ispočetka", class_name="Button")
| | |
| | | Button - 'Izvrši' (L912, T732, R990, B757)
| | | ['Button7', 'Izvrši', 'IzvršiButton']
| | | child_window(title="Izvrši", class_name="Button")
| | |
| | | Button - 'Uredi sve' (L990, T732, R1068, B757)
| | | ['Button8', 'Uredi sveButton', 'Uredi sve']
| | | child_window(title="Uredi sve", class_name="Button")
| |
| | wxWindow - 'text' (L122, T173, R910, B733)
| | ['wxWindow', 'textwxWindow', 'text']
| | child_window(title="text", class_name="wxWindow")
| |
| | wxWindowNR - 'stcwindow' (L122, T735, R910, B757)
| | ['wxWindowNR5', 'stcwindow', 'stcwindowwxWindowNR']
| | child_window(title="stcwindow", class_name="wxWindowNR")
| |
| | Button - 'Zaustavi' (L912, T177, R990, B202)
| | ['Zaustavi', 'ZaustaviButton', 'Button', 'Button0', 'Button1']
| | child_window(title="Zaustavi", class_name="Button")
| |
| | Button - 'Trace' (L990, T177, R1068, B202)
| | ['Button2', 'TraceButton', 'Trace']
| | child_window(title="Trace", class_name="Button")
| |
| | Button - 'Pauziraj' (L912, T202, R990, B227)
| | ['PauzirajButton', 'Button3', 'Pauziraj']
| | child_window(title="Pauziraj", class_name="Button")
| |
| | Button - 'Stanje' (L990, T202, R1068, B227)
| | ['Stanje', 'Button4', 'StanjeButton']
| | child_window(title="Stanje", class_name="Button")
| |
| | Button - 'Step' (L912, T227, R990, B252)
| | ['Step', 'Button5', 'StepButton']
| | child_window(title="Step", class_name="Button")
| |
| | Button - 'Ispočetka' (L990, T227, R1068, B252)
| | ['Button6', 'IspočetkaButton', 'Ispočetka']
| | child_window(title="Ispočetka", class_name="Button")
| |
| | Button - 'Izvrši' (L912, T732, R990, B757)
| | ['Button7', 'Izvrši', 'IzvršiButton']
| | child_window(title="Izvrši", class_name="Button")
| |
| | Button - 'Uredi sve' (L990, T732, R1068, B757)
| | ['Button8', 'Uredi sveButton', 'Uredi sve']
| | child_window(title="Uredi sve", class_name="Button")
|
| wxWindowNR - 'panel' (L118, T56, R1072, B166)
| ['wxWindowNR3', 'panel', 'panelwxWindowNR', 'panel0', 'panel1', 'panelwxWindowNR0', 'panelwxWindowNR1']
| child_window(title="panel", class_name="wxWindowNR")
|
| wxWindowNR - 'panel' (L118, T173, R1072, B761)
| ['wxWindowNR4', 'panel2', 'panelwxWindowNR2']
| child_window(title="panel", class_name="wxWindowNR")
| |
| | wxWindow - 'text' (L122, T173, R910, B733)
| | ['wxWindow', 'textwxWindow', 'text']
| | child_window(title="text", class_name="wxWindow")
| |
| | wxWindowNR - 'stcwindow' (L122, T735, R910, B757)
| | ['wxWindowNR5', 'stcwindow', 'stcwindowwxWindowNR']
| | child_window(title="stcwindow", class_name="wxWindowNR")
| |
| | Button - 'Zaustavi' (L912, T177, R990, B202)
| | ['Zaustavi', 'ZaustaviButton', 'Button', 'Button0', 'Button1']
| | child_window(title="Zaustavi", class_name="Button")
| |
| | Button - 'Trace' (L990, T177, R1068, B202)
| | ['Button2', 'TraceButton', 'Trace']
| | child_window(title="Trace", class_name="Button")
| |
| | Button - 'Pauziraj' (L912, T202, R990, B227)
| | ['PauzirajButton', 'Button3', 'Pauziraj']
| | child_window(title="Pauziraj", class_name="Button")
| |
| | Button - 'Stanje' (L990, T202, R1068, B227)
| | ['Stanje', 'Button4', 'StanjeButton']
| | child_window(title="Stanje", class_name="Button")
| |
| | Button - 'Step' (L912, T227, R990, B252)
| | ['Step', 'Button5', 'StepButton']
| | child_window(title="Step", class_name="Button")
| |
| | Button - 'Ispočetka' (L990, T227, R1068, B252)
| | ['Button6', 'IspočetkaButton', 'Ispočetka']
| | child_window(title="Ispočetka", class_name="Button")
| |
| | Button - 'Izvrši' (L912, T732, R990, B757)
| | ['Button7', 'Izvrši', 'IzvršiButton']
| | child_window(title="Izvrši", class_name="Button")
| |
| | Button - 'Uredi sve' (L990, T732, R1068, B757)
| | ['Button8', 'Uredi sveButton', 'Uredi sve']
| | child_window(title="Uredi sve", class_name="Button")
|
| wxWindow - 'text' (L122, T173, R910, B733)
| ['wxWindow', 'textwxWindow', 'text']
| child_window(title="text", class_name="wxWindow")
|
| wxWindowNR - 'stcwindow' (L122, T735, R910, B757)
| ['wxWindowNR5', 'stcwindow', 'stcwindowwxWindowNR']
| child_window(title="stcwindow", class_name="wxWindowNR")
|
| Button - 'Zaustavi' (L912, T177, R990, B202)
| ['Zaustavi', 'ZaustaviButton', 'Button', 'Button0', 'Button1']
| child_window(title="Zaustavi", class_name="Button")
|
| Button - 'Trace' (L990, T177, R1068, B202)
| ['Button2', 'TraceButton', 'Trace']
| child_window(title="Trace", class_name="Button")
|
| Button - 'Pauziraj' (L912, T202, R990, B227)
| ['PauzirajButton', 'Button3', 'Pauziraj']
| child_window(title="Pauziraj", class_name="Button")
|
| Button - 'Stanje' (L990, T202, R1068, B227)
| ['Stanje', 'Button4', 'StanjeButton']
| child_window(title="Stanje", class_name="Button")
|
| Button - 'Step' (L912, T227, R990, B252)
| ['Step', 'Button5', 'StepButton']
| child_window(title="Step", class_name="Button")
|
| Button - 'Ispočetka' (L990, T227, R1068, B252)
| ['Button6', 'IspočetkaButton', 'Ispočetka']
| child_window(title="Ispočetka", class_name="Button")
|
| Button - 'Izvrši' (L912, T732, R990, B757)
| ['Button7', 'Izvrši', 'IzvršiButton']
| child_window(title="Izvrši", class_name="Button")
|
| Button - 'Uredi sve' (L990, T732, R1068, B757)
| ['Button8', 'Uredi sveButton', 'Uredi sve']
| child_window(title="Uredi sve", class_name="Button")
MSAA 模式下的
Inspect.exe
为控件提供此信息。
How found: Focus [o:0xFFFFFFFFFFFFFFFC,c:0x0]
hwnd=0x0000000000040220 32bit class="wxWindow" style=0x52010000 ex=0x0
ChildId: 0
Interfaces: IEnumVARIANT IOleWindow IAccIdentity
Impl: Local oleacc proxy
AnnotationID: 0100008020020400FCFFFFFF00000000
Name: "text"
Value: [null]
Role: client (0xA)
State: focused,focusable (0x100004)
Location: {l:-1911, t:701, w:784, h:306}
Selection:
Description: [null]
Kbshortcut: [null]
DefAction: [null]
Help: [null]
HelpTopic: ""
ChildCount: 0
Window: 0x40220
FirstChild: [null]
LastChild: [null]
Next: [null]
Previous: [null]
Left: [null]
Up: [null]
Right: [null]
Down: [null]
Other Props: Object has no additional properties
Children: Container has no children
Ancestors: "text" : window : focused,focusable
"panel" : client : focusable
"panel" : window : focusable
"splitter" : client : focusable
"splitter" : window : focusable
"FMSLogo" : client : focusable
"FMSLogo" : window : sizeable,moveable,focusable
"Desktop 1" : client : focusable
"Desktop 1" : window : focusable
[ No Parent ]
UI 自动化模式下的
Inspect.exe
为控件提供了此信息。
How found: Focus
hwnd=0x0000000000040220 32bit class="wxWindow" style=0x52010000 ex=0x0
Name: "text"
ControlType: UIA_PaneControlTypeId (0xC371)
LocalizedControlType: "pane"
BoundingRectangle: {l:-1913 t:699 r:-1125 b:1009}
IsEnabled: true
IsOffscreen: false
IsKeyboardFocusable: true
HasKeyboardFocus: true
AccessKey: ""
ProcessId: 8036
RuntimeId: [2A.40220]
AutomationId: "6008"
FrameworkId: "Win32"
ClassName: "wxWindow"
NativeWindowHandle: 0x40220
ProviderDescription: "[pid:4384,providerId:0x40220 Main:Nested [pid:8036,providerId:0x40220 Annotation(parent link):Microsoft: Annotation Proxy (unmanaged:uiautomationcore.dll); Main:Microsoft: MSAA Proxy (unmanaged:uiautomationcore.dll)]; Nonclient:Microsoft: Non-Client Proxy (unmanaged:uiautomationcore.dll); Hwnd(parent link):Microsoft: HWND Proxy (unmanaged:uiautomationcore.dll)]"
IsPassword: false
HelpText: ""
IsDialog: [Not supported]
LegacyIAccessible.ChildId: 0
LegacyIAccessible.DefaultAction: ""
LegacyIAccessible.Description: ""
LegacyIAccessible.Help: ""
LegacyIAccessible.KeyboardShortcut: ""
LegacyIAccessible.Name: "text"
LegacyIAccessible.Role: client (0xA)
LegacyIAccessible.State: focused,focusable (0x100004)
LegacyIAccessible.Value: ""
IsAnnotationPatternAvailable: false
IsDragPatternAvailable: false
IsDockPatternAvailable: false
IsDropTargetPatternAvailable: false
IsExpandCollapsePatternAvailable: false
IsGridItemPatternAvailable: false
IsGridPatternAvailable: false
IsInvokePatternAvailable: false
IsItemContainerPatternAvailable: false
IsLegacyIAccessiblePatternAvailable: true
IsMultipleViewPatternAvailable: false
IsObjectModelPatternAvailable: false
IsRangeValuePatternAvailable: false
IsScrollItemPatternAvailable: false
IsScrollPatternAvailable: false
IsSelectionItemPatternAvailable: false
IsSelectionPatternAvailable: false
IsSpreadsheetItemPatternAvailable: false
IsSpreadsheetPatternAvailable: false
IsStylesPatternAvailable: false
IsSynchronizedInputPatternAvailable: false
IsTableItemPatternAvailable: false
IsTablePatternAvailable: false
IsTextChildPatternAvailable: false
IsTextEditPatternAvailable: false
IsTextPatternAvailable: false
IsTextPattern2Available: false
IsTogglePatternAvailable: false
IsTransformPatternAvailable: false
IsTransform2PatternAvailable: false
IsValuePatternAvailable: false
IsVirtualizedItemPatternAvailable: false
IsWindowPatternAvailable: false
IsCustomNavigationPatternAvailable: false
IsSelectionPattern2Available: false
FirstChild: [null]
LastChild: [null]
Next: "stcwindow" pane
Previous: [null]
Other Props: Object has no additional properties
Children: Container has no children
Ancestors: "panel" pane
"splitter" pane
"FMSLogo" window
"Desktop 1" pane
[ No Parent ]
最佳答案
你能尝试一下window_text()方法吗?
关于python - 使用 pywinauto 从 wxWindow 控件获取文本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55534960/
我正在使用 pywinauto 进行自动化单击 DiffDaff 软件上的某个按钮。 我的意图是: 第一步:打开DiffDaff软件 第二步:点击“关于”按钮 from pywinauto.appli
非常直接的问题。 只想按一个键盘键。像输入一样,使用 pywin auto。我不想在任何应用程序窗口的上下文中按下它。 只是键盘键的原始按键,如 a 或 enter 或退格。 最佳答案 只需使用 #
几个月前,我编写了一个 Python GUI 应用程序来读取包含车辆数据的文件。然后它使用 sendkeys 模块在温室气体模型应用程序中输入数据。我已将代码转换为使用 pywinauto 并使用 p
我正在尝试使用 pywinauto 自动化 Visual Basic 应用程序,后端 =“win32”。除了从组合框中选择一项之外,我可以处理所有事情。这个特定的组合框取决于另一个组合框的选择 这是代
我是pywinauto新手,刚开始学习。我在本地 32 位 Windows 7 操作系统中安装了带有 pip 的 pywinauto。所以,我有这个示例代码可以在 chrome 浏览器中打开一个 UR
我正在使用 python 自动化工具 pywinauto 来将字符插入到其他应用程序文本框中。 我发现执行此操作的最佳方法是在复制要插入到剪贴板的文本并将焦点设置到其他应用程序窗口后调用 ctrl+v
全部, 我已经使用“pip install pywinauto”成功安装了 package:pywinauto,但总是失败,为什么?我是这样做的: pip 安装 pywinauto 然后在 windo
我是基于 Windows 桌面的测试自动化的新手,也是 Python 的新手,在花了很多时间之后,pywinauto 变成了使用 Python 进行基于 Windows 的应用程序测试的明显选择。 我
我想在窗口中找到子元素,但只能是某种类型/ 类(class)。 我使用该代码: def get_visible_buttons(window): children = window.Child
我有一个 Jenkins 管道,它在远程服务器中执行一个程序,该服务器使用 pywin 来操作应用程序以进行功能测试。 当我打开远程桌面时,我的应用程序运行良好,但是当我关闭远程桌面并从 Jenkin
我正在尝试使用 pywinauto 在每次更新类文件时自动启动和停止 TomCat。但是,当我尝试运行它时,它会给出以下警告: 用户警告:32 位应用程序应使用 32 位 Python 自动化(您使用
我正在使用 pywinauto 并且我想从其中一个属性中选择文本。但是,我不知道如何访问它。 import pywinauto pwa_app = pywinauto.application.Appl
我正在使用 pywinauto 将文件上传到网络服务器。我使用 Selenium 导航到页面并激活 Windows 资源管理器上传对话框,然后调用 pywinauto 来访问打开的窗口。我已经能够做到
我正在使用具有自定义堆栈面板的 WPF 应用程序,该面板基本上是一个列表。列表中的项目完全相同,因此我无法选择特定文本来唯一标识元素。其他一些值(例如时间)是动态的。 有没有办法让我获取返回的元素列表
我是 python 和 pywinauto 的新手,我需要在运行程序后使用 pywinauto 和 Chrome_widgetWin_1 在 Chrome 中启动演示 - Chrome 启动但只显示一
我正在尝试使用带有 pywinauto 框架的 python 来控制 Windows 媒体播放器。例如,我可以使用 app.WindowsMediaPlayer.MenuSelect("View->G
我尝试让远程桌面窗口保持事件状态,即避免屏幕保护程序和因不活动超时而关闭连接(我不允许配置远程桌面 session 的行为)。 使用 pywinauto 我只意识到连接到应用程序,但现在例如app.C
我正在尝试使用 pywinauto 远程控制有时在启动时显示警告窗口的 Windows 应用程序。 下面的代码标识了窗口,因为它没有菜单。 我想阅读弹出文本以查找短语“请联系您的系统管理员”。在那个弹
目前我正在使用 Pywinauto 和 Behave 来测试桌面应用程序,但我遇到了障碍。在我的自动化中,有一次我需要使用双击,目前我的工作方式是这样的: @step("User selects {r
我试图在 excel 文档中滚动(使用 pywinauto),但它似乎不起作用。 代码: app = Application(backend="uia").connect(process=8876)
我是一名优秀的程序员,十分优秀!