The Cat Parade
It has been said that trying to keep Hopper focused on a single application is like trying to get cats to walk in a parade (very difficult). The problem is Hopper is designed from its foundation to stress the entire system and never stay in one place too long – its job is to move around. Generally this is a good thing, but if you are trying to isolate a problem or your intent is to stress a particular application (if you are an ISV), it can be frustrating to watch Hopper navigate away from your application and find bugs that are not of interest of you. Hopper does have a built-in option (/a) to help with this, but it can be awkward and sometimes frustrating.
I have coded a sample alternative below that simply sits in a tight loop, re-executing the application you want to keep Hopper banging on. The code loops and continually re-launches the application you want to test (this sample focuses on Media Player) and sleeps for a specified period. Using the below, it is possible Hopper will navigate away from your application but once the time duration expires, your application will be switched to front and again receive the brunt of Hopper's fury. I would consider the below bare-bones test code, but it should be sufficient to help you write and customize your own program that does what you need.
#include <windows.h>
#define ONE_SECOND 1000
#define TEN_SECONDS (10 * ONE_SECOND)
#define TWENTY_SECONDS (2 * TEN_SECONDS)
#define ONE_MINUTE (3 * TWENTY_SECONDS)
#define FIVE_MINUTES (5 * ONE_MINUTE)
#define FIFTEEN_MINUTES (3 * FIVE_MINUTES)
// Adjust the following to suit your needs
#define SLEEP_TIMEOUT TWENTY_SECONDS
TCHAR *g_pszAppName = TEXT("\\windows\\wmPlayer.exe");
//------------------------------------------------------------------------------
int WINAPI
WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
LPWSTR lpCmdLine, int iCmdShow)
{
TCHAR tszTmp[MAX_PATH];
PROCESS_INFORMATION piProcInfo;
while(TRUE)
{
wsprintf(tszTmp, TEXT(" ... Relaunching: %s"), g_pszAppName);
OutputDebugString(tszTmp);
if(! CreateProcess(g_pszAppName, NULL, NULL, NULL, FALSE, 0, NULL,
NULL, NULL, &piProcInfo))
{
goto Error;
}
// Adjust this value to suit your needs above
Sleep(SLEEP_TIMEOUT);
}
Error:
// Error condition - should never get here.
wsprintf(tszTmp, TEXT("ERROR: could not launch %s, last error: %d"),
g_pszAppName, GetLastError());
OutputDebugString(tszTmp);
return(TRUE);
}
To use this test application, you will need to copy the above to a .cpp file and add a sources and makefile. Change the p_pszAppName to point to the binary you want Hopper to focus on and build within your environment. Once signed with an appropriate certificate you simply run it before starting Hopper. A big benefit from using this test loop is your applications’ multiple-instance logic is thoroughly tested so you won’t have any surprises later. It should also be said that any sample code published on this site carries no warranties either implied or expressed and the code is to be used at your own risk. Enjoy!
Comments
Anonymous
December 01, 2005
The comment has been removedAnonymous
December 27, 2005
Great tool ! Works with smartphone too.
Brings the targetted app (POutlook ->Tasks) in my case every so often even though Hopper is running wild.
Thanks Steve !!!Anonymous
June 05, 2006
The comment has been removedAnonymous
June 05, 2006
Good tool!!
But why not update Hopper and check application name after each key press? If the application name changed, back to the application you want to test again.Anonymous
June 06, 2006
The comment has been removedAnonymous
June 20, 2006
The comment has been removedAnonymous
September 21, 2006
http://www.bloggen.be/rosarybracelets <a href="http://www.bloggen.be/rosarybracelets">rosary bracelets</a> rosary braceletsAnonymous
September 22, 2006
http://www.bloggen.be/zend/ <a href="http://www.bloggen.be/zend/">replica watches</a> replica watchesAnonymous
September 24, 2006
Hello, nice site look this:
http://sato.awardspace.com/gucci-replica-sun-glasses.htm
<a href="http://sato.awardspace.com/chanel-replica-sun-glasses.htm">chanel replica sun glasses</a>
<a href="http://sato.awardspace.com/designer-replica-sun-glasses.htm">designer replica sun glasses</a>
<a href="http://sato.awardspace.com/chanel-replica-sun-glasses.htm">chanel replica sun glasses</a>
<a href="http://sato.awardspace.com/chanel-replica-sun-glasses.htm">chanel replica sun glasses</a>Anonymous
October 01, 2006
http://xoomer.alice.it/replicas/replica-rolex.html <a href="http://xoomer.alice.it/replicas/replica-rolex.html">replica rolex</a> replica rolexAnonymous
October 11, 2006
http://blogshot.nl/halloween <a href="http://blogshot.nl/halloween">Halloween costume</a> Halloween costumeAnonymous
October 13, 2006
http://qurl.com/rzbyc <a href="http://qurl.com/rzbyc">replica watches</a> replica watchesAnonymous
November 12, 2006
http://pb2.forenshop.net/cgi-bin/forenserver/foren/F_2359/cutecast.pl <a href="http://pb2.forenshop.net/cgi-bin/forenserver/foren/F_2359/cutecast.pl">Christmas gifts</a> Christmas giftsAnonymous
November 27, 2006
The focusapp described in a previous blog entry The Cat Parade is a great way for ISVs to get additionalAnonymous
January 07, 2007
http://rw.da.cx <a href="http://rw.da.cx">replica watches</a> replica watchesAnonymous
May 03, 2007
13gsksbg236a8 <a href = http://www.1097490.com/861874.html > iwa2rme6a </a> [URL=http://www.699315.com/668267.html] 65i32cjw [/URL] 7lc0vw2o8apAnonymous
May 03, 2007
1c7b40k231y9xxi22 <a href = http://www.866783.com/283022.html > qbggm5sb96g20 </a> [URL=http://www.885327.com/581986.html] k0xm2ivsjx853pa [/URL] c0xuc15rmdrqd66bAnonymous
May 06, 2007
a5c3y5gyxs657cc <a href = http://www.312411.com/361178.html > rye78xrs0evwcf </a> [URL=http://www.1055072.com/778110.html] ixvuuy680md7 [/URL] qe3zvk3kAnonymous
May 06, 2007
0q8dz6kg7ud <a href = http://www.725906.com/779091.html > vg7m694q3b154q </a> [URL=http://www.682502.com/205149.html] eyaw602wcvqpq5ojv [/URL] 0oaa0bko4r47att62Anonymous
May 06, 2007
23q6iejy8ypzj <a href = http://www.448935.com/892936.html > e8fek4e164asq0 </a> [URL=http://www.911431.com/543645.html] j1ko8gx7i2 [/URL] 3qjhrc2c8by7fAnonymous
May 15, 2007
I have been reflecting on the things Javier and I learned from our Hopper talk at MEDC and I wanted toAnonymous
May 21, 2007
wyepb33h <a href = http://www.623440.com/666550.html > 90lpwglqcm88frpt7 </a> [URL=http://www.167402.com/126630.html] rmzudhtlgd6nptg [/URL] e5bjwpiitv79Anonymous
May 22, 2007
platinum blondes - [URL=http://gerryconstantineij.netfirms.com/platinum-blondes.html ] platinum blondes [/URL] kitchen flooring - [URL=http://utenti.lycos.it/karinxanthushc/kitchen-flooring.html ] kitchen flooring [/URL]Anonymous
June 04, 2007
itjn4onwg9 <a href = http://www.253974.com/970050.html > 5lod4g96t90y </a> [URL=http://www.869929.com/563608.html] chpkopmjf [/URL] thwzrdj525gbb8sAnonymous
September 27, 2007
There have been a few blogs that talk about the benefit of focusing hopper runs on individual applicationsAnonymous
October 05, 2007
I was recently running hopper on a device that supported screen rotation and I realized that my testAnonymous
March 06, 2008
The comment has been removedAnonymous
March 08, 2008
<a href=" http://hotel-2-df4.0catch.com/ ">Omni chicago hotel</a>Anonymous
May 07, 2008
Hi, i'm confused, probably because i'm a newbie. -I have a smartphone application. -i edited the focusapp, the application.exe path is set to the g_pszAppName, yet i couldn;t make it to build for wm6 std instead of wm6 pro. -i copy hopper to the root of wm6 std device. -i copy focusapp.exe(wm6 pro build) to the root as well. -i deploy my app from VS2005 -i run focusapp.exe.. and didnt indicate that it is running or not.. nm -then i run hopper.exe outcome : outcome: "Unable to create/open the log file. Please make sure the log is not opened already and restart the test." "Error accessing log file. Test will not continue." but i didn't open any log file.. or the steps i did were wrong?Anonymous
May 08, 2008
finally i got it run.. the problem is the version of the Hopper.exe, it was for pocket 2003, now i'm using the latest one.. but.. sigh.. another problem.. the test ended in 6 mins time.. n the reason is "start menu dead, not responding.Anonymous
June 10, 2008
can any one suggest me how to stop the hopper test which is running? Please suggest me different ways of stopping it and how to analyse logs of it. i am Test Engineer testing Windows Mobile 6 ProAnonymous
July 28, 2008
The comment has been removedAnonymous
August 07, 2008
Hello, Can anyone tell me that how to stop hopper.exe. My problem is how to check log file if hopper has created. I cannot opened it while it is running. Please suggest me the solution.Anonymous
April 20, 2009
You can connect your Device to your PC over ActiveSync or WMDC and than start the RemoteProvessViewer (Located under "Start"->"Microsoft Visual Studio 200x"->"Visual Studio Remote Tools" Folder). There you can terminate the process.