Monitor wxWidgets app?

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Nico
Knows some wx things
Knows some wx things
Posts: 31
Joined: Sun Nov 07, 2010 5:19 pm

Monitor wxWidgets app?

Post by Nico »

Hello,

For testing purposes I would like to create a program that can start a completed wxWidgets app and is able to keep references to its gui components. It should then use these references to, for example, read the current text and cause fake events (e.g. simulate a mouse click on a gui component in the wxWidgets application under test).

Is there anyone that could tell me if there is a way to do something like this and if so how?

My ultimate goal would be to test the application using on the fly generated model-based test scenario's.

Kind regards, Nico
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Monitor wxWidgets app?

Post by catalin »

See wxUIActionSimulator class and wxLog functions.
Nico
Knows some wx things
Knows some wx things
Posts: 31
Joined: Sun Nov 07, 2010 5:19 pm

Re: Monitor wxWidgets app?

Post by Nico »

Thanks for the heads up on wxUIActionSimulator Catalin, that seems to be exactly what I was looking for.

I'm not really clear on the wxLog part for obtaining the information. I see that it might work, but I have no idea how to start there. Hopefully that will become clear after I tried it a couple of times.

Kind regards, Nico
catalin
Moderator
Moderator
Posts: 1618
Joined: Wed Nov 12, 2008 7:23 am
Location: Romania

Re: Monitor wxWidgets app?

Post by catalin »

wxLog* classes are used for logging. You can use them to simply log different actions and "monitor" what has happened since your app started. I don't know if you need that or not, you'll probably figure it out.
Of course you need to add logging calls to your code. There are also different log levels you can use.
You can see in the wxW samples how logging is used.