python - Selecting children from TreeView using pywinauto -


the issue have related the getitem() method pywinauto. able run window.treeview.getitem('\\desktop').click() command on windows 7 , 10 both 32 bit throws exeption , not run when calling python command line of windows 10 64 bit.

this full code use:

import pywinauto  pwa_app = pywinauto.application.application()  w_handle = pywinauto.findwindows.find_windows(title=u'browse folder', class_name='#32770')[0]  window = pwa_app.window_(handle=w_handle)  window.treeview.getitem('\\desktop').click() 

these errors receive:

traceback (most recent call last):   file "<stdin>", line 1, in <module>    file "c:\python27\lib\site-packages\pywinauto\controls\common_controls.py", line 1374, in getitem     texts = [r.text() r in roots]    file "c:\python27\lib\site-packages\pywinauto\controls\common_controls.py", line 872, in text     return self._readitem()    file "c:\python27\lib\site-packages\pywinauto\controls\common_controls.py", line 1263, in _readitem     raise ctypes.winerror()  windowserror: [error 0] operation completed successfully. 

folder dialog content

i have mention can access root of tree view window.treeview.getitem([0]).click()

it happens because win32 api structure sizes windows messages different 32-bit , 64-bit apps. it's fixed in uia branch (you can wait 0.6.0 planned summer).

another way set 32-bit python (and pywinauto) in addition 64-bit python (you need care full path python.exe).


Comments

Popular posts from this blog

Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.12:test (default-test) on project.Error occurred in starting fork -

windows - Debug iNetMgr.exe unhandle exception System.Management.Automation.CmdletInvocationException -

configurationsection - activeMq-5.13.3 setup configurations for wildfly 10.0.0 -