DeenseDog
(Lurker)
2003-12-22 12:05 PM
how to automate user simulation

Hello, I just freshly arrived here, have worked ages ago with IBM's (OS/2 an later Win) WITT (workstation interactive testing tool) and am now looking how I can automate application configuration, testing, data conversion and any user simulation. Can you tell me where I can quickly find what KiXtart can do for me and whether I need to buy the book "The Start To Finish Guide to Scripting with KiXtart [DOWNLOAD: PDF] - Bob Kelly " to get up to speed.
TIA / Marcel NL



Richard H.Administrator
(KiX Supporter)
2003-12-22 12:26 PM
Re: how to automate user simulation

KiXtart on it's own is not a great tool for user simulation.

If you partner it with AutoIT it becomes much more useful - you can write simple stand-alone AutoIT scripts, or control it via the AutoITX.dll ActiveX control.

You can download AutoIT from here.


DeenseDog
(Lurker)
2003-12-22 12:38 PM
Re: how to automate user simulation

tnx Richard,
I'll try it. Do you know how it compares to REXX in ease of use?


Richard H.Administrator
(KiX Supporter)
2003-12-22 01:21 PM
Re: how to automate user simulation

I don't know REXX so cannot compare them.

AutoIT is a very simple scripting language which you will take to immediately if you have done any sort of scripting before. Loops and control structures are rudimentary, and the only variables available are environment variables.

The control over windows and the mouse is pretty good.

The best thing is to download it and read the help files.

If you need a more fully featured language, use the AutoITX ActiveX DLL and control it from WSH, VBScript or KiXtart.


Richard H.Administrator
(KiX Supporter)
2003-12-22 04:08 PM
AutoIT demo (was: how to automate user simulation)

Here, for a bit of a giggle, is probably one of the least useful scripts I have ever written.

It uses the AutoIT ActiveX object to play with the mouse.

When you run the script, leave the mouse idle for $dWaitForIt seconds. Moving the mouse will calm it down again

; AutoIT ActiveX component demo.
;
; This rather silly demo shows KiXtart controlling an AutoIT object.
;
; Author: Richard Howarth (rhowarth@sgb.co.uk)
;
; Requires: KiXtart 4.20
; AutoIt ActiveX control
;
$gNull=SetOption("Explicit","ON")
$gNull=SetOption("ASCII","ON")

Dim $oAI
Dim $iX,$iY,$iLastX,$iLastY
Dim $dInterval,$dStill,$dWaitForIt
Dim $iBoundX,$iBoundY
Dim $dLimitX,$dLimitY
Dim $iStartX,$iStartY
Dim $dMadness

SRnd(@MSECS) ; Seed random - it doesn't need to be too clever.

$dInterval="0.02" ; Period between mouse polls
$dWaitForIt=5.0 ; Period before mouse jiggle effect (in seconds)

$dMadness=0.05 ; Rate of mouse deterioration
$iBoundX=200 ; Limit of jiggle in X direction
$iBoundY=200 ; Limit of jiggle in Y direction

$oAI=CreateObject("AutoItX.Control")
If Not $oAI "ERROR: Cannot create AutoItX control." ? Exit 1 EndIf

"Jiggy mouse in action!" ?

While Not KBHit()
$iX=$oAI.MouseGetPosX()
$iY=$oAI.MouseGetPosY()
If $iX=$iLastX AND $iY=$iLastY
If $dStill>0
$iStartX=$iX
$iStartY=$iY
$dLimitX=1.0 $dLimitY=1.0
$dStill=$dStill-$dInterval
Else
If $dLimitX<$iBoundX $dLimitX=$dLimitX+$dMadness EndIf
If $dLimitY<$iBoundY $dLimitY=$dLimitY+$dMadness EndIf
$iX=$iStartX+Rnd($dLimitX*2)-$dLimitX
$iY=$iStartY+Rnd($dLimitY*2)-$dLimitY
$oAI.MouseMove($iX,$iY)
EndIf
Else
$dStill=CDbl($dWaitForIt) ; Reset "in motion" counter.
EndIf
; Chr(13)+"MouseX="+$iX+" MouseY="+$iY+" "
$iLastX=$oAI.MouseGetPosX()
$iLastY=$oAI.MouseGetPosY()
$gNull=Rnd()
Sleep($dInterval)
Loop

Get $gNull

? "Bye." ?

; vim: ai sw=3 ts=3


Sealeopard
(KiX Master)
2003-12-22 04:15 PM
Re: AutoIT demo (was: how to automate user simulation)

Now integrate this with Microsofts Text-to-Speech engine and have the mouse say a "Don't touch me!" when the user tries to "calm down" the mouse again

Richard H.Administrator
(KiX Supporter)
2003-12-22 04:28 PM
Re: AutoIT demo (was: how to automate user simulation)

Quote:

Now integrate this with Microsofts Text-to-Speech engine and have the mouse say a "Don't touch me!" when the suer tires to "calm down" the mouse again




Yeah, I've got one of those in my house too (at regular intervals).

A couple of other things I forgot
  1. Hitting (almost) any key will exit the script
  2. The effect will work even if the script is not the active window. Start it on a co-workers machine and minimise the window for a laugh.


Sealeopard
(KiX Master)
2003-12-22 04:37 PM
Re: AutoIT demo (was: how to automate user simulation)

Remove the console output and run as a scheduled task via WKIX32, then you won't have a window at all.

Richard H.Administrator
(KiX Supporter)
2003-12-22 04:44 PM
Re: AutoIT demo (was: how to automate user simulation)

Quote:

Remove the console output and run as a scheduled task via WKIX32, then you won't have a window at all.




The script is intended to educate and amuse, not drive some poor devil into a padded cell