DEVBUZZ Homepage Regression testing your Pocket PC app, a new form of torture
 
Web www.devbuzz.com
  HOME PAGE
  All Articles
  Advertise
  Consulting

 Development
  Discuss - Forums
  Still in the box?
  .Compact Framework
  Code Snippets
  SQL Server CE
  Database
  MS Resources
 Stores
  Developer Controls
  Pocket PC Hardware
  Pocket PC Software
  Pocket PC Books
  .NET CF Books
  Book Reviews
  SPB SW Discounts
  RESCO SW Discounts
 DEVBUZZ Info
  About Us
  Help
  Join our email list
  Links & Ratings
  Press & Comments
  Pocket PC version
  Software Reviews
  Hardware Reviews
 Authors
  Authors
  Article Guide
  Competitions
 Resources
  Developers
  Register
  Login

  SPB Discounts!
 Columnists
  Rick Winscot
 Past Blast
  Personal Media Ctr
  Gizmobility
  eVB Legacy
  Old news
  Hosted Software
  Wireless
  Newsletters
  Carl Davis
  Upton Au

 Pocket PC Registry
  Join the registry
  View current list
 Current Poll
Are you converting to .NET Compact Framework?
Yes, it has changed my life!
No, I'm sticking with eVB
.NET CF what's that`?

Current results
3431 votes so far
 Recent Forum Threads [goto forums]

Get Computername
read... (67 hits)


Great aid to development productivity
read... (82 hits)


ThreadingTimer sample code
read... (143 hits)


Multithreading with .NET CF
read... (194 hits)


Moving from eMbedded Visual Basic to Visual Basic .NET
read... (166 hits)


.NET Compact Framework 2.0 Service Pack 2
read... (226 hits)


Transfer Data from SQL Server 2000 to SQL Server Compact Edition
read... (298 hits)


This protocol version is not supported
read... (236 hits)


Converting Lowercase to uppercase wont work
read... (203 hits)


Direct access to MS SQL Server 2000
read... (374 hits)


Creating SDF file in Desktop
read... (513 hits)


Winsock in CF.NET
read... (316 hits)


Using Pocket Outlook to submit HTML page form with MAILTO action
read... (420 hits)


Missing file "System.Data.PocketPC.asmmeta.dll"
read... (268 hits)


HP iPAQ hw6915 Serial Port Issue
read... (309 hits)


Info on the recent forum changes
read... (341 hits)


SqlServer tools from Redgate
read... (383 hits)


Arrow keys and Hardware navigation button
read... (393 hits)


O2 XDA lls pin sync cable to comport
read... (322 hits)


Creating dynamic folders on Pocket PC OS
read... (299 hits)

Custom Windows Mobile software development.
LBS Challenge 2007
LBS Challenge Eight previous NAVTEQ Global LBS Challenge® participants have received venture capital funding and nine past LBS Challenge winners have launched commercial applications on major wireless carriers. Register your non-commercial LBS application in the 2007 NAVTEQ Global LBS Challenge in one of three regions: Americas, Europe-Middle East-Africa (EMEA) or Asia-Pacific(APAC). You could win a share of $2 million in prizes. This could be your year.
Dream. Develop. Win.

Development | .NET Compact Framework

Regression testing your Pocket PC app, a new form of torture
Written by Derek Mitchell  [author's bio]  [read 44871 times]
Edited by Derek

Discuss this article   Windows CE 3.0   

Page 1  Page 2 

So what this about Tcl?

The test scripts contain loops and variables as well as conditions, procedures, expressions, file access functions and many other items. Pocket PC TestSuite 2.0 uses Tcl as a base language for test scripts. Tcl is a simple but powerful programming language. Tcl provides the added flexibility and power to design very sophisticated test scripts, but in 95% of cases you are not going to need this level of complexity.

Here are some samples that give an overview of some of the Tcl expertise you might need:

Variables

#this is a comment line because it starts with #
#create 2 variables
set x 40
set y 50

#click to point (x, y)
ts_click $x $y

Loops

set x 40
set y 50

#a loop, here we click 10 times increasing y coordinate by 1
for {set i 0} {$i<10} {incr i 1} {
ts_click $x [expr $y+$i]
}

Functions

#this function clicks 10 times to the given point
proc click10times {x y} {
for {set i 0 } {$i<10} {incr i 1} {
ts_click $x $y
ts_wait 500 #wait 0.5 second
}
}

click10times 78 45
click10times 210 200
click10times 34 100
click10times 80 80

You can read more about Tcl in the following Tcl tutorial or these FAQs, Tcl FAQ 1, Tcl FAQ 2.

Test functions

There 22 special functions (excluding the standard Tcl functions) that you can use in your test scripts. You can create your own functions that will perform batch operations if needed. Here is a list of the basic test functions:

Simulation

Simulation functions simulate user activities like key pressing, etc.

ts_click x y - Simulates tap (click) to the given point
ts_mousedown x y - Simulates mouse down event in the given point
ts_mouseup x y - Simulates mouse up event in the given point
ts_mousemove x y - Simulates mouse move event to the given point
ts_wait mills - Delays script for mills milliseconds
ts_key keycode - Simulates pressing of the key with the given code
ts_keydown keycode - Simulates key down even of the key with the given code
ts_keyup keycode - Simulates key up even of the key with the given code
ts_text yourstring - Simulates entering of the given string
ts_run program_path arguments - Starts program with the given path and the given arguments (arguments are optional)
ts_cpapplet applet_id page_id - Opens Control Panel applet with the given id (page id is optional)

Checking

These functions are used to check results. For example if you know that in the end of your script the program must be in a certain state you can check this state using the following functions:

ts_getpixel x y - Returns RGB color of the given point (for example "230 4 34")
ts_gettext x y - Returns text of the control under the given point. You can use this function to check text in edit control, comboboxes, etc.
ts_getfreemem - Returns available memory in bytes
ts_checkscreenrect x1 y1 x2 y2 bmp_file_name - Checks if the screen rectangle of [(x1,y1) - (x2,y2)] is equal to the given bitmap file

Reporting

ts_log message_string - Writes the given string to the log file. When the test script is finished this log file is shown to the user.
ts_messagebox message_string - Shows message box with the given string. Use this function for debug purposes only because it can affect the tested process.

You can access the Pocket PC TestSuite documentation PDF here.

Last but not least - checking the results

It is important to check the results after testing an app. Pocket PC TestSuite 2.0 includes a set of functions for that. Here are main usage scenarios:

  1. You can get free memory (using ts_getfreemem) then simulate actions that bring the program to the initial state - now check that free memory os has not changed.
  2. You have a test script and know what the final state of the app should be after running this script. So you create a bitmap picture (using Remote Zooming or the ts_savescreenrect function) and check at the end of your script that the screen is equal to this bitmap file (using ts_checkscreenrect).
  3. You can check results of your script by checking the color of some coordinates (using ts_getpixel).
  4. You can check the text in windows controls (using ts_gettext).

Conclusion

All in all Pocket PC TestSuite has saved us hours of testing. It also ensures, after making changes to code, that we don't get too far down the road and then discover that we 'broke' something at some point and can't figure out when that was?

Price

Pocket PC testSuite is $200 but you can get a 5% discount using this code 357F8W25.

Read about the 5% discount on Pocket PC TestSuite through DEVBUZZ.

Previous Page

Back to .NET Compact Framework | [Article Index]

 

Back to the top of the page.
Chris De Herrera's Windows CE Website Windows CE News & Information Source
Copyright ©2000-2007 by DEVBUZZ.COM, Inc., NJ. USA.MSDEVELOP