I just spent a few hours with pyWinAuto and Watsup (http://www.tizmoi.net/watsup/intro.html)
I am unable to get PyWinAuto to send menu selections correctly. The application receives focus (moves to top) but otherwise does not respond to the message.
Also unable to select items in listboxes.
One thing I am doing differently is running my wxPython application in a Thread (as outlined on the wiki). I set a global varaible to the application class from that thread.
This is how I’ve been connecting:
wxapp = …
import pywinauto
from pywinauto import application
from pywinauto.findwindows import *
app = application.Application()
app.connect_( handle = wxapp.GetTopWindow().GetHandle() )
tw=app.top_window_()
I’ll have to try starting the application and see if that fixes things.
My idea was to use a combination of pywinauto and then access to the app internals to create an automated regression test suite for the application.
Watsup worked better, I was able to activate menu items. IMHO it’s a more cumbersome interface though.
Has any one had success with wxPython and pywinauto? Can you share a sample script that hits the major things - menus, lists, checkboxes?
It's been awhile since I've used pywinauto, but looking back at the
code I had I was starting pywinauto in a different thread and then
doing:
app = application.Application.Connect(handle=handle)
main = app.window_(title_re="APPLICATION TITLE GOES HERE")
log.debug("Clicking on menu item ping")
main.Button2.RightClick()
for item in app.windows_()[0].Menu().Items():
if item.Text() == "Ping":
item.Click()
break
···
On Fri, Aug 15, 2008 at 3:44 PM, Kevin Dahlhausen <kevin.dahlhausen@gmail.com> wrote:
I just spent a few hours with pyWinAuto and Watsup
(http://www.tizmoi.net/watsup/intro.html)
I am unable to get PyWinAuto to send menu selections correctly. The
application receives focus (moves to top) but otherwise does not respond to
the message.
Also unable to select items in listboxes.
One thing I am doing differently is running my wxPython application in a
Thread (as outlined on the wiki). I set a global varaible to the
application class from that thread.
This is how I've been connecting:
wxapp = .......
import pywinauto
from pywinauto import application
from pywinauto.findwindows import *
app = application.Application()
app.connect_( handle = wxapp.GetTopWindow().GetHandle() )
tw=app.top_window_()
I'll have to try starting the application and see if that fixes things.
My idea was to use a combination of pywinauto and then access to the app
internals to create an automated regression test suite for the application.
Watsup worked better, I was able to activate menu items. IMHO it's a more
cumbersome interface though.
Has any one had success with wxPython and pywinauto? Can you share a
sample script that hits the major things - menus, lists, checkboxes?
_______________________________________________
wxpython-users mailing list
wxpython-users@lists.wxwidgets.org
http://lists.wxwidgets.org/mailman/listinfo/wxpython-users