Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Compact Framework / August 2007

Tip: Looking for answers? Try searching our database.

UI Automation. Can it be done?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
ink - 13 Aug 2007 14:26 GMT
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
Paul G. Tobey [eMVP] - 13 Aug 2007 16:47 GMT
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,
>
[quoted text clipped - 13 lines]
> Thanks,
> Ink
ink - 13 Aug 2007 17:02 GMT
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

> 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...
[quoted text clipped - 18 lines]
>> Thanks,
>> Ink
Paul G. Tobey [eMVP] - 13 Aug 2007 17:54 GMT
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
>
[quoted text clipped - 34 lines]
>>> Thanks,
>>> Ink
ink - 14 Aug 2007 10:30 GMT
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

> Your best course of action for the compact framework is to use
> mouse_event(), keybd_event(), PostKeybdMessage(), etc. to send the user
[quoted text clipped - 49 lines]
>>>> Thanks,
>>>> Ink
Paul G. Tobey [eMVP] - 14 Aug 2007 16:08 GMT
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.

> Thanks for getting back to me paul
>
[quoted text clipped - 59 lines]
>>>>> Thanks,
>>>>> Ink
<ctacke/> - 14 Aug 2007 23:52 GMT
mouse_event can be grabbed from my kluge code here:

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


Signature

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

> 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
[quoted text clipped - 70 lines]
>>>>>> Thanks,
>>>>>> Ink
Simon Hart - 13 Aug 2007 22:10 GMT
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.
Signature

Simon Hart
http://simonrhart.blogspot.com

> hi Paul
>
[quoted text clipped - 32 lines]
> >> Thanks,
> >> Ink
ink - 14 Aug 2007 10:26 GMT
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

> I'm not sure why you would want to test all 50 devices - unless they are
> different devices and different versions of the OS.
[quoted text clipped - 44 lines]
>> >> Thanks,
>> >> Ink
Simon Hart - 14 Aug 2007 22:46 GMT
You would be better office writing a unit test to simulate load as I am
assuming you want to test your back office/middleware?
Signature

Simon Hart
http://simonrhart.blogspot.com

> I want to automate tests primarily for load testing.
>
[quoted text clipped - 63 lines]
> >> >> Thanks,
> >> >> Ink

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.