UI Automation. Can it be done?

I

ink

Hi all,

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have so far been very unsuccessful.

I have found some desktop examples using Reflection on the Microsoft
website, but they don't seem to port to CF and I also don't think that they
would work in a multiple form environment even if I did get them up and
running.

If any one has any suggestions for me on the best way to do this on Windows
mobile devices, I would be much appreciated.

Thanks,
Ink
 
P

Paul G. Tobey [eMVP]

What's the purpose of doing it? If you tell us what you're trying to do,
rather than how you've been trying to do it, you'll get a better answer...

Paul T.
 
I

ink

hi Paul

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have to do Unit and Stress tests on 50 Devices using our POD application.
As i am sure you can imagine this is not practical for 1 developer.

So i am trying to find a way to Automat user actions on the device..

Any idea's,

ink




"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
 
P

Paul G. Tobey [eMVP]

Your best course of action for the compact framework is to use
mouse_event(), keybd_event(), PostKeybdMessage(), etc. to send the user
actions to the application. Of course, you could, alternatively, just use
PostMessage() with suitable WM_COMMAND messages to tell the application that
a given button was pressed or something, rather than actually simulating the
mouse click down and then up again inside the outline of the button.

I see no way to use reflection to automate an application. You could use
reflection to find out about types, call methods, etc., but I think that
those types would all be instantiated inside your automation application,
not some other application on the device.

Paul T.

ink said:
hi Paul

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have to do Unit and Stress tests on 50 Devices using our POD
application.
As i am sure you can imagine this is not practical for 1 developer.

So i am trying to find a way to Automat user actions on the device..

Any idea's,

ink




"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
What's the purpose of doing it? If you tell us what you're trying to do,
rather than how you've been trying to do it, you'll get a better
answer...

Paul T.
 
G

Guest

I'm not sure why you would want to test all 50 devices - unless they are
different devices and different versions of the OS.

But have you tried using Hopper:
http://msdn2.microsoft.com/en-us/library/bb158517.aspx

It's a fairly basic rugged tool that is quite good for basic testing.
--
Simon Hart
http://simonrhart.blogspot.com


ink said:
hi Paul

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have to do Unit and Stress tests on 50 Devices using our POD application.
As i am sure you can imagine this is not practical for 1 developer.

So i am trying to find a way to Automat user actions on the device..

Any idea's,

ink




"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
What's the purpose of doing it? If you tell us what you're trying to do,
rather than how you've been trying to do it, you'll get a better answer...

Paul T.
 
I

ink

I want to automate tests primarily for load testing.

We actually have closer to 1500 devices in use at any given time and waiting
until the pilot faze to do a decent load test is unacceptable.



And this kind of thinking has already caused a few embarrassing situations,
not necessarily problems with the code.

But we have had things like Wifi Drivers crashing, Key board crashing and OS
crashing after just a few hours of usage. And most of these issues are to do
with the OS setup on the Symbol devices.



I also want to automate them so that regression testing can be done over
night.



Thanks for the Link I will have a look at it now.



ink







Simon Hart said:
I'm not sure why you would want to test all 50 devices - unless they are
different devices and different versions of the OS.

But have you tried using Hopper:
http://msdn2.microsoft.com/en-us/library/bb158517.aspx

It's a fairly basic rugged tool that is quite good for basic testing.
--
Simon Hart
http://simonrhart.blogspot.com


ink said:
hi Paul

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have to do Unit and Stress tests on 50 Devices using our POD
application.
As i am sure you can imagine this is not practical for 1 developer.

So i am trying to find a way to Automat user actions on the device..

Any idea's,

ink




"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT
com> wrote in message news:[email protected]...
What's the purpose of doing it? If you tell us what you're trying to
do,
rather than how you've been trying to do it, you'll get a better
answer...

Paul T.


Hi all,

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have so far been very unsuccessful.

I have found some desktop examples using Reflection on the Microsoft
website, but they don't seem to port to CF and I also don't think that
they would work in a multiple form environment even if I did get them
up
and running.

If any one has any suggestions for me on the best way to do this on
Windows mobile devices, I would be much appreciated.

Thanks,
Ink
 
I

ink

Thanks for getting back to me paul

These evernts (mouse_event(), keybd_event(), PostKeybdMessage() ) are they
framework events or do i have to use p/Invoke on the Corelib.dll?

You wouldn't happen to have an example of these being used?

Thanks,
ink




"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
Your best course of action for the compact framework is to use
mouse_event(), keybd_event(), PostKeybdMessage(), etc. to send the user
actions to the application. Of course, you could, alternatively, just use
PostMessage() with suitable WM_COMMAND messages to tell the application
that a given button was pressed or something, rather than actually
simulating the mouse click down and then up again inside the outline of
the button.

I see no way to use reflection to automate an application. You could use
reflection to find out about types, call methods, etc., but I think that
those types would all be instantiated inside your automation application,
not some other application on the device.

Paul T.

ink said:
hi Paul

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have to do Unit and Stress tests on 50 Devices using our POD
application.
As i am sure you can imagine this is not practical for 1 developer.

So i am trying to find a way to Automat user actions on the device..

Any idea's,

ink




"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message news:[email protected]...
What's the purpose of doing it? If you tell us what you're trying to
do, rather than how you've been trying to do it, you'll get a better
answer...

Paul T.


Hi all,

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have so far been very unsuccessful.

I have found some desktop examples using Reflection on the Microsoft
website, but they don't seem to port to CF and I also don't think that
they would work in a multiple form environment even if I did get them
up and running.

If any one has any suggestions for me on the best way to do this on
Windows mobile devices, I would be much appreciated.

Thanks,
Ink
 
P

Paul G. Tobey [eMVP]

They're native calls, so you'll have to P/Invoke them. I'm not sure about
mouse_event, but I'm pretty sure that the keyboard items are in OpenNETCF's
Smart Device Framework. I'll check...yes, they're in core.cs in v1.4 (no
sign of mouse_event). There are some example uses of the call in the
framework itself, so that might help. keybd_event() is the low-level call
and would mostly be used to press 'keys' like Ctrl and Alt.
PostKeybdMessage() works better for sending actual characters, like what
would happen if you pressed Shift+A or something.

Paul T.

ink said:
Thanks for getting back to me paul

These evernts (mouse_event(), keybd_event(), PostKeybdMessage() ) are they
framework events or do i have to use p/Invoke on the Corelib.dll?

You wouldn't happen to have an example of these being used?

Thanks,
ink




"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
Your best course of action for the compact framework is to use
mouse_event(), keybd_event(), PostKeybdMessage(), etc. to send the user
actions to the application. Of course, you could, alternatively, just
use PostMessage() with suitable WM_COMMAND messages to tell the
application that a given button was pressed or something, rather than
actually simulating the mouse click down and then up again inside the
outline of the button.

I see no way to use reflection to automate an application. You could use
reflection to find out about types, call methods, etc., but I think that
those types would all be instantiated inside your automation application,
not some other application on the device.

Paul T.

ink said:
hi Paul

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have to do Unit and Stress tests on 50 Devices using our POD
application.
As i am sure you can imagine this is not practical for 1 developer.

So i am trying to find a way to Automat user actions on the device..

Any idea's,

ink




"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message What's the purpose of doing it? If you tell us what you're trying to
do, rather than how you've been trying to do it, you'll get a better
answer...

Paul T.


Hi all,

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have so far been very unsuccessful.

I have found some desktop examples using Reflection on the Microsoft
website, but they don't seem to port to CF and I also don't think that
they would work in a multiple form environment even if I did get them
up and running.

If any one has any suggestions for me on the best way to do this on
Windows mobile devices, I would be much appreciated.

Thanks,
Ink
 
G

Guest

You would be better office writing a unit test to simulate load as I am
assuming you want to test your back office/middleware?
--
Simon Hart
http://simonrhart.blogspot.com


ink said:
I want to automate tests primarily for load testing.

We actually have closer to 1500 devices in use at any given time and waiting
until the pilot faze to do a decent load test is unacceptable.



And this kind of thinking has already caused a few embarrassing situations,
not necessarily problems with the code.

But we have had things like Wifi Drivers crashing, Key board crashing and OS
crashing after just a few hours of usage. And most of these issues are to do
with the OS setup on the Symbol devices.



I also want to automate them so that regression testing can be done over
night.



Thanks for the Link I will have a look at it now.



ink







Simon Hart said:
I'm not sure why you would want to test all 50 devices - unless they are
different devices and different versions of the OS.

But have you tried using Hopper:
http://msdn2.microsoft.com/en-us/library/bb158517.aspx

It's a fairly basic rugged tool that is quite good for basic testing.
--
Simon Hart
http://simonrhart.blogspot.com


ink said:
hi Paul

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have to do Unit and Stress tests on 50 Devices using our POD
application.
As i am sure you can imagine this is not practical for 1 developer.

So i am trying to find a way to Automat user actions on the device..

Any idea's,

ink




"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT
com> wrote in message What's the purpose of doing it? If you tell us what you're trying to
do,
rather than how you've been trying to do it, you'll get a better
answer...

Paul T.


Hi all,

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have so far been very unsuccessful.

I have found some desktop examples using Reflection on the Microsoft
website, but they don't seem to port to CF and I also don't think that
they would work in a multiple form environment even if I did get them
up
and running.

If any one has any suggestions for me on the best way to do this on
Windows mobile devices, I would be much appreciated.

Thanks,
Ink
 
G

Guest

mouse_event can be grabbed from my kluge code here:

http://blog.opennetcf.org/ctacke/PermaLink,guid,f281d989-ee71-4fdf-9ced-63fd37ac731d.aspx


--

Chris Tacke, Embedded MVP
OpenNETCF Consulting
Managed Code in an Embedded World
www.OpenNETCF.com


"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam DOT
com> wrote in message news:[email protected]...
They're native calls, so you'll have to P/Invoke them. I'm not sure about
mouse_event, but I'm pretty sure that the keyboard items are in
OpenNETCF's Smart Device Framework. I'll check...yes, they're in core.cs
in v1.4 (no sign of mouse_event). There are some example uses of the call
in the framework itself, so that might help. keybd_event() is the
low-level call and would mostly be used to press 'keys' like Ctrl and Alt.
PostKeybdMessage() works better for sending actual characters, like what
would happen if you pressed Shift+A or something.

Paul T.

ink said:
Thanks for getting back to me paul

These evernts (mouse_event(), keybd_event(), PostKeybdMessage() ) are
they framework events or do i have to use p/Invoke on the Corelib.dll?

You wouldn't happen to have an example of these being used?

Thanks,
ink




"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message news:[email protected]...
Your best course of action for the compact framework is to use
mouse_event(), keybd_event(), PostKeybdMessage(), etc. to send the user
actions to the application. Of course, you could, alternatively, just
use PostMessage() with suitable WM_COMMAND messages to tell the
application that a given button was pressed or something, rather than
actually simulating the mouse click down and then up again inside the
outline of the button.

I see no way to use reflection to automate an application. You could
use reflection to find out about types, call methods, etc., but I think
that those types would all be instantiated inside your automation
application, not some other application on the device.

Paul T.

hi Paul

I have been trying to write a UI automation application for my Compact
Famework 2.0 application.

I have to do Unit and Stress tests on 50 Devices using our POD
application.
As i am sure you can imagine this is not practical for 1 developer.

So i am trying to find a way to Automat user actions on the device..

Any idea's,

ink




"Paul G. Tobey [eMVP]" <p space tobey no spam AT no instrument no spam
DOT com> wrote in message What's the purpose of doing it? If you tell us what you're trying to
do, rather than how you've been trying to do it, you'll get a better
answer...

Paul T.


Hi all,

I have been trying to write a UI automation application for my
Compact Famework 2.0 application.

I have so far been very unsuccessful.

I have found some desktop examples using Reflection on the Microsoft
website, but they don't seem to port to CF and I also don't think
that they would work in a multiple form environment even if I did get
them up and running.

If any one has any suggestions for me on the best way to do this on
Windows mobile devices, I would be much appreciated.

Thanks,
Ink
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top