“ print_control_identifiers()”函数无法从Dolphin Gamecube Emulator上的ComboBox中获取任何信息

时间:2019-01-02 09:13:19

标签: python-2.7 pywinauto

我正在使用Dolphin 5.0-6711 gcb模拟器,这是旧版本之一,它使用Qt5。我正在尝试打开“文件”->“工具”->“启动Netplay ...”,并从这个新打开的名为“ Dolphin NetPlay安装程序”的窗口中启动主机。我可以编辑PortNickname并从ListBox中选择一个游戏。但是我无法从具有“ ComboBox”和“ Direct Connection”选项的“连接类型” Treversal Server中选择任何项目。当我将print_control_identifiers()用于“ Dolphin NetPlay设置”窗口时,看不到任何ComboBox项。这是我从print_control_identifiers()的输出:

Dialog - 'Dolphin NetPlay Setup'    (L627, T351, R1277, B854)
[u'Dolphin NetPlay Setup', u'Dialog', u'Dolphin NetPlay SetupDialog']
child_window(title="Dolphin NetPlay Setup", control_type="Window")
   |
   | Pane - 'panel'    (L636, T389, R1268, B845)
   | ['Pane', u'panelPane0', u'panelPane1', u'panel', u'panelPane', 
u'panel0', u'panel1', u'Pane1', u'Pane0']
   | child_window(title="panel", auto_id="-31967", control_type="Pane")
   |    |
   |    | Static - 'Connection Type:'    (L642, T398, R756, B419)
   |    | [u'Connection Type:Static', u'Connection Type:1', u'Connection 
Type:0', u'Static', u'Connection Type:Static1', u'Connection Type:Static0', 
u'Static1', u'Static0', u'Connection Type:']
   |    | child_window(title="Connection Type:", auto_id="-31966", 
control_type="Text")
   |    |
   |    | ComboBox - 'Connection Type:'    (L762, T395, R950, B423)
   |    | [u'Connection Type:ComboBox', u'Connection Type:2', 'ComboBox']
   |    | child_window(title="Connection Type:", auto_id="-31965", 
control_type="ComboBox")
   |    |    |
   |    |    | Static - 'Connection Type:'    (L3, T3, R164, B25)
   |    |    | [u'Connection Type:3', u'Connection Type:Static2', u'Static2']
   |    |    | child_window(title="Connection Type:", control_type="Text")
   |    |    |
   |    |    | Button - 'Open'    (L930, T396, R949, B422)
   |    |    | [u'OpenButton', u'Button1', u'Button0', u'Open', 'Button']
   |    |    | child_window(title="Open", auto_id="DropDown", control_type="Button")
   |    |
   |    | Static - 'Nickname:'    (L642, T432, R711, B453)
   |    | [u'Nickname:', u'Nickname:Static', u'Static3']
   |    | child_window(title="Nickname:", auto_id="-31963", control_type="Text")
   |    |
   |    | Edit - 'Nickname:'    (L762, T429, R950, B457)
   |    | [u'', u'0', u'Edit1', u'Nickname:Edit', u'1', 'Edit', u'Edit0']
   |    | child_window(title="Nickname:", auto_id="-31962", control_type="Edit")
   |    |
   |    | Button - 'Quit'    (L1162, T804, R1262, B839)
   |    | ['Button2', u'Quit', u'QuitButton']
   |    | child_window(title="Quit", auto_id="-31960", control_type="Button")
   |    |
   |    | TabControl - ''    (L642, T490, R1262, B798)
   |    | [u'2', u'TabControlHost', u'TabControlConnect', u'TabControl']
   |    | child_window(auto_id="-31959", control_type="Tab")
   |    |    |
   |    |    | Pane - 'panel'    (L646, T519, R1258, B794)
   |    |    | [u'panelPane2', u'panel2', 'Pane2']
   |    |    | child_window(title="panel", auto_id="-31957", control_type="Pane")
   |    |    |    |
   |    |    |    | Static - 'Port:'    (L652, T528, R682, B549)
   |    |    |    | [u'Port:', u'Port:Static', u'Static4']
   |    |    |    | child_window(title="Port:", auto_id="-31949", control_type="Text")
   |    |    |    |
   |    |    |    | Edit - 'Port:'    (L688, T525, R823, B553)
   |    |    |    | [u'3', u'Port:Edit', 'Edit2']
   |    |    |    | child_window(title="Port:", auto_id="-31948", control_type="Edit")
   |    |    |    |
   |    |    |    | Button - 'Host'    (L1152, T753, R1252, B788)
   |    |    |    | [u'Host1', u'Host0', u'Host', 'Button3', u'HostButton']
   |    |    |    | child_window(title="Host", auto_id="-31945", control_type="Button")
   |    |    |    |
   |    |    |    | ListBox - ''    (L652, T559, R1252, B747)
   |    |    |    | [u'4', u'ListBox']
   |    |    |    | child_window(auto_id="-31944", control_type="List")
   |    |    |    |    |
   |    |    |    |    | ListItem - 'CAPCOM VS. SNK 2 EO (GEOE08)'    (L654, T561, R1250, B581)
   |    |    |    |    | [u'ListItem', u'CAPCOM VS. SNK 2 EO (GEOE08)', u'CAPCOM VS. SNK 2 EO (GEOE08)ListItem']
   |    |    |    |    | child_window(title="CAPCOM VS. SNK 2 EO (GEOE08)", control_type="ListItem")
   |    |    |    |
   |    |    |    | CheckBox - 'Forward Port (UPnP)'    (L829, T529, R991, B549)
   |    |    |    | ['CheckBox', u'Forward Port (UPnP)', u'Forward Port (UPnP)CheckBox']
   |    |    |    | child_window(title="Forward Port (UPnP)", auto_id="-31943", control_type="CheckBox")
   |    |    |
   |    |    | TabItem - 'Connect'    (L644, T492, R710, B517)
   |    |    | [u'ConnectTabItem', 'TabItem', u'Connect', u'TabItem0', u'TabItem1']
   |    |    | child_window(title="Connect", control_type="TabItem")
   |    |    |
   |    |    | TabItem - 'Host'    (L710, T492, R770, B517)
   |    |    | [u'Host2', 'TabItem2', u'HostTabItem']
   |    |    | child_window(title="Host", control_type="TabItem")
   |
   | TitleBar - ''    (L656, T354, R1268, B389)
   | ['TitleBar', u'5']
   |    |
   |    | Menu - 'System'    (L636, T360, R664, B388)
   |    | [u'System0', u'System1', u'System', u'Menu', u'SystemMenu']
   |    | child_window(title="System", auto_id="MenuBar", control_type="MenuBar")
   |    |    |
   |    |    | MenuItem - 'System'    (L636, T360, R664, B388)
   |    |    | [u'System2', u'MenuItem', u'SystemMenuItem']
   |    |    | child_window(title="System", control_type="MenuItem")
   |    |
   |    | Button - 'Minimize'    (L1090, T352, R1150, B389)
   |    | ['Button4', u'Minimize', u'MinimizeButton']
   |    | child_window(title="Minimize", control_type="Button")
   |    |
   |    | Button - 'Maximize'    (L1150, T352, R1209, B389)
   |    | ['Button5', u'MaximizeButton', u'Maximize']
   |    | child_window(title="Maximize", control_type="Button")
   |    |
   |    | Button - 'Close'    (L1209, T352, R1269, B389)
   |    | ['Button6', u'CloseButton', u'Close']
   |    | child_window(title="Close", control_type="Button")

这是我在不选择任何ComboBox项的情况下启动主机的代码:

from pywinauto.application import Application


app = Application(backend="uia")
app.start(r"./Dolphin-x64/Dolphin.exe")
dlg = app["Dolphin"]
dlg.menu_select("Tools->Start NetP")
netplay = app["Dolphin NetPlay Setup"]
netplay.print_control_identifiers()
netplay.Pane.Edit.set_text(username)
netplay.Pane.TabControl.select("Host")
netplay.Pane.TabControl.Pane.Edit.set_text("9999")               
netplay.Pane.TabControl.Pane.ListBox.child_window(title="CAPCOM VS. SNK 2 EO (GEOE08)", control_type="ListItem").select()
netplay.Pane.TabControl.Pane.Button.click()

我想从ComboBox中选择第一个“直接连接”选项。我尝试了select("Direct Connection")select(0),但是我无法确定应该使用哪一个进行导航。

在最新版本的Dolphin中,我什至无法从print_control_identifiers()获取有关主窗口的任何信息,这就是为什么我尝试使用此旧版本。

编辑:

我发现那个ComboBox中有一个秘密按钮。如果我单击netplay.Pane.ComboBox.Button.click(),该按钮将根据netplay.print_control_identifiers()在组合框内显示一个列表框和另一个秘密关闭按钮,即使我在列表框中选择“直接连接”项,也应关闭该第二个秘密关闭按钮影响组合框的更改。

1 个答案:

答案 0 :(得分:0)

这是在pywinauto的master分支中修复的某些组合框(issue #532)的已知问题(尚未发布,即将发布0.6.6版本)。您可以通过以下方式尝试解决问题:

UPDATE name_of_table SET 
name_of_jsonb_column = jsonb_set(name_of_jsonb_column , '{facilitySiteInformation,numberOfItems}', '3') 
WHERE id = 1480;

我还看到它们的Qt工具栏具有“已脱色”的子按钮,通过鼠标悬停在pip uninstall pywinauto pip install https://github.com/pywinauto/pywinauto/archive/master.zip 中可见这些子按钮,但工具栏未将它们列为子按钮。我们也在努力解决与MFC工具栏相关的问题。在issue #413中进行了跟踪。


EDIT1:最新版本的Dolphin的问题看起来很奇怪,可能是应用程序方面的问题。 Inspect.exe显示属性Inspect.exe的错误:

Children

但是它可以以某种方式为主窗口子级重建层次结构。这很有趣,对我来说看起来很新。我愿意更深入地研究这个问题。