Don Dwiggins Advanced Publishing Technology
--If you add a name="SomeName" parameter to the creator for each control it should show up.
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Hi Don,
On 15/03/2013 02:47, Don Dwiggins wrote:
{snip}
So the question is, is there some magical incantation that I can use to assign an "automatable" name to controls (and maybe other windows).
"name" and "Set/GetName" should do the trick, I think.
This is used e.g. by wx.lib.agw.persist and you can also see it in action when you use the WIT (http://wiki.wxpython.org/Widget%20Inspection%20Tool), i.e. the following will show "paneText" as the name instead of the default "panel" if one doesn't assign anything or e.g. Boa assigns unique names like "panel1", "panel2" etc etc.
paneText = sc.SizedPanel(self.GetContentsPane(), name='paneText')
-- Tim Roberts, ti...@probo.com Providenza & Boekelheide, Inc.
Another possibilty occurred to me. My main motivation for using
pywinauto (or other way of automating an application), is to
create a "library" for the application testing system
RobotFramework (https://code.google.com/p/robotframework/), which
supports writing tests in various styles and at various levels,
and allows the use of different automation tools. So, could I
adapt the "guts" of the Widget Inspection Tool to turn it into a
wx-specific automation tool? This might be both easier and more
powerful than fiddling with platform-level window structures, in
that it allows expressing the tests in a notation close to the
wxPython "source code". I'll look into this a bit.
Thanks again,
Don
Another possibilty occurred to me. My main motivation for using pywinauto (or other way of automating an application), is to create a "library" for the application testing system RobotFramework (https://code.google.com/p/robotframework/), which supports writing tests in various styles and at various levels, and allows the use of different automation tools. So, could I adapt the "guts" of the Widget Inspection Tool to turn it into a wx-specific automation tool? This might be both easier and more powerful than fiddling with platform-level window structures, in that it allows expressing the tests in a notation close to the wxPython "source code".
Well, you need to be aware that the Widget Inspection Tool is "in-process". It needs to look at Python object information, and that's only possible if WIT is running in the same Python interpreter as the wx application. You can't write an application that uses WIT to inspect objects in another process.