I am using Dolphin 5.0-6711 gcb emulator which is one of the old versions and it use Qt5. I am trying to open "File->Tools->Start Netplay..." and starting a host from this new opened window named "Dolphin NetPlay Setup". I can edit Port
, Nickname
and select a game from ListBox
. But i cannot select any items from "Connection Type" ComboBox
which has Direct Connection
and Treversal Server
options. When I use print_control_identifiers()
for "Dolphin NetPlay Setup" window, I could not see any ComboBox
items. This is my output from 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")
This is my codes for starting a host without selecting any ComboBox items:
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()
I want to select the first "Direct Connection" option from the ComboBox
. I tried select("Direct Connection")
and select(0)
but I can't decide which one i should use for navigation.
I even cannot get any info from print_control_identifiers()
for main window in the lastest version of Dolphin which is why i am try to this old version.
EDIT:
I found out there was a secret button in that ComboBox. If I click netplay.Pane.ComboBox.Button.click()
that button a ListBox and a second secret close button appear inside the ComboBox according to netplay.print_control_identifiers()
and even if I select "Direct Connection" item in the ListBox you should close that second secret close button to affect ComboBox change.
This is known problem for some combo boxes (issue #532) fixed in master branch of pywinauto (not released yet, will be in 0.6.6 version soon). You can try the fix out by
pip uninstall pywinauto
pip install https://github.com/pywinauto/pywinauto/archive/master.zip
Also I'm seeing their Qt toolbar has "detouched" children buttons that are visible in Inspect.exe
by mouse hovering, but Toolbar doesn't list them as children. We're working on workaround that is relevant to MFC toolbar as well. This is tracked in issue #413.
EDIT1: The issue with the latest version of Dolphin looks very strange and probably it's an app side problem. Inspect.exe
shows error for property Children
:
Children: [Error: calling getter for this property: hr=0xFFFFFFFF80004005 - Unspecified error]
But it can re-build the hierarchy for the main window children somehow. It's interesting and looks new to me. I'm willing to look into this issue deeper.
EDIT2: We've bypassed Qt5 issue by using RawViewWalker object instead of FindAll() function in MS UI Automation API. If you want to participate in early testing of next major release (beta quality on Windows), you can try to install it this way:
pip uninstall -y pywinauto
pip install https://github.com/pywinauto/pywinauto/archive/atspi.zip
Please note that some backward compatibility is broken, but all error messages should tell you what to replace in your code to make it working. If some error message is unclear, feel free to report a new issue on GitHub. Thanks!