On Wed, Jul 23, 2008 at 9:45 AM, Huub Peters <[EMAIL PROTECTED]> wrote:
> Gabor Szabo wrote:
>>
>> I am trying to add unit tests that will run the application opening its
>> windows
>> and then send all kinds of events.
>>
>> Reading the testing code in Wx I got to the point where the application
>> runs
>> and I can set a timer to do something later but I could not yet figure out
>> how
>> can I send an arbitrary keystroke ?
>>
>> e.g. How can generate a  Ctr-g  or Alt-F4 event?
>>
>> Gabor
>>
>>
>
> Wouldn't it be more logical to run tests from outside the application?
> Simulating a real user?
> In that case you might want to look at modules like Win32::GuiTest which was
> designed for this purpose.
> I'm pretty sure you can find something similar for other platforms...
>
> Just my 2 cts...
>
> Cheers,
> Huub

That would be much cooler and I should actually check it.
The problem is that I am mostly working on Linux and the above module
is for Windows
and it is quite weak. I am teaching it in my classes but frankly I
never used it in
production code.
There is a corresponding module for Unix/Linux but it has even less
capabilities.
(Eg. it cannot retreive the value printed in a text box)

The other drawback of Win32::GUITest that I encountered when testing GTK
and Qt applications is that it cannot see the widgets inside. It can only see
the whole application as a single window. Or a single picture.
Makes it much harder to test.

I have not tried it with application written in Wx. Theoretically it
should work as
Wx is supposed to use the native widgets - controls on Win32 - so Win32::GuiTest
should be able to see.
But then I have to develop on Windows which I like less.

Gabor

Reply via email to