Mini Kabibi Habibi

Current Path : C:/Users/ITO/Desktop/VF9/program files/microsoft visual foxpro 9/tools/test/
Upload File :
Current File : C:/Users/ITO/Desktop/VF9/program files/microsoft visual foxpro 9/tools/test/aatest.sct

�gVERSION =   3.00aatest.hdataenvironmentdataenvironmentDataenvironment_Top = 220
Left = 1
Width = 520
Height = 200
DataSource = .NULL.
Name = "Dataenvironment"
12formsetformsetfrstestharn�DataSession = 2
AutoRelease = .T.
otoolbar = 
cstate = 0
lsuspend = .F.
oglobal = 
ceventlogfile = 
ovfp = 
ctestcaption = 
ctestname = 
trectime = 
ccurrformname = 
clastevent = 
lerror = .F.
lmenuclicked = .F.
nlastmousex = 0
nlastmousey = 0
nruncount = 1
ntestid = 0
ntestrun = 1
ntestapphwnd = 0
nfrmheight = 0
nfrmleft = 0
nfrmtop = 0
nfrmwidth = 0
nappleft = 0
napptop = 0
cstateprev = 0
cguid = 
ndelay = 0
nmemoryusage = 0
nduration = 0
ncachesize = 20
nhistcnt = 0
ccurrwinname = 
cfoxerror = 
lplaypaused = .F.
nplaypausedline = 0
nplaypausedrun = 0
nplaypausedscriptrecno = 0
lplayinsert = .F.
nplayinsertline = 0
nplayinsertscriptrecno = 0
nscreenleft = 0
nscreentop = 0
Name = "frstestharn"
�-PROCEDURE cstate_assign
LPARAMETERS vNewVal

*-- Prev state
This.cStatePrev = THIS.cState

THIS.cState = m.vNewVal

*-- On changing the state value, the screen objects needs to  be enabled/disabled
*-- according to the value (check has been done in refresh of each objects)
Thisformset.Refresh

ENDPROC
PROCEDURE record
WITH This

	IF .RecordBegin()
		*-- Change the state
		.cState = Cc_StateRecord
	ENDIF

ENDWITH

RETURN

ENDPROC
PROCEDURE recordbegin
WITH This

	LOCAL nhWnd, oAccvfp, oAcc, nRetval, cRecOnScript, lContinue, oExternalVFP, cTmpStr
	
	lContinue = .t.
	.lError = .f.

	.cEventLogFile = SYS(2023)+ "\" + SYS(2015) + ".txt"

	TEXT TO cTmpStr NOSHOW TEXT PRETEXT 14
		"SYS(2801,3)" + CHR(13) +
		"SET EVENTLIST TO MOUSEUP, MOUSEDOWN, keypress"  + CHR(13) +
		"SET EVENTTRACKING TO [<<.cEventLogFile>>]"  + CHR(13) +
		"SET EVENTTRACKING ON"
	ENDTEXT
	cRecOnScript = [EXECSCRIPT(] + cTmpStr + [)]

	DO CASE
		CASE .lPlayInsert
			*-- We are inserting from the point where play was paused
			nhWnd = .nTestAppHWnd
		
		CASE .frmMain.pgfmain.Page2.chkNewVFP.Value
			*-- If always to load new VFP instance while recording
			oExternalVFP = CREATEOBJECT("visualfoxpro.application")
			oExternalVFP.Visible=.T.

			*-- Reselect the foreground window
			SetForegroundWindow(_screen.hwnd)
			nhWnd = oExternalVFP.hWnd
		OTHERWISE
			nhWnd = .oGlobal.SelApplication(.frmMain.HWnd)
	ENDCASE

	lContinue = (m.nhWnd > 0)

	IF lContinue
		* Get VFP Session handle
		oAcc = 0
		nRetval = AccessibleObjectFromWindow(m.nhWnd, OBJID_CLIENT, .cguid, @oacc)
		oAccvfp = oacc

		IF .frmMain.pgfmain.Page2.chkNewVFP.Value
      THIS.oVFP = oExternalVFP
    ELSE

      IF TYPE("oaccvfp.accchild(int(2^31-1))") # "U"
	  		THIS.oVFP = oaccvfp.accchild(int(2^31-1))
  		ENDIF

    ENDIF

		DO CASE
			CASE NOT (TYPE("This.oVFP.Name") # "U" AND This.oVFP.Name = "Microsoft Visual FoxPro")
				*-- If its not VFP application
				MESSAGEBOX(MSG_NONVFP_LOC, WINDOWTITLE_LOC, 16)
				lContinue = .f.
			CASE .oVFP.StartMode > 1
				*-- Runtime libraries
				MESSAGEBOX(MSG_RUNTIME_LOC, WINDOWTITLE_LOC, 16)
				lContinue = .f.
		ENDCASE

	ENDIF

	lContinue = lContinue AND NOT .lError AND .GetTestInfo()
	IF lContinue
		
		*-- Restore the window if its minimized
		IF .oVFP.Eval("_SCREEN.WindowState") = 1
			.oVFP.DoCmd("_SCREEN.WindowState = 2")
		ENDIF

		*-- Store the application co-ordinates so that it can be played back
		*-- relative to the new position
		.nAppLeft = .ovfp.left
		.nAppTop  = .ovfp.top
		.nScreenLeft = .oVFP.Eval("_SCREEN.Left")
		.nScreenTop  = .oVFP.Eval("_SCREEN.Top")

		*-- Turn on the event loggin in the AA client
		.oVFP.DoCmd(cRecOnScript)

		SetForegroundWindow(nhWnd)
	ENDIF

ENDWITH

RETURN lContinue
ENDPROC
PROCEDURE recordend
WITH This
	LOCAL	cRecOffScript, ;
			cCaption, ;
			cPreScript,;
			cTmpStr
			
	LOCAL ARRAY	aTestId[1]

	cCaption = .cTestCaption

	TEXT TO cTmpStr NOSHOW TEXT PRETEXT 14
		"SET EVENTTRACKING TO"  + CHR(13) +
		"SET EVENTTRACKING OFF" + CHR(13) +
		"SET EVENTLIST TO"
	ENDTEXT
	
	cRecOffScript = [EXECSCRIPT(] + cTmpStr + [)]

	cPreScript = ""

	*-- Pre script--------------------------begin
	TEXT TO cPreScript NOSHOW
	LPARAMETERS oApp

	* Setup Vars
	LOCAL oVFP
	oVFP = oApp.oVFP

	* Setup Environment
	oVFP.DoCmd("SYS(2800,16 + 1)")
	ENDTEXT
	*-- Pre script--------------------------end

	*-- Reset the AA settings only if the 2nd VFP application is not closed
	IF TYPE("Thisformset.oVFP.Caption") = "C"
		.oVFP.DoCmd(cRecOffScript)
	ENDIF

	IF NOT .lPlayInsert
		SELECT aascripts

		*-- Unselect all the scripts and select the currently recorded ones
		REPLACE ALL selected WITH .F.

		LOCATE FOR UPPER(desc) = UPPER(LEFT(This.cTestName, LEN(desc)))

		IF FOUND()
			REPLACE evtlog WITH filetostr(.cEventLogFile), ;
					caption WITH cCaption, ;
					rectime WITH .tRectime
		ELSE
			SELECT MAX(id) FROM aascripts INTO ARRAY aTestId
			aTestid = IIF(EMPTY(aTestId), 1, aTestId + 1)

			INSERT INTO aascripts (id, name, desc, evtlog, prescript, postscript, caption, rectime) ;
										VALUES (aTestId, ;
										.cTestName,.cTestName,;
										FILETOSTR(.cEventLogFile), cPreScript, "",;
										cCaption, ;
										.tRectime)
		ENDIF

		*-- store the application (_VFP) co-ordinates
		REPLACE AppLeft WITH .nAppLeft, ;
				AppTop  WITH .nAppTop, ;
				ScreenLeft WITH .nScreenLeft, ;
				ScreenTop  WITH .nScreenTop, ;
				selected WITH .T.
	
	ENDIF

	*-- Parse the script and update the "script" field
	.ScriptParse()

	*-- After parsing we would have fully handled inserting a new recording.
	*-- So go ahead.
	.lPlayInsert = .f.

	ERASE (.cEventLogFile)
ENDWITH
ENDPROC
PROCEDURE play
LOCAL	lContinue, ;
		oAcc, ;
		nRetval

lContinue = .t.

WITH This

	.lError = .f.
	.oVFP   = NULL

	IF NOT .lPlayPaused
		SELECT aascripts

		LOCATE FOR selected

		IF NOT FOUND()
			MESSAGEBOX(MSG_NOSCRIPT2_LOC, WINDOWTITLE_LOC, 16)
			lContinue = .f.
		ENDIF

		IF lContinue

	      *-- If checked to create a new instance of VFP
	      IF .frmMain.pgfmain.Page2.chkNewVFP.Value
	      
	        .oVFP = CREATEOBJECT("visualfoxpro.application")
	        .nTestAppHWnd = .oVFP.hWnd
	        .oVFP.Visible=.T.

	      ELSE
	  			.nTestAppHWnd = .oGlobal.SelApplication(.frmMain.HWnd)
	  			*-- don't proceed if there is no applications selected
	  			lContinue = (.nTestAppHWnd > 0)
	      ENDIF

		ENDIF

		IF lContinue

			oAcc = 0

			**
			nRetval = AccessibleObjectFromWindow(.nTestAppHWnd, OBJID_CLIENT, .cguid, @oAcc)

      IF NOT .frmMain.pgfmain.Page2.chkNewVFP.Value

        IF TYPE("oacc.accchild(int(2^31-1))") # "U"
          .oVFP = oAcc.accchild(int(2^31-1))
        ENDIF

      ENDIF

			DO CASE
				CASE NOT (TYPE("This.oVFP.Name") # "U" AND This.oVFP.Name = "Microsoft Visual FoxPro")
					*-- If its not VFP application
					MESSAGEBOX(MSG_NONVFP_LOC, WINDOWTITLE_LOC, 16)
					lContinue = .f.
				CASE .oVFP.StartMode > 1
					*-- Runtime libraries
					MESSAGEBOX(MSG_RUNTIME_LOC, WINDOWTITLE_LOC, 16)
					lContinue = .f.
			ENDCASE

		ENDIF
		
	ENDIF && NOT .lPlayPaused

	IF lContinue AND NOT .lError

		*-- Turn on coverage logging
		IF This.frmMain.pgfmain.Page4.chkcovelogon.Value AND NOT EMPTY(.cCoverLogFile)

			IF This.frmMain.pgfmain.Page4.chkoverwritecovlog.Value
				 .oVFP.DoCmd("SET COVERAGE TO " + .cCoverLogFile)
			ELSE
				 .oVFP.DoCmd("SET COVERAGE TO " + .cCoverLogFile + " ADDITIVE")
			ENDIF

		ENDIF			 

		SetForegroundWindow(.nTestAppHWnd)

		.cState = Cc_StatePlay
		.lError = .f.

		.PlayLoop()

		IF .lPlayPaused
			.cState = Cc_StatePlayPause
		ELSE
		
		 	*-- Reset the coverage logging
			IF This.frmMain.pgfmain.Page4.chkcovelogon.Value AND NOT EMPTY(.cCoverLogFile)
				 .oVFP.DoCmd("SET COVERAGE TO ")
			ENDIF		 

			*-- Bring back the test application
			SetForegroundWindow(_VFP.hWnd)

			IF .lError
				This.frmMain.edtStatus.Value = This.frmMain.edtStatus.Value + MSG_PLAYBACKERROR_LOC + MSG_PLAYBACK10_LOC + CHR(13)
			ELSE
				This.frmMain.edtStatus.Value = This.frmMain.edtStatus.Value + MSG_RUNS_OVER_LOC + CHR(13)
			ENDIF
			
			.cState = Cc_StateIdle

		ENDIF

	ENDIF
	
ENDWITH

RETURN
ENDPROC
PROCEDURE playbegin
*-- Do the processing before start playing the script

*-- empty the errorlog cursor
ZAP IN errorlist

WITH This
	*-- Record the begining memory and time
	.nDuration = SECONDS()
	.nMemoryUsage = .oVFP.Eval(SYS(1016))
	.cFoxError = .oVFP.Eval("MESSAGE()")

	.nHistcnt = 0
	DIMENSION .ahist[.nCacheSize,2]

	* Run PreScript
	IF !EMPTY(ALLTRIM(aascripts.prescript))
		EXECSCRIPT(aascripts.prescript,THIS)
		SLEEP(1000)
	ENDIF

ENDWITH
ENDPROC
PROCEDURE playend
LOCAL cErrorLogFile

LOCAL ARRAY aTestId[1]

*-- log the error

cErrorLogFile = SYS(2015)+".txt"

WITH This

	*-- If there is no error
	IF NOT .lError
		* Run PostScript
		*-- 1. if there is no error
		*-- 2. if the second VFP application is not closed
		IF !EMPTY(aascripts.postscript) AND NOT .lerror AND TYPE("Thisformset.oVFP.Caption") = "C"
			SLEEP(2000)
			EXECSCRIPT(aascripts.postscript,THIS)
		ENDIF

		.nDuration = SECONDS() - .nDuration
		
		SLEEP(1500)

		.LogError(MSG_TESTPASSED_LOC, Cc_TestPassed)
	ELSE
		.nDuration = SECONDS() - .nDuration
	ENDIF

	*-- If the 2nd VFP application is closed
	IF TYPE("Thisformset.oVFP.Caption") = "C"
		.nMemoryUsage = .oVFP.Eval(SYS(1016)) - .nMemoryUsage
	ELSE
		.nMemoryUsage = 0
	ENDIF

	SELECT errorlist

	COPY FIELD errormsg TO (cErrorLogFile) TYPE SDF

	SELECT MAX(testid) FROM aatestlog INTO ARRAY aTestId
	aTestid = IIF(EMPTY(aTestId), 1, aTestId + 1)

	INSERT INTO aatestlog (testid, scriptid, iterno, name, notes, results, passed, objcount, memuse, duration, playtime) ;
			VALUES(aTestid, .ntestid, .ntestrun, aascripts.desc, ;
			"", FILETOSTR(cErrorLogFile), NOT .lError, 0, .nMemoryUsage, .nDuration, DATETIME())

	ERASE (cErrorLogFile)

	IF NOT .lError AND TYPE("Thisformset.oVFP.Caption") = "C"
        cMessage = MSG_TESTRUN_LOC
        This.oVFP.DoCmd("MESSAGEBOX([" + cMessage + "],0, [" + WINDOWTITLE_LOC + "], 10000)")
	ENDIF

ENDWITH

RETURN
ENDPROC
PROCEDURE recordstop
WITH This

	IF .cState = Cc_StatePlay
		*-- stop playing??
	ELSE
		.RecordEnd()
	ENDIF

	.cState = Cc_StateIdle

ENDWITH

ENDPROC
PROCEDURE recordpause
LPARAMETERS lPaused

LOCAL cRecPauseScript,cTmpStr 

WITH ThisformSet

	*-- If already in Pause, resume recording
	IF lPaused
		TEXT TO cTmpStr NOSHOW TEXT PRETEXT 14
			"SET EVENTTRACKING TO"  + CHR(13) +
			"SET EVENTTRACKING OFF" + CHR(13) +
			"SET EVENTLIST TO"
		ENDTEXT
		cRecPauseScript = [EXECSCRIPT(] + cTmpStr + [)]
		.oVFP.DoCmd(cRecPauseScript)
		.cState = Cc_StateRecordPause
	ELSE
		TEXT TO cTmpStr NOSHOW TEXT PRETEXT 14
			"SET EVENTTRACKING TO [<<.cEventLogFile>>] ADDITIVE"  + CHR(13) +
			"SET EVENTTRACKING ON" + CHR(13) +
			"SET EVENTLIST TO MOUSEUP, MOUSEDOWN, keypress"
		ENDTEXT
		cRecPauseScript = [EXECSCRIPT(] + cTmpStr + [)]
		.oVFP.DoCmd(cRecPauseScript)
		.cState = Cc_StateRecord
	ENDIF

ENDWITH

RETURN

ENDPROC
PROCEDURE recordinsscript
WITH This
	*-- Turn of indication that play was paused
	.lPlayPaused = .f.
	
	*-- Transfer all play paused values to insert values
	.nPlayInsertLine = .nPlayPausedLine
	.nPlayInsertScriptRecno = .nPlayPausedScriptRecno

	*-- Turn on play insertion
	.lPlayInsert = .t.
	
	*-- Now start the recording.
	= .Record()
ENDWITH

RETURN

	
	
ENDPROC
PROCEDURE vieweventlog
LOCAL cWindow

SELECT aaScripts

*-- If the control is not in a record, search of selected status
IF EOF("aaScripts")
	LOCATE FOR selected
ENDIF

*-- If there record is in eof and there is no script selected
IF EOF("aaScripts")
	MESSAGEBOX(MSG_SELSCRIPT_LOC, 0, WINDOWTITLE_LOC)
ELSE
	ThisformSet.cState = Cc_StateViewEventLog

	DEFINE WINDOW cWindow FROM 5,10 TO 40, 90 ;
		SYSTEM CLOSE GROW FLOAT ZOOM TITLE "Edit Script"

	MODIFY MEMO aaScripts.script WINDOW cWindow

	ThisformSet.cState = Cc_StateIdle
ENDIF

RETURN

ENDPROC
PROCEDURE launchvfp
LOCAL oExternalVFP

oExternalVFP = CREATEOBJECT("visualfoxpro.application")

oExternalVFP.Visible = .T.

RETURN
ENDPROC
PROCEDURE abort
WITH Thisformset
*	SET STATUS BAR ON
	.oGlobal = .NULL.
	.oToolBar = .NULL.
	
	nFormCount = THIS.FormCount

	FOR I = nFormCount TO 1 STEP -1
		.Forms(i).Release
	ENDFOR
	
	.Release
ENDWITH
ENDPROC
PROCEDURE launchhelp
LOCAL oBrowser

oBrowser=CREATEOBJECT("internetexplorer.application")
oBrowser.navigate(FULLPATH("")+'aatesthelp.htm')
oBrowser.Visible = .t.

RETURN
ENDPROC
PROCEDURE gettestinfo
LOCAL	lReturn

lReturn = .t.

WITH This

	.cTestName = ""

	.trectime = DATETIME()

	*-- if there is a form exists
	IF TYPE('.oVFP.Forms(1).Caption') = "C"
		.cTestCaption = .oVFP.Forms(1).Caption
	ELSE
		*-- If there is no form exists, just store the VFP window name
		.cTestCaption = .oVFP.Caption
	ENDIF

	DO WHILE NOT .lPlayInsert
		.cTestName = INPUTBOX(MSG_TESTNAME_LOC, WINDOWTITLE_LOC, .cTestName)
		
		*-- If its cancelled 
		IF EMPTY(.cTestName)
			lReturn = .f.
			EXIT
		ENDIF

		SELECT aascripts

		LOCATE FOR UPPER(desc) = UPPER(LEFT(.cTestName, LEN(desc)))
		
		IF FOUND()
			
			*-- If overwrite script has been checked
			IF NOT This.frmMain.pgfmain.Page2.chkOverwriteScript.Value AND ;
				MESSAGEBOX(MSG_SCRIPTEXIST_LOC, WINDOWTITLE_LOC, 4+32) = 7
				LOOP
			ELSE
				EXIT	
			ENDIF
			
		ELSE
			EXIT
		ENDIF
			
	ENDDO
	
ENDWITH

RETURN lReturn
ENDPROC
PROCEDURE hex2val
LPARAMETERS cstr
LOCAL lcChars
lcChars = "0123456789abcdef"
RETURN (ATC(LEFT(m.cstr, 1), lcChars) - 1) * 16 + (ATC(RIGHT(m.cstr, 1), lcChars) - 1)

ENDPROC
PROCEDURE str2guid
LPARAMETERS cstr
LOCAL i, lcguid
lcguid = CHR(THIS.hex2val(SUBSTR(m.cstr,7,2))) + CHR(THIS.hex2val(SUBSTR(m.cstr,5,2))) +;
	CHR(THIS.hex2val(SUBSTR(cstr,3,2))) + CHR(THIS.hex2val(SUBSTR(m.cstr,1,2))) +;
	CHR(THIS.hex2val(SUBSTR(cstr,12,2))) + CHR(THIS.hex2val(SUBSTR(m.cstr,10,2))) +;
	CHR(THIS.hex2val(SUBSTR(cstr,17,2))) + CHR(THIS.hex2val(SUBSTR(m.cstr,15,2))) + ;
	CHR(THIS.hex2val(SUBSTR(cstr,20,2))) + CHR(THIS.hex2val(SUBSTR(m.cstr,22,2)))
FOR i = 0 TO 5
	lcguid = lcguid + CHR(THIS.hex2val(SUBSTR(m.cstr, 25 + m.i * 2, 2)))
ENDFOR
RETURN lcguid

ENDPROC
PROCEDURE doclick
LPARAMETERS cMouseEvent, cMouseEventId, lMouseDownUp,x,y, nShiftCtrlAlt 

DO CASE
  CASE nShiftCtrlAlt = 1
	*-- Shift down
	KEYBD_EVENT(VK_LSHIFT,0,0,0)
  CASE nShiftCtrlAlt = 2
	*-- Ctrl down
	KEYBD_EVENT(VK_LCONTROL,0,0,0)
  CASE nShiftCtrlAlt = 4
  *-- Alt down - not handled now which brings up help
ENDCASE

IF INLIST(cMouseEventId, "000000A4", "00000204","000000A5", "00000205") && right mouse

	IF lMouseDownUp OR cMouseEvent = "MouseDown"
		THIS.sendmouse(MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_MOVE + MOUSEEVENTF_RIGHTDOWN, ;
			m.x * 65536 / SYSMETRIC(1), m.y * 65536 / SYSMETRIC(2))
	ENDIF

	IF lMouseDownUp OR cMouseEvent = "MouseUp"
		THIS.sendmouse(MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_MOVE + MOUSEEVENTF_RIGHTUP, ;
			m.x * 65536 / SYSMETRIC(1), m.y * 65536 / SYSMETRIC(2))
	ENDIF

ELSE

	IF lMouseDownUp OR cMouseEvent = "MouseDown"
		THIS.sendmouse(MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_MOVE + MOUSEEVENTF_LEFTDOWN, ;
			m.x * 65536 / SYSMETRIC(1), m.y * 65536 / SYSMETRIC(2))
	ENDIF

	IF lMouseDownUp OR cMouseEvent = "MouseUp"
		THIS.sendmouse(MOUSEEVENTF_ABSOLUTE + MOUSEEVENTF_MOVE + MOUSEEVENTF_LEFTUP, ;
			m.x * 65536 / SYSMETRIC(1), m.y * 65536 / SYSMETRIC(2))
	ENDIF

ENDIF

DO CASE
  CASE nShiftCtrlAlt = 1
	*-- Shift down
	KEYBD_EVENT(VK_LSHIFT,0,KEYEVENTF_KEYUP,0)
  CASE nShiftCtrlAlt = 2
	*-- Ctrl down
	KEYBD_EVENT(VK_LCONTROL,0,KEYEVENTF_KEYUP,0)
  CASE nShiftCtrlAlt = 4
  *-- Alt down - not handled now which brings up help
ENDCASE

RETURN
ENDPROC
PROCEDURE dotheevent
PARAMETERS oAcc, cEpath , cEvent, nx, ny, lFormTitleBar

LOCAL nXOffset, ;
      nYOffset, ;
      lMouseDownUp, ;
      nMouseX, ;
      nMouseY, ;
      nShiftCtrlAlt

STORE 0 TO nXOffset, nYOffset, nMouseX, nMouseY, nShiftCtrlAlt

lMouseDownUp = .t.  && whether to play mouse down/up together

DO CASE
	CASE event="KeyPress"
		*-- VFP keyboard events are mereged with win keypress

		*-- Repeat the keystrokes if its multiple at the same time
		FOR nRepeatCount = 1 TO nx
			*-- Pass the value of nChar, nVK
			This.keybrd(val(params), VAL(GETWORDNUM(params,2)))
		ENDFOR

	CASE ATC("Mouse", event) # 0

		*-- NOTE : The following case structure shouldn't be re-aligned
		DO CASE
			CASE NOT FoxEvt AND ; 
				(INLIST(EventId, "000000A1", "000000A2","000000A4", "000000A5") OR ;
				cEvent="MouseUp" AND val(params) >= 1) 
				
				** &&OR This.lMenuClicked)

				*-- Do the following only for non VFP (ie. WINDOWS) events
				*-- If the menu clicked. MouseDown event id will always be 000000A?, where as for mouse up
				*-- val(params) = 1
				
				IF val(params) = 1
					nXOffset = This.oVfp.Left - This.nAppLeft
					nYOffset = This.oVfp.Top - This.nAppTop
				ELSE
				    *-- Click on the main VFP window titlebar (ie. val(params) = 2)
					nXOffset = This.oVfp.Left - This.nAppLeft + This.nScreenLeft
					nYOffset = This.oVfp.Top - This.nAppTop  + This.nScreenTop
					*-- NOTE : The screen co-ordinates change if the toolbar is docked
					*--        If the docking status has been changed during playback which is different from
					*--        the one during recording, then it may cause some problems
					*--        The screen offset may also to be calculated during that time.
				ENDIF

				*-- Do the mouse up and down separately
**				lMouseDownUp = .f.

			CASE ATC(This.oVfp.Caption,m.cEpath) # 0	&& coordinates relative to main vfp window
                *-- MESSAGEBOX() clicks
				nXOffset = This.nAppLeft + 3
				nYOffset = This.nAppTop  + 22*2

			CASE NOT lFormTitleBar
				*-- if the form has no title bar, don't add the titlebar offset
				nXOffset = This.nfrmLeft + 3
				nYOffset = This.nfrmTop
			OTHERWISE
				* adjust for window client area (minus titlebar)
				nXOffset = This.nfrmLeft + 3
				nYOffset = This.nfrmTop + 22
		ENDCASE

		*-- if mouseup (play both up/down) or separate mouse up/down
		IF  cEvent="MouseUp" OR NOT lMouseDownUp

			*-- just play mouse up on the same place if click on window border or close box (Y Co-ord > 65000)
			IF ny > 65000 OR nx > 65000
				nMouseX = This.nLastMouseX
				nMouseY = This.nLastMouseY
			ELSE
				nMouseX = nXOffset + nx
				nMouseY = nYOffset + ny

				*-- Check the location of the objects whether it has been moved 
				IF NOT ISNULL(oAcc)
					
					This.CalcMousePosn(oAcc, @nMouseX, @nMouseY)
					
				ENDIF
				
			ENDIF

			*-- For VFP events check for Shift, ctrl with mouse
			IF FoxEvt
				nShiftCtrlAlt = VAL(GETWORDNUM(params,2))
			ELSE
				*-- Non fox clicks with shift, ctrl... doesn't have significance
				*-- so its not handled now
				nShiftCtrlAlt = 0
			ENDIF

			This.doclick(event, eventid, lMouseDownUp, nMouseX, nMouseY, nShiftCtrlAlt)

		ENDIF

		This.nLastMouseX = nXOffset + nx
		This.nLastMouseY = nYOffset + ny
ENDCASE

RETURN

ENDPROC
PROCEDURE getcontainerform
*-- given an main VFP obj and a name, get the container form name
LPARAMETERS oAccVfp, cFormString, lFormTitleBar, lSet16

LOCAL cFormCaption, oRet, nChilds, nSys2800

cFormCaption = ""

oRet = .Null.

*-- Store the value of accessibility settings
nSys2800 = This.oVfp.Eval("SYS(2800)")

IF lSet16
  This.oVfp.DoCmd("SYS(2800, 17)")
ELSE
  This.oVfp.DoCmd("SYS(2800, 1)")
ENDIF


nChilds=oAccVfp.accChildCount()

*-- Loop for all the top level objects
FOR i = 1 to nChilds
	
	cFormCaption = oAccVfp.accChild(i).accname(0)
	
	DO CASE
		CASE ISNULL(cFormCaption)
			*-- ignore if there is no name
		CASE ATC(cFormCaption, cFormString) > 0
			*-- If the form(inputbox window...) exists
			oRet = oAccVfp.accChild(i)
	
		CASE ATC(cFormCaption, This.ovfp.Caption) > 0
			*-- if its a VFP object check for each forms (browse window...) inside

			FOR j = 1 TO oAccVfp.accChild(i).AccChildCount()
				cFormCaption = oAccVfp.accChild(i).accChild(j).accname(0)
				
				*-- If the form(inputbox window...) exists
				IF VARTYPE(cFormCaption) = "C" AND ATC(cFormCaption, cFormString) > 0
					oRet = oAccVfp.accChild(i).accChild(j)
					EXIT
				ENDIF
			ENDFOR
			
	ENDCASE
	
	*-- If there is a matching window, don't check other objects
	IF NOT ISNULL(oRet)
		*-- Pass the form name as refrerence
		cFormString = cFormCaption
		EXIT
	ENDIF

ENDFOR

*-- Restore the value of accessibility settings
This.oVfp.DoCmd("SYS(2800, " + nSys2800 + ")")

RETURN oRet
ENDPROC
PROCEDURE getobjwithname
*given an obj and a name, get the child with that name
LPARAMETERS oAcc, cName

LOCAL nObtained, sChildren, nc, i, otmp, oret, cvar, vt, otmp
oret = .Null.
nc = oAcc.accChildCount
nObtained = 0
sChildren = REPLICATE(CHR(0), m.nc * 16)

IF m.nc > 0 
	i = AccessibleChildren(SYS(3095, oAcc, "{"+IAccguid+"}"), 0, m.nc, @sChildren, @nobtained)
	SYS(3098,oAcc)

	IF m.i= 0
		FOR i = 1 TO m.nc
			cvar = SUBSTR(m.sChildren, 1 + ((m.i - 1) * 16), 16)
			vt = THIS.Str2Num(m.cvar)
			DO CASE
			CASE m.vt = 9 	&& VT_DISPATCH
				otmp = SYS(3096,THIS.Str2Num(SUBSTR(m.cvar,9)))

				IF TYPE("m.otmp.accname[0]") = "C" AND upper(m.otmp.accname[0]) = UPPER(m.cName)
					oret = m.otmp
					* must continue loop so all IDisp get released
				ENDIF
			OTHERWISE
*!*					?"help"
*!*					SET STEP ON
			ENDCASE
		ENDFOR

	ELSE
		* AccessibleChildren doesn't work.. try each child obj directly
		FOR i = 1 TO m.nc
			otmp = m.oAcc.accChild(i)
			IF UPPER(m.cName) = UPPER(m.otmp.accName(0))
				oret = m.otmp
				EXIT
			ENDIF
		ENDFOR
	ENDIF

ENDIF

*!*	IF ISNULL(m.oret)
*!*		WAIT WIND 'object ' + m.cName + " doesn't exists"
*!*		SUSPEND
*!*	ENDIF

RETURN m.oret

ENDPROC
PROCEDURE getobjwithrole
*given an obj and a role, get the child with the role
LPARAMETERS oAcc, nRole
LOCAL oret, i, otmp
oret = .null.
FOR i = 1 TO oAcc.accChildCount
	otmp = oAcc.accChild(i)
	IF nrole = m.otmp.accrole(0)
		oret = m.otmp
		EXIT
	ENDIF
ENDFOR
RETURN oret

*!*	nRole = ox.accRole(nRoleIndex)
*!*	cstr = SPACE(256)
*!*	nPos = GetRoleText(nRole, @cstr, len(cstr))
*!*	cstr = LOWER(ALLTRIM(LEFT(cstr,nPos)))

*!*	DO CASE
*!*	CASE cStr == "application"
*!*		Return "application"
*!*	CASE cStr == "check box"
*!*		Return "checkbox"
*!*	CASE cStr == "client"
*!*		Return "client"
*!*	CASE cStr == "column"
*!*		Return "column"
*!*	CASE cStr == "column header"
*!*		Return "colheader"
*!*	CASE cStr == "combo box"
*!*		Return "combo"
*!*	CASE cStr == "editable text"
*!*		Return "editbox"
*!*	CASE cStr == "graphic"
*!*		Return "image"
*!*	CASE cStr == "grouping"
*!*		Return "group"
*!*	CASE cStr == "list"
*!*		Return "list"
*!*	CASE cStr == "list item"
*!*		Return "listitem"
*!*	CASE cStr == "popup menu"
*!*		Return "popupmenu"
*!*	CASE cStr == "push button"
*!*		Return "button"
*!*	CASE cStr == "radio button"
*!*		Return "radio"
*!*	CASE cStr == "spin box"
*!*		Return "spinner"
*!*	CASE cStr == "table"
*!*		Return "table"
*!*	CASE cStr == "text"
*!*		Return "label"
*!*	CASE cStr == "tool bar"
*!*		Return "toolbar"
*!*	CASE cStr == "unknown object"
*!*		Return "unknown"
*!*	CASE cStr == "window"
*!*		Return "window"
*!*	CASE cStr == "scroll bar"
*!*		Return "scrollbar"
*!*	CASE cStr == "grip"
*!*		Return "sizebox"
*!*	CASE cStr == "indicator"
*!*		Return "indicator"
*!*	CASE cStr == "status bar"
*!*		Return "statusbar"
*!*	CASE cStr == "menu bar"
*!*		Return "menubar"
*!*	CASE cStr == "menu item"
*!*		Return "menuitem"
*!*	CASE cStr == "link"
*!*		Return "link"
*!*	CASE cStr == "title bar"
*!*		Return "titlebar"
*!*	CASE cStr == "separator"
*!*		Return "separator"
*!*	CASE cStr == "page tab list"
*!*		Return "pageframe"
*!*	CASE cStr == "page tab"
*!*		Return "pageframe"
*!*	CASE cStr == "dialog"
*!*		Return "proppage"
*!*	CASE cStr == "property page"
*!*		Return "proppage"
*!*	ENDCASE

*!*	Return "unknown"


ENDPROC
PROCEDURE keybrd
LPARAMETERS nChar, nVK

LOCAL nElement, nSubscript, cKeyString, lAlt, lShift, lCtrl

cKeyString = ""

lShift	= BITTEST(nVK, 12)	&& shift - 4096	
lCtrl	= BITTEST(nVK, 13)	&& ctrl - 8192
lAlt	= BITTEST(nVK, 14)	&& alt - 16384

WITH THIS
	nElement = ASCAN(.aSplKeys, nChar)

	DO CASE
		CASE nElement > 0 OR lAlt && If special keys like HOME, END... found OR ALT key is pressed
			*-- ALT + Any key press is not working fine so pass the keyboard command

			cKeyString = "KEYBOARD '{"

			IF lShift
				cKeyString = cKeyString + "SHIFT+"
			ENDIF

			IF lCtrl
				cKeyString = cKeyString + "CTRL+"
			ENDIF

			IF lAlt
				cKeyString = cKeyString + "ALT+"
			ENDIF

			IF nElement > 0  && if special keys found
				nSubscript = ASUBSCRIPT(.aSplKeys, nElement, 1)
				cKeyString = cKeyString + .aSplKeys[nSubscript, 2] + "}'"
			ELSE
				*-- just for alt+keys
				cKeyString = cKeyString + CHR(nChar) + "}'"
			ENDIF
			
			IF NOT (lAlt AND nChar = 18) && ignore for just alt key
				.oVFP.Docmd(cKeyString)
				SLEEP(200)	&& let it execute the on key routines
			ENDIF

		CASE nVK = 0  && plain
			KEYBD_EVENT(nChar,0,0,0)
			KEYBD_EVENT(nChar,0,KEYEVENTF_KEYUP,0)
		CASE lShift && shift
			KEYBD_EVENT(VK_LSHIFT,0,0,0)
			KEYBD_EVENT(nChar,0,0,0)
			KEYBD_EVENT(nChar,0,KEYEVENTF_KEYUP,0)
			KEYBD_EVENT(VK_LSHIFT,0,KEYEVENTF_KEYUP,0)
		CASE lCtrl && ctrl
			KEYBD_EVENT(VK_LCONTROL,0,0,0)
			KEYBD_EVENT(nChar,0,0,0)
			KEYBD_EVENT(nChar,0,KEYEVENTF_KEYUP,0)
			KEYBD_EVENT(VK_LCONTROL,0,KEYEVENTF_KEYUP,0)
*!*			CASE nVK = 16394 && alt
*!*				KEYBD_EVENT(VK_LMENU,0,0,0)
*!*				KEYBD_EVENT(VK_LMENU,0,KEYEVENTF_KEYUP,0)
*!*				KEYBD_EVENT(nChar,0,0,0)
*!*				KEYBD_EVENT(nChar,0,KEYEVENTF_KEYUP,0)
	ENDCASE

ENDWITH

RETURN

ENDPROC
PROCEDURE logerror
LPARAMETERS cErrorMessage, nError

LOCAL	cMessage, ;
		cLogMessage

cLogMessage = ""
cMessage    = ""	

WITH This

	*-- if there is an error in the application
	*-- Dont check .oVFP because the application may have closed 
	IF .frmMain.pgfmain.Page2.chkVFPError.Value AND nError <> Cc_TestPassed AND ;
	  TYPE("Thisformset.oVFP.Caption") = "C" AND ;
	  .cFoxError <> .oVFP.Eval("MESSAGE()")

		.cFoxError = .oVFP.Eval("MESSAGE()")
		cMessage = cErrorMessage + Cc_EOL + MSG_ERROR1_LOC + "'" + .cFoxError + [']

	ELSE
		cMessage = cErrorMessage
	ENDIF

	DO CASE
		CASE nError = Cc_Error
			cLogMessage = "Error : " + cMessage
		CASE nError = Cc_Warning
			cLogMessage = "Warning : " + cMessage
		OTHERWISE
			cLogMessage = cMessage
	ENDCASE

	INSERT INTO errorlist VALUES (cLogMessage, (nError = Cc_Error))

	cMessage = MSG_PLAYBACKERROR_LOC + cErrorMessage + CHR(13) + MSG_CHKLOG_LOC

	*-- If its error (not warning)
	IF nError = Cc_Error
		.lError = .t.
		.frmMain.edtStatus.Value = .frmMain.edtStatus.Value + cMessage + CHR(13)

		IF TYPE("Thisformset.oVFP.Caption") = "C"
			.oVFP.DoCmd("MESSAGEBOX([" + cMessage + "], 0, [" + WINDOWTITLE_LOC + "], 10000)")
		ENDIF

	ENDIF

ENDWITH

RETURN
ENDPROC
PROCEDURE sendmouse
LPARAMETERS nMouseEvents, x, y
LOCAL lcInput
lcInput = CHR(INPUT_MOUSE) + REPLICATE(CHR(0),3)					&& type
lcInput = lcInput + CHR(m.x%256) + CHR(m.x/256) + REPLICATE(CHR(0),2)	&& dx
lcInput = lcInput + CHR(m.y%256) + CHR(m.y/256) + REPLICATE(CHR(0),2)	&& dy
lcInput = lcInput + REPLICATE(CHR(0),4)							&& mouseData
lcInput = lcInput + CHR(m.nMouseEvents%256) + CHR(m.nMouseEvents/256) + REPLICATE(CHR(0),2)	&& dwFlags
lcInput = lcInput + REPLICATE(CHR(0),4)				&& time
lcInput = lcInput + REPLICATE(CHR(0),4)				&& dwExtraInfo
SendInput(1,lcInput, LEN(lcInput))

ENDPROC
PROCEDURE playloop
LOCAL lnRunNum

WITH This

	IF .lplaypaused
		lnRunNum = .nPlayPausedRun
	ELSE
		lnRunNum = 1
	ENDIF

	DO WHILE lnRunNum <= .nRunCount

		*-- Store current run to play pause property so we can
		*-- continue at that run when play is resumed
		.nPlayPausedRun = lnRunNum

		This.frmMain.edtStatus.Value = This.frmMain.edtStatus.Value + MSG_TESTRUNNO_LOC + TRANSFORM(lnRunNum) + CHR(13)

		SELECT aaScripts

		IF .lplaypaused
			GOTO .nPlayPausedScriptRecno IN aaScripts
		ELSE
			GOTO TOP IN aaScripts
		ENDIF
			
		SCAN REST FOR selected
			*-- Store current recno of scripts table to play pause property so we can
			*-- continue at that script when play is resumed
			.nPlayPausedScriptRecno = RECNO("aaScripts")

			.frmMain.edtStatus.Value = .frmMain.edtStatus.Value + "    Script:"+ aascripts.desc + CHR(13)
			
			.nTestId = id
			.nTestRun = lnRunNum
			
			IF NOT .lplaypaused
				.PlayBegin()
			ENDIF

			.PlayTest()
			
			IF .lPlayPaused
				EXIT
			ENDIF
			
			.PlayEnd()
			
			*-- If there is an error exit the loop
			IF .lError
				EXIT
			ENDIF
			
			SELECT aaScripts
		ENDSCAN && REST FOR selected

		*-- If there is an error exit the loop
		IF This.lerror
			EXIT
		ENDIF

		lnRunNum=lnRunNum+1
	ENDDO && lnRunNum <= .nRunCount

ENDWITH

RETURN
ENDPROC
PROCEDURE str2num
LPARAMETERS cstr
local i,n
n=0
FOR i = 8 TO 1 STEP -1
	n = m.n * 256 + ASC(SUBSTR(m.cstr,m.i,1))
ENDFOR
RETURN n

ENDPROC
PROCEDURE playtest
LOCAL hWnd, oAccvfp, oAcc, lclogfile, lcStr, lcfullname, nRetval
LOCAL frmLeft, frmTop, frmWidth, frmHeight
LOCAL oForm, cFormName, lFormTitleBar, oAccObj
LOCAL nTimeInterval
LOCAL lc_Eval, lc_Do, lc_If, lc_CurrentEventLine, lc_Exact

STORE 0 TO frmLeft, frmTop, frmWidth, frmHeight

oAccObj = Null

lFormTitleBar = .t.

WITH This
	oAcc = 0

	nRetval = AccessibleObjectFromWindow(.nTestAppHWnd, OBJID_CLIENT, .cguid, @oAcc)

	** this can be stored in a property
	oAccvfp = oAcc

	*-- if its not started from the command window
	IF ATC(aascripts.caption, .oVfp.Caption) = 0

		cFormName = aascripts.caption

		*-- find startup form/window
		oForm = .GetContainerForm(oAccvfp, cFormName)

		*-- If the start up form is different
		IF ISNULL(oForm)

			IF .frmMain.pgfmain.Page2.chkStartupWin.Value
				.LogError(MSG_WRONGSTARTWINDOW_LOC, Cc_Error)
				This.frmMain.edtStatus.Value = This.frmMain.edtStatus.Value + "Script Failure!" + CHR(13)
				RETURN
			ELSE
				.LogError(MSG_WRONGSTARTWINDOW_LOC, Cc_Warning)
			ENDIF

		ELSE
			oAcc = oForm
			.cCurrWinName = cFormName
			.cCurrFormName = cFormName
		ENDIF

	ENDIF

	.nAppLeft = aascripts.AppLeft
	.nAppTop  = aascripts.AppTop
	.nScreenLeft = aascripts.ScreenLeft
	.nScreenTop  = aascripts.ScreenTop

	lclogfile = SYS(2015)+".txt"
	STRTOFILE(aascripts.script,lclogfile)

	CREATE CURSOR EVENTS(event c(12), eventid c(8), mx n(6), my n(6), ;
						params c(20), rest c(115),delay n(11,5), foxEvt L)

	APPEND FROM (lclogfile) sdf
	ERASE (lcLogFile)

	IF .lPlayPaused
		GOTO .nPlayPausedLine IN events
		SKIP IN events
		
		*-- We have handled resuming from where we left off so turn of playpaused indicator
		.lPlayPaused = .f.
	ELSE
		GOTO TOP IN events
	ENDIF

	.cLastevent = "    "

	* Run EventScript
	SCAN REST

		*-- The Cc_Directive token indicates that the script has been edited
		*-- and needs to run something different.
		IF LEFT(LTRIM(events->event), 1) = Cc_Directive OR EMPTY(events->event)

			lc_Exact = SET("EXACT")
			SET EXACT OFF
			
			*-- Find the full line from the script field
			lc_CurrentEventLine = MLINE(aaScripts->script, RECNO("events"))
			
			DO CASE
				CASE UPPER(LTRIM(events->event)) = Cc_Directive + "COMMAND "
					*-- We have a command to execute
					lc_Command = SUBSTR(lc_CurrentEventLine, LEN(Cc_Directive + "COMMAND ") + 1)
					&lc_Command.
					SELECT events

				CASE UPPER(LTRIM(events->event)) = Cc_Directive + "="
					*-- We have a function to execute
					lc_Eval = SUBSTR(lc_CurrentEventLine, LEN(Cc_Directive + "=") + 1)
					= EVALUATE(lc_Eval)
					SELECT events

				CASE UPPER(LTRIM(events->event)) = Cc_Directive + "DO "
					*-- We have a DO command to execute
					lc_Do = SUBSTR(lc_CurrentEventLine, LEN(Cc_Directive + "DO ") + 1)
					DO &lc_Do.
					SELECT events

				CASE UPPER(LTRIM(events->event)) = Cc_Directive + "IF "
					*-- We have an IF condition to evaluate
					lc_If = SUBSTR(lc_CurrentEventLine, LEN(Cc_Directive + "IF ") +1)
					
					IF NOT EVALUATE(lc_If)
						SELECT events
						*-- If condition failed. Find ELSE or ENDIF
						LOCATE REST FOR UPPER(LTRIM(events->event)) = Cc_Directive + "ELSE" OR ;
							UPPER(LTRIM(events->event)) = Cc_Directive + "ENDIF"
					ELSE
						SELECT events
					ENDIF

				CASE UPPER(LTRIM(events->event)) = Cc_Directive + "ENDIF"
					*-- ENDIF given. Just do nothing.

				CASE UPPER(LTRIM(events->event)) = Cc_Directive + "ELSE"
					*-- ELSE given. Go to line after ENDIF.
					LOCATE WHILE UPPER(LTRIM(events->event)) <> Cc_Directive + "ENDIF"

				CASE UPPER(LTRIM(events->event)) = Cc_Directive + "<PAUSE>"
					*-- DO NOT REMOVE!!! W/o the wait window the last set of
					*-- events do not seem to get fired.
					WAIT WINDOW MSG_PLAYBACK2_LOC TIMEOUT 2.0

					*-- Bring back the test application
					SetForegroundWindow(_VFP.hWnd)

					*-- Note that we have paused
					.frmMain.edtStatus.Value = This.frmMain.edtStatus.Value + ;
						MSG_PLAYBACK2_LOC + CHR(13)
					.frmMain.edtStatus.Refresh(.t.)
					.lPlayPaused = .t.
					.nPlayPausedLine = RECNO("events")
					
					*-- Stop playing
					EXIT
			ENDCASE

			SET EXACT &lc_Exact.

			*-- Loop back for other directives
			LOOP
		ENDIF
		
		*-- Skip consecutive mouse up & down
		IF event = .cLastevent AND (event = "MouseDown" OR event = "MouseUp")
			LOOP
		ENDIF
		
		.cLastevent = event

		nTimeInterval = events.delay * 1000 + .nDelay

		SLEEP(nTimeInterval)

		*-- If coordinates not relative to main vfp window and the script is not for the current form
		*-- don't check if the form caption/name is empty for keypress event
		IF ATC(.oVfp.Caption,rest) = 0 AND ;
			ATC(.cCurrWinName, rest) = 0 AND ATC(.cCurrFormName, rest) = 0 AND ;
			NOT (ATC("KeyPress", event) # 0 AND EMPTY(rest))

			*-- Find out the present top form name
			*-- the validity of the top name is done in the doTheEvent method
		
			*-- Clear the form object which will prevent closing the form
			oForm = NULL
			
			*-- Rest to have form titlebar by default
			lFormTitleBar = .t.

			*-- Wait for the new form to load
			SLEEP(1000)

			*-- If the top form is not the next object
			IF TYPE(".oVFP.Forms(1).Name") # "C" OR ATC(.oVFP.Forms(1).Name, rest) = 0

				*-- Send the whole string, not sure about the form name/caption
				*-- recevied the form name/caption only
				cFormName = rest

				oForm = .GetContainerForm(oAccvfp, @cFormName, @lFormTitleBar)

        IF ISNULL(oForm)
          *-- Call again with checking for name instead of caption
          oForm = .GetContainerForm(oAccvfp, @cFormName, @lFormTitleBar, .t.)
        ENDIF
        
				*-- If the object is not able to find, log the error and exit
				IF ISNULL(oForm)

					DO CASE
						*-- Abort playback
						CASE This.frmMain.pgfmain.Page2.opgfailoption.Value = 1
							.LogError(MSG_NOFOCUS_LOC + " " + MSG_SCRIPTLINE_LOC + STR(RECNO("events")), Cc_Error)
							EXIT

						*-- Skip only the current event
						CASE This.frmMain.pgfmain.Page2.opgfailoption.Value = 2
							LOOP

						*-- Continue playback
						CASE This.frmMain.pgfmain.Page2.opgfailoption.Value = 3
					ENDCASE

				ELSE
					oAcc = oForm
					.cCurrWinName = cFormName
					.cCurrFormName = cFormName
				ENDIF

			ELSE
				oForm = .oVFP.Forms(1)

				*-- Check whether there is a titlebar for the form
				*-- the toolbars doesn't have titlebar prop
				IF TYPE("oForm.TitleBar") = "N" AND oForm.TitleBar = 0 ;
					OR EMPTY(oForm.Caption)
					.cCurrWinName = oForm.Name
					*-- Set the variable which will be used to calculate the position without titlebar
					lFormTitleBar = .f.
				ELSE
					.cCurrWinName = oForm.Caption
				ENDIF

				.cCurrWinName = oForm.Name

				oAcc=0
				nRetval = AccessibleObjectFromWindow(oForm.hwnd, OBJID_CLIENT, .cguid, @oacc)

			ENDIF

			*-- Find the location if the container form exists
			IF NOT ISNULL(oAcc)
				oAcc.accLocation(@frmLeft, @frmTop, @frmWidth, @frmHeight, 0)
				.nFrmLeft = frmLeft
				.nFrmTop = frmTop
				.nFrmWidth = frmWidth
				.nFrmHeight = frmHeight
			ENDIF

		ENDIF

		*-- Do not check the object if
		*--		-object level check is enabled
		*--		-its keypress event without the object names (win event)
		*--		-the object is the topmost, ie window itself
		IF .frmMain.pgfmain.Page2.chkObjectLevel.Value AND ;
			NOT (ATC("KeyPress", event) # 0 AND EMPTY(rest)) AND ;
			NOT (EMPTY(STRTRAN(rest, .cCurrWinName, "")) OR ;
			     AT(".", STRTRAN(rest, .cCurrWinName, "")) = 0 OR ;
			     EMPTY(STRTRAN(rest, .cCurrFormName, "")) OR ;
			     AT(".", STRTRAN(rest, .cCurrFormName, "")) = 0)

			*-- If the object is not able to find, log the error and exit
			*-- Check the focus only for keypress
			IF NOT .CheckTheObj(oAcc, ALLTRIM(rest), (ATC("KeyPress", event) > 0), @oAccObj)

				DO CASE
					*-- Abort playback
					CASE This.frmMain.pgfmain.Page2.opgfailoption.Value = 1
						EXIT

					*-- Skip only the current event
					CASE This.frmMain.pgfmain.Page2.opgfailoption.Value = 2
						LOOP

					*-- Continue playback
					CASE This.frmMain.pgfmain.Page2.opgfailoption.Value = 3
				ENDCASE

			ENDIF

		ENDIF

		.DoTheEvent(oAccObj, ALLTRIM(rest), ALLTRIM(event), mx, my, lFormTitleBar)

		*-- Clear the form object which will prevent closing the form
		oForm = NULL
		
		oAccObj = NULL


		*-- If there is an error exit the loop
		IF .lerror
			EXIT
		ENDIF

		IF TYPE("gl_Pause") <> "U" AND gl_Pause
			WAIT WIND MSG_SUPSEND_LOC TIMEOUT 1
			debug
			suspend
		ENDIF

	ENDSCAN

	*-- Clear the form object which will prevent closing the form
	oForm = NULL

ENDWITH

RETURN

ENDPROC
PROCEDURE scriptparse
LOCAL	oPrevEvent, ;
		nParamPosn, ;
		nRightDotPosn, ;
		cParams, ;
		cRest, ;
		cEvent, ;
		cEventId, ;
		nx, ;
		ny, ;
		nCurrTstamp, ;
		lc_TempFile, ;
		ln_Line

WAIT WINDOW MSG_PARSE1_LOC NOWAIT

WITH This

	CREATE CURSOR tmpEvents(tstamp n(11,5), fullname c(120), ;
		event c(12), eventid c(8), mx n(6), my n(6), params c(20), rest c(115), foxEvt L)

	APPEND FROM (.cEventLogFile) TYPE SDF

	SCATTER NAME oPrevEvent BLANK
	
	SCAN
		WAIT WINDOW MSG_PARSE2_LOC + ALLTRIM(STR(RECNO())) + ;
				" of " + ALLTRIM(STR(RECCOUNT())) + "..." NOWAIT

		*!*	32273.240, form1.text1.MouseDown(1, 0, 81, 48)
		*!*	32273.380, form1.text1.MouseUp(1, 0, 81, 48)
		*!*	32276.535, KeyPress    00000100 (   1,   30) 65 0 
		*!*	32276.545, form1.KeyPress(97, 0)
		*!*	32276.555, form1.text1.KeyPress(97, 0)

		*-- If its VFP events
		IF ATC("MouseUp(", fullname) # 0 OR;
			ATC("MouseDown(", fullname) # 0 OR;
			ATC("KeyPress(", fullname) # 0
			
			*-- If there are screen's mouse/keypress events, ignore (delete) it
			*-- because the windows mouse events also triggered that time...
			IF ATC("screen.", fullname) # 0
				DELETE
				LOOP
			ENDIF

			nParamPosn = RAT("(", fullname)
			nRightDotPosn = RAT(".", fullname)
			
			cParams = STRTRAN(SUBSTR(fullname, nParamPosn + 1),")","")  && parameters
			cRest = ALLTRIM(LEFT(fullname, nRightDotPosn - 1)) && rest of event path
			cEvent = SUBSTR(fullname, nRightDotPosn + 1, nParamPosn - nRightDotPosn - 1)

			nx = VAL(GETWORDNUM(cParams,3))
			ny = VAL(GETWORDNUM(cParams,4))
			cParams = GETWORDNUM(cParams,1) + " " +  GETWORDNUM(cParams,2)
			cParams = " " + STRTRAN(cParams, ",", " ")  && convert "," to space(1) for consistency

			*-- Store athe event id properly like windows events
			*-- in order to use common logic to play back
			DO CASE
				CASE ATC("KeyPress", fullname) # 0
					cEventId = "00000100"
				CASE ATC("MouseDown", fullname) # 0 AND VAL(cParams) = 1
					cEventId = "00000201"
				CASE ATC("MouseUp", fullname) # 0  AND VAL(cParams) = 1
					cEventId = "00000202"
				CASE ATC("MouseDown", fullname) # 0 AND VAL(cParams) = 2
					cEventId = "00000204"
				CASE ATC("MouseUp", fullname) # 0  AND VAL(cParams) = 2
					cEventId = "00000205"
				OTHERWISE
					cEventId = "00000000"
			ENDCASE
			
			*-- If the windows Keypress is succeded by Fox KeyPress, delete the 
			*-- fox keypress event and update the win event with object info.
			IF NOT oPrevEvent.FoxEvt AND ATC("KeyPress", oPrevEvent.event) # 0 AND ;
				ATC("KeyPress(", fullname) # 0

				*-- If there are two successive Fox KeyPress followed by
				*-- windows event the control's keypress event will be updated
				*-- against the windows keypress finally...

				DELETE
				
				SKIP - 1 && Win keypress
				REPLACE rest	WITH cRest

			ELSE
				REPLACE event	WITH cEvent, ;
						eventid	WITH cEventId, ;
						mx		WITH nx, ;
						my		WITH ny, ;
						params	WITH cParams, ;
						rest	WITH cRest, ;
						foxEvt	WITH .t.
			ENDIF

		ELSE
		*!*	37280.556, MouseDown   00000201 ( 257,  241) 00000001 formset.form1.edit1.MouseDown
		*!*	37280.707, MouseUp     00000202 ( 257,  241) 00000000 formset.form1.edit1.MouseUp
		*!*	37281.177, KeyPress    00000100 (   1,   30) 65 0 
			cEvent = ALLTRIM(SUBSTR(fullname, 1, 12))

			cRest = SUBSTR(fullname, 35)

			IF ATC("KeyPress", fullname) # 0
				cParams =  GETWORDNUM(cRest,1) + " " +  GETWORDNUM(cRest,2)
			ELSE
				cParams =  GETWORDNUM(cRest,1) + " "
			ENDIF
			
			cRest = ALLTRIM(STRTRAN(cRest, cParams, ""))
			
			*-- Make sure the event has been removed from the event path
			cRest = STRTRAN(cRest, "." + cEvent, "")
			
			REPLACE event	WITH cEvent, ;
					eventid	WITH SUBSTR(fullname, 13, 8), ;
					mx		WITH VAL(SUBSTR(fullname, 23, 6)), ;
					my		WITH VAL(SUBSTR(fullname, 29, 6)), ;
					params	WITH " " + cParams, ;
					rest	WITH cRest
		ENDIF
		
		SCATTER NAME oPrevEvent

	ENDSCAN

	WAIT WINDOW MSG_SCRIPTSAVING_LOC NOWAIT
	
	*-- Calculate the delay between events

	GO TOP
	oPrevEvent.tstamp = tstamp

	SCAN
		nCurrTstamp = tstamp

		REPLACE tstamp WITH tstamp - oPrevEvent.tstamp

		SCATTER NAME oPrevEvent
		oPrevEvent.tstamp = nCurrTstamp
	ENDSCAN
	*-- Calculate the delay between events - end

	COPY FIELDS event, eventid, mx, my, params, rest, tstamp, foxevt TO (.cEventLogFile) SDF

	SELECT aascripts

	IF NOT .lPlayInsert
		REPLACE SCRIPT WITH FILETOSTR(.cEventLogFile) IN aaScripts
	ELSE
		*-- We were inserting.
		*-- Now merge the new script at the spot
		*-- where the previous script was paused.
		GOTO .nPlayInsertScriptRecno IN aaScripts

		lc_TempFile = SYS(2015) + ".tmp"
		
		FOR ln_Line = 1 TO MEMLINES(aaScripts->Script)
		
			= STRTOFILE(MLINE(aaScripts->Script,ln_Line) + Cc_EOL, lc_TempFile, .t.)
			
			IF ln_Line = .nPlayInsertLine
				*-- We got to the line where play was paused
				*-- Now add the new script
				= STRTOFILE(FILETOSTR(.cEventLogFile) + Cc_EOL, lc_TempFile, .t.)
			ENDIF
			
		NEXT

		REPLACE SCRIPT WITH FILETOSTR(lc_TempFile) IN aaScripts
	ENDIF

ENDWITH

WAIT CLEAR

USE IN tmpEvents

RETURN

ENDPROC
PROCEDURE checktheobj
LPARAMETERS oAccContainer, cEpath, lCheckFocus, oAccObj

LOCAL cTmp, nDotPosn, nCnt, i, lfGetNewOne, cWord, oRet, lReturn, cMessage, nAccState

*-- Object's state (focused, etc..)
nAccState = 0

lReturn = .t.

cMessage = ""

nCnt = 0

cStart = oAccContainer.AccName(0) + "."

cTmp = m.cEpath + '.'

*-- Truncate the startup object
cTmp = SUBSTR(m.cTmp, ATC(cStart, cTmp) + LEN(cStart))

oRet = oAccContainer

WITH This

	DO WHILE NOT .lError
		nDotPosn = AT('.', m.cTmp)

		IF m.nDotPosn = 0
			EXIT
		ENDIF

		cWord = LEFT(m.cTmp, m.nDotPosn - 1)
		cTmp = SUBSTR(m.cTmp, m.nDotPosn + 1)

		nCnt = nCnt + 1
		lfGetNewOne = .f.

		IF nCnt <= .nHistcnt

			IF LOWER(cWord) = .ahist[nCnt,1]
				oRet = .ahist[nCnt,2]
			ELSE
				* not following cache... clear rest out
				FOR i = nCnt TO .nCacheSize
					IF ISNULL(.ahist[m.i,1])
						EXIT
					ENDIF
					.ahist[m.i,1]=.null.
					.ahist[m.i,2]=.null.
				ENDFOR
				.nHistcnt = nCnt - 1
				lfGetNewOne = .t.
			ENDIF

		ELSE
			lfGetNewOne = .t.
		ENDIF

		IF lfGetNewOne
			IF VARTYPE(oRet)#"O"
*!*	?'blank obj'+cword
*!*	??CHR(7)
			ELSE
				oRet = .GetObjWithName(oRet, cWord)

				.ahist[nCnt,1] = LOWER(cWord)
				.ahist[nCnt,2] = oRet
				.nHistcnt = .nHistcnt + 1
			ENDIF
			
		ENDIF

	ENDDO

	*-- if the object not exists
	IF ISNULL(oRet)
		lReturn = .f.
		cMessage = MSG_NOOBJECT_LOC + " " + MSG_SCRIPTLINE_LOC + STR(RECNO("events"))
	ELSE

		*-- If it needs to check whether the object is focussed (for keypress)
		IF lCheckFocus

			nAccState = oRet.accState(0)

			*-- If the focus is not in current object
			IF BITAND(nAccState, 2^Cn_State_Focused) <= 0
				lReturn = .f.
				cMessage = MSG_NOFOCUS2_LOC + MSG_SCRIPTLINE_LOC + STR(RECNO("events"))
			ENDIF

		ENDIF

	ENDIF

	*-- Log the error if it fails to check the object
	IF NOT lReturn

		*-- Abort playback
		IF .frmMain.pgfmain.Page2.opgfailoption.Value = 1
			.LogError(cMessage, Cc_Error)
		ELSE
			.LogError(cMessage, Cc_Warning)
		ENDIF

	ENDIF

ENDWITH

*-- Pass the object by reference
oAccObj = oRet

RETURN lReturn

ENDPROC
PROCEDURE calcmouseposn
PARAMETERS oAcc, nMouseX, nMouseY

LOCAL nObjLeft, nObjTop, nObjWidth, nObjHeight

STORE 0 TO nObjLeft, nObjTop, nObjWidth, nObjHeight

oAcc.accLocation(@nObjLeft, @nObjTop, @nObjWidth, @nObjHeight, 0)

*-- If the object has been moved horizontally
IF NOT BETWEEN(nMouseX, nObjLeft, nObjLeft + nObjWidth)
	nMouseX = nObjLeft + 1  && calculate some arbitrary position within the object
ENDIF

*-- If the object has been moved vertically
IF NOT BETWEEN(nMouseY, nObjTop, nObjTop + nObjHeight)
	nMouseY = nObjTop + 1   && calculate some arbitrary position within the object
ENDIF

RETURN
ENDPROC
PROCEDURE deletescripts
LOCAL	lContinue, ;
		lc_TempFile

lContinue = .t.

*-- Set the scripts page as the active page
ThisFormSet.frmMain.pgfmain.ActivePage = 1

SELECT aaScripts

LOCATE FOR selected

IF NOT FOUND()
	= MESSAGEBOX(MSG_NOSCRIPT_LOC,0 + 48, WINDOWTITLE_LOC)
	lContinue = .f.
ENDIF

IF lContinue

	IF NOT MESSAGEBOX(MSG_DELSCRIPT1_LOC, 4+32+256, WINDOWTITLE_LOC) = 6
		lContinue = .f.
	ENDIF

ENDIF

IF lContinue

	*-- Delete all selected scripts
	SCAN FOR selected
		REPLACE selected WITH .f. IN aaScripts
		DELETE IN aaScripts
	ENDSCAN

		IF MESSAGEBOX(MSG_DELSCRIPT2_LOC, 4+32+256, WINDOWTITLE_LOC) = 6
			*-- Issuing PACK causes the grid to be made blank. So this workaround.
			lc_TempFile = SYS(2023)+ "\" + SYS(2015) + ".DBF"
			COPY TO (lc_TempFile)
			ZAP
			APPEND FROM (lc_TempFile)
			DELETE FILE (FORCEEXT(lc_TempFile, "*"))
		ENDIF

	GOTO TOP IN aaScripts
	This.frmMain.pgfmain.Page1.grdscript.Refresh()
ENDIF

RETURN

ENDPROC
PROCEDURE deletetestlog
LOCAL	lContinue, ;
		nSno, ;
		lc_TempFile

lContinue = .t.

SELECT aaTestLog

lContinue = .t.

SELECT aaTestLog

LOCATE FOR Selected

IF NOT FOUND()
	= MESSAGEBOX(MSG_NOTESTLOG_LOC,0 + 48, WINDOWTITLE_LOC)
	lContinue = .f.
ENDIF

IF lContinue

	IF NOT MESSAGEBOX(MSG_DELLOG1_LOC, 4+32+256, WINDOWTITLE_LOC) = 6
		lContinue = .f.
	ENDIF

ENDIF

IF lContinue

	*-- Delete all selected test logs
	SCAN FOR selected
		REPLACE selected WITH .f. IN aaTestLog
		DELETE IN aaTestlog
	ENDSCAN

	IF MESSAGEBOX(MSG_DELLOG2_LOC, 4+32+256, WINDOWTITLE_LOC) = 6
		*-- Issuing PACK causes the grid to be made blank. So this workaround.
		lc_TempFile = SYS(2023)+ "\" + SYS(2015) + ".DBF"
		COPY TO (lc_TempFile)
		ZAP
		APPEND FROM (lc_TempFile)
		DELETE FILE (FORCEEXT(lc_TempFile, "*"))
	ENDIF

	GOTO TOP IN aaTestLog
	ThisFormSet.frmMain.pgfmain.Page3.Refresh()
ENDIF

RETURN

ENDPROC
PROCEDURE playresume
WITH This
	*-- Just play. .lPlayPaused will be used by play and methods it
	*-- calls to handle resuming at exact point play was stopped
	.Play()
ENDWITH

RETURN

ENDPROC
PROCEDURE playstop
WITH This
	.lPlayPaused = .f.
	This.cState = Cc_StateIdle
ENDWITH

RETURN

ENDPROC
PROCEDURE opentable
CREATE CURSOR errorlist(errormsg c(200), error L)

CREATE CURSOR tBreakPoint (scriptId N(6), ;
                           scriptLineNo I(4))
INDEX ON STR(scriptId, 6) + STR(scriptLIneNo, 8) TAG scriptId1

SELECT 0
USE aatestlog.dbf ALIAS aatestlog EXCLUSIVE

IF EMPTY(ALIAS())
	MESSAGEBOX(MSG_ERROR_OPN1_LOC, WINDOWTITLE_LOC, 16)
	RETURN .F.
ENDIF

REPLACE ALL selected WITH .f.
GO TOP

SELECT 0
USE aascripts.dbf ALIAS aascripts EXCLUSIVE

IF EMPTY(ALIAS())
	MESSAGEBOX(MSG_ERROR_OPN2_LOC, WINDOWTITLE_LOC, 16)
	RETURN .F.
ENDIF

SELECT aascripts

REPLACE ALL selected WITH .f.
GO TOP

RETURN .t.
ENDPROC
PROCEDURE Error
LPARAMETERS nError, cMethod, nLine

WITH This

	DO CASE
		CASE .lError
			*-- Don't log/display error if there is already an error

		CASE .cState = Cc_StatePlay AND ;
			TYPE("Thisformset.frmMain.BaseClass") = "C"
			*-- If the form is loaded and
			*-- If there is an error while playback, log it
			.LogError(MSG_PROGERROR_LOC + MESSAGE(), Cc_Error)

		OTHERWISE
			*-- If there is an error before loading the form itself
			MESSAGEBOX(MSG_PROGERROR_LOC + Cc_EOL + MESSAGE() ;
						+ Cc_EOL + "Method : " + cMethod + ;
						"  Line : " + STR(nLine, 3), ;
						WINDOWTITLE_LOC, 16)
			.lError = .t.
			.Release

	ENDCASE

ENDWITH

RETURN
ENDPROC
PROCEDURE Init
PUSH MENU _MSYSMENU
DO aatest.mpr

PUSH KEY CLEAR

ThisformSet.cStatePrev = Cc_StateIdle
ThisformSet.cState = Cc_StateIdle

DECLARE integer Sleep IN kernel32 integer
DECLARE integer keybd_event IN win32api integer, integer, integer, integer
DECLARE integer GetRoleText IN oleacc.dll integer, string @, integer
DECLARE integer SetForegroundWindow IN win32api integer
DECLARE integer SendInput IN win32api integer, string, integer
DECLARE integer FindWindow IN win32api string, string
DECLARE integer AccessibleObjectFromWindow IN oleacc.dll integer, integer, string , object @
DECLARE integer AccessibleChildren IN oleacc.dll integer pAcc, integer childStart, integer nchildren, string @, integer @

This.cScreenCaption = _Screen.Caption 
_Screen.Caption = WINDOWTITLE_LOC
This.frmMain.Caption = WINDOWTITLE_LOC

*-- define special keys here
WITH This
	DIMENSION .aSplKeys[21, 2]

	.aSplKeys[1,1] = 33
	.aSplKeys[1,2] = "PGUP"
	.aSplKeys[2,1] = 34
	.aSplKeys[2,2] = "PGDN"
	.aSplKeys[3,1] = 35
	.aSplKeys[3,2] = "END"
	.aSplKeys[4,1] = 36
	.aSplKeys[4,2] = "HOME"
	.aSplKeys[5,1] = 37
	.aSplKeys[5,2] = "LEFTARROW"
	.aSplKeys[6,1] = 38
	.aSplKeys[6,2] = "UPARROW"
	.aSplKeys[7,1] = 39
	.aSplKeys[7,2] = "RIGHTARROW"
	.aSplKeys[8,1] = 40
	.aSplKeys[8,2] = "DNARROW"


	.aSplKeys[9,1] = 112
	.aSplKeys[9,2] = "F1"
	.aSplKeys[10,1] = 113
	.aSplKeys[10,2] = "F2"
	.aSplKeys[11,1] = 114
	.aSplKeys[11,2] = "F3"
	.aSplKeys[12,1] = 115
	.aSplKeys[12,2] = "F4"
	.aSplKeys[13,1] = 116
	.aSplKeys[13,2] = "F5"
	.aSplKeys[14,1] = 117
	.aSplKeys[14,2] = "F6"
	.aSplKeys[15,1] = 118
	.aSplKeys[15,2] = "F7"
	.aSplKeys[16,1] = 119
	.aSplKeys[16,2] = "F8"
	.aSplKeys[17,1] = 120
	.aSplKeys[17,2] = "F9"
	.aSplKeys[18,1] = 121
	.aSplKeys[18,2] = "F10"
	.aSplKeys[19,1] = 122
	.aSplKeys[19,2] = "F11"
	.aSplKeys[20,1] = 123
	.aSplKeys[20,2] = "F12"

	.aSplKeys[21,1] = 9
	.aSplKeys[21,2] = "TAB"

ENDWITH

SET MEMOWIDTH TO 255
**-----------------------debug hook
PUBLIC gl_pause
gl_Pause = .f.

ON KEY LABEL CTRL+F9 gl_Pause = .t.


ENDPROC
PROCEDURE Destroy
LOCAL	cTemp, ;
		cSetPath

cTemp = This.cSetEscape

POP KEY

POP MENU _MSYSMENU

*-- Release the windows if defined otherwise it holds the table opened in the
*-- private data sessions
CLEAR WINDOW

*-- This code is required to show the command window if its docked
lDockEnable = WDOCKABLE('command')
WDOCKABLE('command', .f.)
WDOCKABLE('command', lDockEnable)

_Screen.Caption = This.cScreenCaption

SET ESCAPE &cTemp.

IF NOT EMPTY(This.cResourceFile)
	SET RESOURCE TO (This.cResourceFile)
ENDIF

**  Restore the path
cSetPath = SET('PATH')

cSetPath = STRTRAN(cSetPath, ',' + TESTHARNESSPATH_LOC)
cSetPath = STRTRAN(cSetPath, TESTHARNESSPATH_LOC)

SET PATH TO (cSetPath)

*-- Cleare DLL declarations
CLEAR DLLS	Sleep, ;
			keybd_event, ;
			GetRoleText, ;
			SetForegroundWindow, ;
			SendInput, ;
			FindWindow, ;
			AccessibleObjectFromWindow, ;
			AccessibleChildren, ;
			FindWindowEx, ;
			GetWindow, ;
			GetWindowText, ;
			IsWindowVisible, ;
			GetSystemDirectory

RETURN


ENDPROC
PROCEDURE Load
LOCAL	lReturn, ;
		cSetPath

lReturn = .t.

SET TALK OFF
SET DELETED ON
SET SAFETY OFF
SET EXACT ON

This.cSetEscape = SET("ESCAPE")

IF (SET('RESOURCE') = 'ON')
	This.cResourceFile = SET("RESOURCE", "TO")
	SET RESOURCE OFF
ELSE
	This.cResourceFile = ""
ENDIF

SET ESCAPE OFF

cSetPath = SET('PATH')

IF EMPTY(cSetPath)
	SET PATH TO (TESTHARNESSPATH_LOC)
ELSE
	SET PATH TO (cSetPath + ',' + TESTHARNESSPATH_LOC)
ENDIF

*-- Initialize the global object
This.oGlobal = NEWOBJECT("cstglobal", "aautils")

This.cGuid = This.Str2Guid(IAccGuid)	&& IAccecssible

lReturn = lReturn AND NOT This.lError AND This.OpenTable()

RETURN lReturn
ENDPROC
�r�� Y�Y�(%*v���.y�U9���T�������T����
���
����UVNEWVALTHIS
CSTATEPREVCSTATETHISFORMSETREFRESH:
�����/�%�C���+�T���������B�UTHISRECORDBEGINCSTATE�
�����t�#����������T��a��T�	�-��%T�
�C��]�\C��]�.txt��M(�`�����!�		"SYS(2801,3)" + CHR(13) +�D�>		"SET EVENTLIST TO MOUSEUP, MOUSEDOWN, keypress"  + CHR(13) +�@�:		"SET EVENTTRACKING TO [<<.cEventLogFile>>]"  + CHR(13) +��		"SET EVENTTRACKING ON"��!T���EXECSCRIPT(��)��
H�q��������T��������
��������(T��C�visualfoxpro.application�N��T���a����C�9����T������2��T��C��
�������T���
����
%����a�
T�����'T��C�
��
�����A�����
T�����%���
��������T��������1%�C�oaccvfp.accchild(int(2^31-1))b�U���"T���CC������A�8������
H��]�L�C�This.oVFP.Nameb�U�%����Microsoft Visual FoxPro	
����[��C�$The application selected is not VFP.�%VFP Active Accessibility Test Harness��x��T��-���������]�n��C�7Test Harness is not supported in VFP runtime libraries.�%VFP Active Accessibility Test Harness��x��T��-����T�����	
	�C�	��
%����p�,%�C�_SCREEN.WindowState��������(��C�_SCREEN.WindowState = 2������T� ����!��T�"����#��"T�$�C�_SCREEN.Left�����!T�%�C�_SCREEN.Top�������C��������C�������	B����U&THISNHWNDOACCVFPOACCNRETVALCRECONSCRIPT	LCONTINUEOEXTERNALVFPCTMPSTRLERROR
CEVENTLOGFILELPLAYINSERTNTESTAPPHWNDFRMMAINPGFMAINPAGE2	CHKNEWVFPVALUEVISIBLESETFOREGROUNDWINDOWHWNDOGLOBALSELAPPLICATIONACCESSIBLEOBJECTFROMWINDOWCGUIDOVFPACCCHILDNAME	STARTMODEGETTESTINFOEVALDOCMDNAPPLEFTLEFTNAPPTOPTOPNSCREENLEFT
NSCREENTOPc
�����\�������
������T�����M(�`�����+�%		"SET EVENTTRACKING TO"  + CHR(13) +�+�%		"SET EVENTTRACKING OFF" + CHR(13) +��		"SET EVENTLIST TO"��!T���EXECSCRIPT(��)��
T�����	M(���	LPARAMETERS oApp����
	* Setup Vars��	LOCAL oVFP��	oVFP = oApp.oVFP����	* Setup Environment�%�	oVFP.DoCmd("SYS(2800,16 + 1)")��,%�C�Thisformset.oVFP.Captionb�C������C�������%��	
��6�F�
�>��-��-�C�
fCC��C�
>=f��%�C4��I�&>��C���������������o�	aascripts�C�����!T��CC�������6��kr��	aascripts���
����������������C�����������������7>������������������a�����C� ��T�	�-�� ������U!THIS
CRECOFFSCRIPTCCAPTION
CPRESCRIPTCTMPSTRATESTIDCTESTCAPTIONOVFPDOCMDLPLAYINSERT	AASCRIPTSALLSELECTEDDESC	CTESTNAMEEVTLOG
CEVENTLOGFILECAPTIONRECTIMETRECTIMEIDNAME	PRESCRIPT
POSTSCRIPTAPPLEFTNAPPLEFTAPPTOPNAPPTOP
SCREENLEFTNSCREENLEFT	SCREENTOP
NSCREENTOPSCRIPTPARSE������T��a��
�������T��-��T���%��
����F��
-����
%�C4
����`��C�)No script has been selected from the list�%VFP Active Accessibility Test Harness��x��T��-���
%������%���	�
���
��L�)T��C�visualfoxpro.application�N��T�������T����a�����T��C��	������T��������
%������
T�����%T��C��
�����A�����%���	�
���

��5�.%�C�oacc.accchild(int(2^31-1))b�U��1� T��CC������A�8������
H�F���L�C�This.oVFP.Nameb�U�%����Microsoft Visual FoxPro	
����[��C�$The application selected is not VFP.�%VFP Active Accessibility Test Harness��x��T��-�����������n��C�7Test Harness is not supported in VFP runtime libraries.�%VFP Active Accessibility Test Harness��x��T��-�����%����
	����'%���	�
���
�C��
	��P�%���	�
���
���&��C�SET COVERAGE TO �������L�3��C�SET COVERAGE TO ��	 ADDITIVE���������C����T������T��-����C���%������T���������'%���	�
���
�C��
	����!��C�SET COVERAGE TO ��������C�C����%����n�XT��	� �
���	� �
�Error running the script. �Playback stopped.C�
 �����7T��	� �
���	� �
�Runs CompletedC�
 ���T����������B�U!	LCONTINUEOACCNRETVALTHISLERROROVFPLPLAYPAUSED	AASCRIPTSSELECTEDFRMMAINPGFMAINPAGE2	CHKNEWVFPVALUENTESTAPPHWNDHWNDVISIBLEOGLOBALSELAPPLICATIONACCESSIBLEOBJECTFROMWINDOWCGUIDACCCHILDNAME	STARTMODEPAGE4CHKCOVELOGON
CCOVERLOGFILECHKOVERWRITECOVLOGDOCMDSETFOREGROUNDWINDOWCSTATEPLAYLOOP	EDTSTATUS�S��
�������
T��C���T��CC��]�����T��C�	MESSAGE()�����T��������	�����%�CC�
���
������C�
������C��������U
	ERRORLISTTHIS	NDURATIONNMEMORYUSAGEOVFPEVAL	CFOXERRORNHISTCNTAHIST
NCACHESIZE	AASCRIPTS	PRESCRIPTSLEEP=���
������T��C��]�.txt��
�����2�%��
����B%�C���
��
	�#C�Thisformset.oVFP.Captionb�C	������C�������C������T��C������C�������C�Test Passed.�������T��C�����,%�C�Thisformset.oVFP.Captionb�C��U�T�	�CC��]��
��	���k�T�	�����F��(����
��o�	aatestlog�C�����!T��CC�������6���r��	aatestlog�����������������������������C�����
������	�����C��
 ����5%��
�#C�Thisformset.oVFP.Captionb�C	��.�8T���
The Test Run C�Z� has been completed��c��C�MESSAGEBOX([��],0, [�%VFP Active Accessibility Test Harness�	], 10000)��
������B�U
CERRORLOGFILEATESTIDTHISLERROR	AASCRIPTS
POSTSCRIPTSLEEP	NDURATIONLOGERRORNMEMORYUSAGEOVFPEVAL	ERRORLISTERRORMSGTESTID	AATESTLOGSCRIPTIDITERNONAMENOTESRESULTSPASSEDOBJCOUNTMEMUSEDURATIONPLAYTIMENTESTIDNTESTRUNDESCCMESSAGEDOCMDM
�����F�%������ ��3���C����T��������UTHISCSTATE	RECORDEND�������
������
%������M(�`�����,�&			"SET EVENTTRACKING TO"  + CHR(13) +�,�&			"SET EVENTTRACKING OFF" + CHR(13) +��			"SET EVENTLIST TO"��!T���EXECSCRIPT(��)����C������T��������M(�`�����J�D			"SET EVENTTRACKING TO [<<.cEventLogFile>>] ADDITIVE"  + CHR(13) +�+�%			"SET EVENTTRACKING ON" + CHR(13) +�8�2			"SET EVENTLIST TO MOUSEUP, MOUSEDOWN, keypress"��!T���EXECSCRIPT(��)����C������T���������B�ULPAUSEDCRECPAUSESCRIPTCTMPSTRTHISFORMSETOVFPDOCMDCSTATEY
�����N�T��-��T�����T�����T��a����C�����B�UTHISLPLAYPAUSEDNPLAYINSERTLINENPLAYPAUSEDLINENPLAYINSERTSCRIPTRECNONPLAYPAUSEDSCRIPTRECNOLPLAYINSERTRECORD���F��%�C�	aaScripts+��0�
-�����%�C�	aaScripts+����X��C�!You must select a script to edit.��%VFP Active Accessibility Test Harness�x����T�������6s,������
�(��(���Z�����'��Edit Script��/��,��T��������B�UCWINDOW	AASCRIPTSSELECTEDTHISFORMSETCSTATESCRIPTD���(T��C�visualfoxpro.application�N��T���a��B�UOEXTERNALVFPVISIBLEw
�����p�T���T���T�����������(���������d����������������U	THISFORMSETOGLOBALOTOOLBAR
NFORMCOUNTTHIS	FORMCOUNTIFORMSRELEASEl���,T��C�internetexplorer.application�N��$��CC���aatesthelp.htm����T���a��B�UOBROWSERNAVIGATEVISIBLE
���T��a��
�������T�����T��C��*%�C�.oVFP.Forms(1).Captionb�C��~�T��C����������T��������+��
����MT��C�Enter Test Name �%VFP Active Accessibility Test Harness���%�C�����T��-��!��F�	�-�C�
fCC�C�
>=f��%�C4�����%�����
��
�lC�The test script '��' already exists. Overwrite?�%VFP Active Accessibility Test Harness�$�x�	����.����!�����!�����	B����ULRETURNTHIS	CTESTNAMETRECTIMECTESTCAPTIONOVFPFORMSCAPTIONLPLAYINSERT	AASCRIPTSDESCFRMMAINPGFMAINPAGE2CHKOVERWRITESCRIPTVALUEa������T���0123456789abcdef��3B�CC�
��=����CC�
��R�����UCSTRLCCHARSN��������T��CCC�
���\�� CCC�
���\�� CCC���\�� CCC�
���\�� CCC���\�� CCC�
��
�\�� CCC���\�� CCC�
���\�� CCC���\�� CCC�
���\�� �������(����>�.T���CCC�
���
���\�� ����	B����UCSTRILCGUIDTHISHEX2VAL���������
H�(��������O���C�������������v���C����������������;%�C��000000A4�00000204�000000A5�00000205�����!%�����	MouseDown�� �9��C�	��
��C��%�
��C��%�����%�����MouseUp��|�9��C���
��C��%�
��C��%������B�!%�����	MouseDown����9��C���
��C��%�
��C��%�����%�����MouseUp��>�9��C���
��C��%�
��C��%������
H�S��������z���C�����������������C����������������B�U	CMOUSEEVENT
CMOUSEEVENTIDLMOUSEDOWNUPXY
NSHIFTCTRLALTKEYBD_EVENTTHIS	SENDMOUSE�4������������	�
��J���(���	�
��T��a��
H�k������KeyPress������
���(��������CC�gCC����g�������C�Mouse�������
H�����c��
�RC��000000A1�000000A2�000000A4�000000A5����MouseUp�
C�g�		����%�C�g�����T���������T������������!T�����������!T�������������C����
�����"�T�������T�����,����
��T�T�������T������2���T�������T�������� %���MouseUp��
����"%������������T�	�����T�
������A�T�	�����T�
�����%�C��
��=���C��	�
������
%����g�T��CC����g���|�
T������%��C����	�
��� ���T�������T��������B�U!OACCCEPATHCEVENTNXNY
LFORMTITLEBARNXOFFSETNYOFFSETLMOUSEDOWNUPNMOUSEXNMOUSEY
NSHIFTCTRLALTEVENTNREPEATCOUNTTHISKEYBRDPARAMSFOXEVTEVENTIDOVFPLEFTNAPPLEFTTOPNAPPTOPNSCREENLEFT
NSCREENTOPCAPTIONNFRMLEFTNFRMTOPNLASTMOUSEXNLASTMOUSEY
CALCMOUSEPOSNDOCLICKQ������������
T�����T��� T��C�	SYS(2800)��	�
��
%������ ��C�
SYS(2800, 17)��	��������C�SYS(2800, 1)��	����T��C������
���(�����T��C�C�
�����
H�����C�����C������A�T��C�
�����C���	�������#�����(�CC�
�������$T��C�C�C�
������%%�C����C�
C����	����T��C�C�
�����!�����%�C��
���
T�����!����&��C�
SYS(2800, ��)��	���	B����UOACCVFPCFORMSTRING
LFORMTITLEBARLSET16CFORMCAPTIONORETNCHILDSNSYS2800THISOVFPEVALDOCMD
ACCCHILDCOUNTIACCCHILDACCNAMECAPTIONJ�����'���������	��T���T����
��
T�����T��CC� �
��Q��%��
����s�YT��CC���{�$618736E0-3C3D-11CF-810C-00AA00389B71�}]��
��������C��]��%��
�����������(��
�����'T��C�
���
����\��T�	�C�
���
��
H�f�����
�	�	����!T��C�CC�
��	\��
]��?%�C�m.otmp.accname[0]b�C�CC��
��fC�
�f	����T���
����2�������o������(��
���k�T��C��
���� %�C�
�fCC��
��f��g�T���
���!������B��
���UOACCCNAME	NOBTAINED	SCHILDRENNCIOTMPORETCVARVT
ACCCHILDCOUNTACCESSIBLECHILDRENTHISSTR2NUMACCNAMEACCCHILD����������T��������(�������T��C�����%��C��
������T���
���!����	B����UOACCNROLEORETIOTMP
ACCCHILDCOUNTACCCHILDACCROLE������������
T�����T��C����T��C��
��T��C����
�������T��C��	����
H��������������T���KEYBOARD '{��
%������T����SHIFT+���
%�����T����CTRL+���
%����;�T����ALT+���%�������T��C��	����� T���C���	�}'�����T���C� �}'���%�����	
������C���
���
��C����������(���C�����
����C�����
��
��������C������
����C�����
����C�����
����C������
��
��������C������
����C�����
����C�����
����C������
�����B�UNCHARNVKNELEMENT
NSUBSCRIPT
CKEYSTRINGLALTLSHIFTLCTRLTHISASPLKEYSOVFPDOCMDSLEEPKEYBD_EVENT���������
T�����
T�����
�������i%�������	�	���	�#C�Thisformset.oVFP.Captionb�C	��
C�	MESSAGE()���	���T�
�C�	MESSAGE()�����>T���C�
 �A VFP error has occured.�'�
�'����
T������
H�)���������T�T���Error : �����������T���
Warning : ���2���
T������%r��	errorlist����������ZT���Error running the script. �C�
 �%Please check the test log for details��%��������T�
�a��%T����	�����	�C�
 ��,%�C�Thisformset.oVFP.Captionb�C����b��C�MESSAGEBOX([��], 0, [�%VFP Active Accessibility Test Harness�	], 10000)���������B�U
CERRORMESSAGENERRORCMESSAGECLOGMESSAGETHISFRMMAINPGFMAINPAGE2CHKVFPERRORVALUE	CFOXERROROVFPEVALLERROR	EDTSTATUSDOCMD*��������T��C� CC� �Q��3T���CC�
��G C�
�� CC� �Q��3T���CC�
��G C�
�� CC� �Q��T���CC� �Q��3T���CC�
��G C�
�� CC� �Q��T���CC� �Q��T���CC� �Q����C��C�>���UNMOUSEEVENTSXYLCINPUT	SENDINPUT����
�������%����0�T������E�
T������+�������T�����<T����������
  Run number:C�_C�
 ��F��%������#���	�����	#�)��~$��
����T�	�C�	aaScriptsO��7T����������    Script:��C�
 ��T���
��T�����%��
��s���C������C���%������!����C���%������!��F���%�������!��T���������B�ULNRUNNUMTHISLPLAYPAUSEDNPLAYPAUSEDRUN	NRUNCOUNTFRMMAIN	EDTSTATUSVALUE	AASCRIPTSNPLAYPAUSEDSCRIPTRECNOSELECTEDDESCNTESTIDIDNTESTRUN	PLAYBEGINPLAYTESTPLAYENDLERRORs�������
T����������(���������c�&T���
��CC�
��
��\����	B����UCSTRIN;
�������������	�
�����
������������J���(���	�
�T���T�
�a��
�����0
�
T�����%T��C��
�����A�����
T�����%�C���������V�T������T��C�����%�C���!�%������ �!����G��C�The startup form/window 'C���' is not available���"��8T���#�!����#�!�Script Failure!C�
 ��B���G��C�The startup form/window 'C���' is not available���"����R�
T�����T�$����T�%������T�&���'��T�(���)��T�*���+��T�,���-��T��C��]�.txt����C��.�����h��EVENTS�0�C����1�C����2�N����3�N����4�C����5�C��s��6�N�������7�L�����
 ����%��8����#�/��9��H�/�T�8�-�����	#�/)��T�:��    ��	~$�!
�(%�CC�/�0A�=�*�	C�/�0���7�T��C�EXACTv��G�T��C��.C�eventsO���
H�0��%�CC�/�0Af�*�COMMAND ����%T�;�C�C�*�COMMAND >�\��&lc_Command.
F�/��CC�/�0Af�*�=����T��C�C�*�=>�\����C���F�/� �CC�/�0Af�*�DO ��4� T��C�C�*�DO >�\��DO &lc_Do.
F�/� �CC�/�0Af�*�IF ���� T��C�C�*�IF >�\��%�C��
����F�/�;-$�CC�/�0Af�*�ELSE�CC�/�0Af�*�ENDIF�����F�/��"�CC�/�0Af�*�ENDIF����!�CC�/�0Af�*�ELSE��;�-+�CC�/�0Af�*�ENDIF��$�CC�/�0Af�*�<PAUSE>���1R,��@���Playback has been paused.����C�C��<��@T���#�!����#�!�Playback has been paused.C�
 ����Ca���#�=��T�8�a��T�9�C�eventsO��!��SET EXACT &lc_Exact.
.��9%��0�:�$�0�	MouseDown��0�MouseUp	��x�.��T�:��0��T���/�6���>����C��?��_%�C����5���C�$�5��	�C�%�5��	� C�KeyPress�0���C�5�	
	��6�T���T�
�a����C���?��B%�C�.oVFP.Forms(1).Nameb�C�CC����@�A�5�����	�
T���5��T��C���
���%�C�����T��C���
a����%�C����	�
H����	� ������B�!���r	�d��C�The object C��� does not have the focus. � �Script line CC�eventsOZ���"��!� ������B�!����	�.� ������B�!����	����	�
T�����T�$����T�%�������
�T��C����@��<%�C�oForm.TitleBarb�N���C�	�	C�����d
�T�$���A��T�
�-���}
�T�$������T�$���A��
T�����'T��C���
�����A������%�C��
��2� ��C���	�
���D��T�E����T�F����T�G��	��T�H��
�����%������I�!� C�KeyPress�0���C�5�	
	�WCC�5�$����C�.C�5�$����CC�5�%����C�.C�5�%���
	����2%�C�C�5�C�KeyPress�0����J
��|�
H��x� ������B�!���4�!� ������B�!���X�.� ������B�!���x����%��C�C�5�C�0��2�3�
�K��T���T���%��L����!��#%�C�gl_Pauseb�U��M	��
�R,�����
Suspending...����L���T�����B�UNHWNDOACCVFPOACC	LCLOGFILELCSTR
LCFULLNAMENRETVALFRMLEFTFRMTOPFRMWIDTH	FRMHEIGHTOFORM	CFORMNAME
LFORMTITLEBAROACCOBJ
NTIMEINTERVALLC_EVALLC_DOLC_IFLC_CURRENTEVENTLINELC_EXACTTHISACCESSIBLEOBJECTFROMWINDOWNTESTAPPHWNDCGUID	AASCRIPTSCAPTIONOVFPGETCONTAINERFORMFRMMAINPGFMAINPAGE2
CHKSTARTUPWINVALUELOGERROR	EDTSTATUSCCURRWINNAME
CCURRFORMNAMENAPPLEFTAPPLEFTNAPPTOPAPPTOPNSCREENLEFT
SCREENLEFT
NSCREENTOP	SCREENTOPSCRIPTEVENTSEVENTEVENTIDMXMYPARAMSRESTDELAYFOXEVTLPLAYPAUSEDNPLAYPAUSEDLINE
CLASTEVENT
LC_COMMANDSETFOREGROUNDWINDOWREFRESHNDELAYSLEEPFORMSNAME
OPGFAILOPTIONTITLEBARACCLOCATIONNFRMLEFTNFRMTOP	NFRMWIDTH
NFRMHEIGHTCHKOBJECTLEVELCHECKTHEOBJ
DOTHEEVENTLERRORGL_PAUSE�3�����������	�
�� R,:��Parsing the script...��
��������h��	tmpEvents��N��������C��x���C�����C�����N�����N�����C�����C��s���L������	^J��~���BR,:��Parsing the script - item CCCOZ�� of CCCNZ��...��Q%�C�MouseUp(����C�
MouseDown(����C�	KeyPress(�������%�C�screen.��������.��T��C�(����T��C�.����T��CC���\�)����T��CC���=���!T��C������\��T��CC����g��T��CC����g��"T��C����� C������T��� C��,� ���
H�����C�KeyPress�������T���00000100��,�C�	MouseDown����
C�g�	��:�T���00000201��*�C�MouseUp����
C�g�	��y�T���00000202��,�C�	MouseDown����
C�g�	����T���00000204��*�C�MouseUp����
C�g�	����T���00000205��2��T���00000000���E%���
�C�KeyPress����	�C�	KeyPress(���	��z��
H������
>��������G>��������������������������a������T��CC���\���T��C��#\��%�C�KeyPress�����>�"T��C����� C�������^�T��C����� ���T��CC�������T��C��.�����`>������C��
�\���CC���\g���CC���\g���� ��������^J���R,:��Saving the script...��#)�T������~�x�
T�	����>�������^J��T����	���-(������������F��%��
����>���C�������#�����T�
�C��]�.tmp�������(�C�����l���CC����C�
 �
a���%�����h���CC���C�
 �
a������>���C�
������R�Q�
�B�U
OPREVEVENT
NPARAMPOSN
NRIGHTDOTPOSNCPARAMSCRESTCEVENTCEVENTIDNXNYNCURRTSTAMPLC_TEMPFILELN_LINETHIS	TMPEVENTSTSTAMPFULLNAMEEVENTEVENTIDMXMYPARAMSRESTFOXEVT
CEVENTLOGFILE	AASCRIPTSLPLAYINSERTSCRIPTINNPLAYINSERTSCRIPTRECNONPLAYINSERTLINE�������+�������	�
���
�
T�
����T��a��
T�����
T�����T��C����.��T���
��.��T��C�
�C���C�>\��
T�
����
�����x�+��
����T��C�.�
���%��
�����!��T�	�C�
��
��=��T��C�
��
��\��T������T��-��%�����E�%�C�	@C�������T�
�C������A������(���� �%�CC�
�������!��T���
�������T���
���������T������T��a����X�T��a���
%������%�C�
���O��~����T�
�C�
�	���T��������C�	@��T���������
��T���������%�C�
��_�T��-��ST���The object �� doesn't exists.� �Script line CC�eventsOZ����
%�����T�
�C��
��� %�C�
�
@����
�T��-��WT���The object �� does not have the focus.�Script line CC�eventsOZ�����%��
��t�%����������U���C�������p���C����������
T���
��	B����U
OACCCONTAINERCEPATHLCHECKFOCUSOACCOBJCTMPNDOTPOSNNCNTILFGETNEWONECWORDORETLRETURNCMESSAGE	NACCSTATECSTARTACCNAMETHISLERRORNHISTCNTAHIST
NCACHESIZEGETOBJWITHNAMEACCSTATEFRMMAINPGFMAINPAGE2
OPGFAILOPTIONVALUELOGERROR�4����������J���(����� ��C���������%�C�����
����T�������%�C�����
����T�������B�UOACCNMOUSEXNMOUSEYNOBJLEFTNOBJTOP	NOBJWIDTH
NOBJHEIGHTACCLOCATION�����T��a��T��������F��
-����
%�C4
����k��C�4No script has been selected from the list to delete.�0�%VFP Active Accessibility Test Harness�x��T��-���
%����L�l%�C�+Do you want to delete the selected scripts?�$�%VFP Active Accessibility Test Harness�x�
��H�T��-����
%����y�~������>���-�����}%�C�=Do you want to permanently remove (pack) the deleted scripts?�$�%VFP Active Accessibility Test Harness�x���S�$T��C��]�\C��]�.DBF��(����S������C��*�����	#�)���C�	���
�����B�U
	LCONTINUELC_TEMPFILETHISFORMSETFRMMAINPGFMAIN
ACTIVEPAGE	AASCRIPTSSELECTEDINTHISPAGE1	GRDSCRIPTREFRESH������T��a��F��T��a��F��
-����
%�C4
����m��C�6No test log has been selected from the list to delete.�0�%VFP Active Accessibility Test Harness�x��T��-���
%����P�n%�C�-Do you want to delete the selected test logs?�$�%VFP Active Accessibility Test Harness�x�
��L�T��-����
%����{�~������>���-�����~%�C�>Do you want to permanently remove (pack) the deleted testlogs?�$�%VFP Active Accessibility Test Harness�x���X�$T��C��]�\C��]�.DBF��(����S������C��*�����	#�)���C����	�
���B�U	LCONTINUENSNOLC_TEMPFILE	AATESTLOGSELECTEDINTHISFORMSETFRMMAINPGFMAINPAGE3REFRESH#
��������C�����B�UTHISPLAY5
�����*�T��-��T���������B�UTHISLPLAYPAUSEDCSTATE�)h��	errorlist��C�����L�2h��tBreakPoint��N�����I����& �C��ZC��Z���F��Q��
aatestlog.dbf��%�CC����S��C�Could not open aatestlog.dbf�%VFP Active Accessibility Test Harness��x��B�-���>�
�-��#)�F��Q��
aascripts.dbf��%�CC�����S��C�Could not open aascripts.dbf�%VFP Active Accessibility Test Harness��x��B�-���F��>�
�-��#)�B�a��U	ERRORLISTERRORMSGERRORTBREAKPOINTSCRIPTIDSCRIPTLINENO	SCRIPTID1	AATESTLOGDBFALLSELECTED	AASCRIPTSH�����
�����=�
H�)�9�����7�>�����(C�Thisformset.frmMain.BaseClassb�C	����(��C�Application error. CE�����2�9����C�Application error. C�
 CEC�
 �	Method : ��	  Line : C��Z�%VFP Active Accessibility Test Harness��x��T��a��������B�UNERRORCMETHODNLINETHISLERRORCSTATELOGERRORRELEASE�����
aatest.mpr���T�������T�������|�Sleep�kernel32�&|�keybd_event�win32api����'|�GetRoleText�
oleacc.dll���(|�SetForegroundWindow�win32api�"|�	SendInput�win32api���!|�
FindWindow�win32api��8|�AccessibleObjectFromWindow�
oleacc.dll���.�3|�AccessibleChildren�
oleacc.dll������T����9���4T�9���%VFP Active Accessibility Test Harness��8T�����%VFP Active Accessibility Test Harness��
���������������T���������!��T���������PGUP��T���������"��T���������PGDN��T���������#��T���������END��T���������$��T���������HOME��T���������%��#T���������	LEFTARROW��T���������&��!T���������UPARROW��T���������'��$T���������
RIGHTARROW��T���������(��!T���������DNARROW��T���	������p��T���	������F1��T���
������q��T���
������F2��T���������r��T���������F3��T���������s��T���������F4��T���
������t��T���
������F5��T���������u��T���������F6��T���������v��T���������F7��T���������w��T���������F8��T���������x��T���������F9��T���������y��T���������F10��T���������z��T���������F11��T���������{��T���������F12��T���������	��T���������TAB����G$(�����7��T��-��!12�CTRL+F9�gl_Pause = .t.�UAATESTMPRTHISFORMSET
CSTATEPREVCSTATESLEEPKERNEL32KEYBD_EVENTWIN32APIGETROLETEXTOLEACCDLLSETFOREGROUNDWINDOW	SENDINPUT
FINDWINDOWACCESSIBLEOBJECTFROMWINDOWACCESSIBLECHILDRENTHISCSCREENCAPTIONCAPTIONFRMMAINASPLKEYSGL_PAUSECTRLF9����T�����������,�T��C�command����C�command-����C�command���T�9������SET ESCAPE &cTemp.
%�C���
����GT(������T��C�PATHv��&T��C��,C�Q�TOOLS\TEST\���!T��C�C�Q�TOOLS\TEST\���G)(�����V�SLEEP�KEYBD_EVENT�GETROLETEXT�SETFOREGROUNDWINDOW�	SENDINPUT�
FINDWINDOW�ACCESSIBLEOBJECTFROMWINDOW�ACCESSIBLECHILDREN�FINDWINDOWEX�	GETWINDOW�
GETWINDOWTEXT�ISWINDOWVISIBLE�GETSYSTEMDIRECTORY�B�UCTEMPCSETPATHTHIS
CSETESCAPELDOCKENABLECAPTIONCSCREENCAPTION
CRESOURCEFILE�����T��a��G2�G �G.�G �T���C�ESCAPEv��%�C�RESOURCEv�ON����T���C�RESOURCE�TOv��GT����T�������G�T��C�PATHv��%�C������G)(�C�Q�TOOLS\TEST\����$G)(���,C�Q�TOOLS\TEST\���&T���C�	cstglobal�aautils���;T���C�$618736E0-3C3D-11CF-810C-00AA00389B71����#T������
	�C��		��	B����U
LRETURNCSETPATHTHIS
CSETESCAPE
CRESOURCEFILEOGLOBALCGUIDSTR2GUIDLERROR	OPENTABLE
cstate_assign,��record���recordbegin���	recordend��play���	playbegin���playend'��
recordstop���recordpause���recordinsscriptE��vieweventlog��	launchvfpy��abort���
launchhelp���gettestinfo0 ��hex2val�"��str2guidO#��doclick�$��
dotheevent�'��getcontainerform�,��getobjwithname�/��getobjwithrole�2��keybrd�3��logerrorK7��	sendmouse�:��playloop4<��str2num�>��playtestz?��scriptparse�O��checktheobj�X��
calcmouseposnM^��
deletescripts`_��
deletetestlogeb��
playresumeUe��playstop�e��	opentable�e��Errorh��Init�i��Destroy�q��Loadt��1q3"�3���ABB3�2��RA�A���������AB��q���!AB����Q��AB����A$!!#�AB�2�4�����A��qa1qa�QA�!A�q���c���AwB���A2������q���A���!���2AB��S��AB����Q��ABBbs�a�1AB�������sA����qA�BBBB2������QS1�AB2q����$�1A"���!A����Ar���R�1ABB2�2��A�B3q������A!�����A!�ABB3������AB5qr��A���c�AB3q��B2����A�A2q�A�B2q�������"A��AAr���A�AA�AABB�2qq�13q�uq�A�3��bbB��A��A��A��AB�bbBB2������t�A��38���E�BA�B�BAA#��BB�Q��ARBBAAB322�����As���bR�3AS�AAAB�AABc�2�r���2��2�qq�1��B�CA��q�AAAAB�3����Q��AAA��1���211�A����qA�aA�QAq��A�!�Aqq�aqqa�aqqaFBB3����������A�!�!���AR�#�Q�!ABBB2�q�11�1��a3q�����A2��r����A��r����A��AA��AArAAAABB2q���aA�3�11qq�����R��s��q�A�qA����AB�!c��������A"��Ba��QRq���q�qq��qA"�B�!�aCA�CA�AA�������#����A��AAAA����A�Q���A�qB����AB{	$�AAABBR���AA2�AAAB�BB3<��	���"�AAA21��RQ!���Q�Q�Q�Q�Q�QAUF���wA�t"�!��Ar�A�B�T��B�A�r�Q�����"�ABBABR�B31������B���Q2AA���"�a���AA��A!�A��A�Q�q��1ABB��1��B�qABB��1�1ABB��3�2��A�AB2��cr����A���AB����A�B�A�!A��AB3��r�r����A���AB����A�B�A�!A�aAB3��AB3��AB3�#����1qA�Q���1qAr�Qr2���������BBB2qb�aq�!�1"A��A���������1��A���������������������������B�r�4�RrTsAa"b2�A3b��B4��baaa���a�Ab2���AAc�2�11N�
�H9�vr���%�=��$T��$i%���%�(��(*�2*R,�r,�,�$-�-�.�-�.4�.<2SZ2�2CX3D5J`b5M;X�n;�H���H�N���NhS9��S.\nK\Ic�4hcAhSah�jD^�j�oQ�p�p���p5��4W�§���U���y�Ӳ�������v�K��@� _����&ϻB��<^����J�D���b�m�$���"�Z)Y��otoolbar
cstate Current state of the form
lsuspend Suspend by pressing hotkey
oglobal Global object which has common functions
ceventlogfile The event log file name
ovfp The AA client VFP object reference
ctestcaption Test startup window caption
ctestname Test Description
trectime Record start date time
ccurrformname Current form name in which the script is being run (it will be form.name or caption if name is not available)
clastevent
lerror Testing error
lmenuclicked
nlastmousex Last X co-ord of mouse
nlastmousey Last Y co-ord of mouse
nruncount
ntestid
ntestrun Test run number
ntestapphwnd The HWnd of testing application
nfrmheight
nfrmleft
nfrmtop
nfrmwidth
nappleft
napptop
cstateprev Previous state
cguid IAccessible GUId
ndelay
nmemoryusage Memory usage
nduration Testing time
ccoverlogfile Coverage log file
ncachesize
nhistcnt
cmessagebeforestart MESSAGE() value before start testing
ccurrwinname Current window/caption (returned by windows for win dialogs or form.caption)
cfoxerror The Fox error message (MESSAGE())
lplaypaused Property to check if play has been paused.
nplaypausedline Property to hold the line in the script where the play was paused.
nplaypausedrun Property to hold the run where the script was paused.
nplaypausedscriptrecno Property to hold which record in the script table the play was paused.
lplayinsert Property to flag whether we are inserting a script at a paused point.
nplayinsertline Property to hold line after which the insertion for recording needs to be done
nplayinsertscriptrecno Property to hold which record in the script table we are inserting into.
csetescape
cscreencaption
nscreenleft
nscreentop
cresourcefile Resource file name, to restore back
*cstate_assign 
*record Record script
*recordbegin Record begining hook 
*recordend Record end hook
*play Play the selected script
*playbegin play begining hook
*playend play end hook
*recordstop Stop recording and save the script
*recordpause Pause the recording
*recordinsscript Insert the recording
*vieweventlog Veiw event log
*launchvfp Launch VFP
*abort Exit out of the application
*launchhelp Invoke the help
*gettestinfo Accepts the record details like test log
*hex2val 
*str2guid 
^asplkeys[1,2] 
*doclick 
*dotheevent 
*getcontainerform Returns the container form of the passed name
*getobjwithname 
*getobjwithrole 
*keybrd 
*logerror Logs the error messages
*sendmouse 
*playloop 
*str2num 
*playtest Play a test script
*scriptparse Parse the event log script
^ahist[1,1] 
*checktheobj Check for a particular object name from the top level object
*calcmouseposn Calculate new mouse position
*deletescripts Method to delete the selected scripts.
*deletetestlog Method to delete the selected test log.
*playresume Method to resume play from where it had been stopped before.
*playstop Method to handle play getting stopped.
*geteventvalue Method to get the Event Value based on directive and event.
*opentable 
formformfrmMainfrstestharn�Top = 105
Left = 21
Height = 340
Width = 601
DoCreate = .T.
BorderStyle = 1
Caption = "VFP AA Test Harness"
MaxButton = .F.
WindowState = 0
Name = "frmMain"
	pageframe	pageframepgfmainfrstestharn.frmMain�ErasePage = .T.
PageCount = 4
Top = 8
Left = 10
Width = 582
Height = 249
TabIndex = 1
Name = "pgfmain"
Page1.FontName = "Tahoma"
Page1.Caption = "\<Scripts"
Page1.Name = "Page1"
Page2.FontName = "Tahoma"
Page2.Caption = "\<Options"
Page2.Name = "Page2"
Page3.FontName = "Tahoma"
Page3.Caption = "\<Test Log"
Page3.Name = "Page3"
Page4.FontName = "Tahoma"
Page4.Caption = "\<Coverage Log"
Page4.Name = "Page4"
gridgrid	grdscript!frstestharn.frmMain.pgfmain.Page1�ColumnCount = 9
FontName = "Tahoma"
DeleteMark = .F.
Height = 160
Highlight = .F.
Left = 12
Panel = 1
RecordSource = "aascripts"
TabIndex = 1
Top = 12
Width = 552
GridLineColor = 192,192,192
Name = "grdscript"
Column1.FontName = "Tahoma"
Column1.ControlSource = "aascripts.selected"
Column1.CurrentControl = "Check1"
Column1.Width = 41
Column1.Sparse = .F.
Column1.Name = "Column1"
Column2.FontName = "Tahoma"
Column2.ControlSource = "aascripts.id"
Column2.Width = 53
Column2.ReadOnly = .T.
Column2.Name = "Column2"
Column3.FontName = "Tahoma"
Column3.ControlSource = "aascripts.desc"
Column3.Width = 138
Column3.ReadOnly = .T.
Column3.Name = "Column3"
Column4.FontName = "Tahoma"
Column4.ControlSource = "aascripts.caption"
Column4.Width = 149
Column4.ReadOnly = .T.
Column4.Name = "Column4"
Column5.FontName = "Tahoma"
Column5.ControlSource = "aascripts.rectime"
Column5.Width = 80
Column5.ReadOnly = .T.
Column5.Name = "Column5"
Column6.FontName = "Tahoma"
Column6.ControlSource = "aascripts.prescript"
Column6.Width = 60
Column6.ReadOnly = .T.
Column6.Name = "colPreScript"
Column7.FontName = "Tahoma"
Column7.ControlSource = "aaScripts.Script"
Column7.ReadOnly = .T.
Column7.Name = "colScript"
Column8.FontName = "Tahoma"
Column8.ControlSource = "aaScripts.PostScript"
Column8.ReadOnly = .T.
Column8.Name = "colPostScript"
Column9.FontName = "Tahoma"
Column9.ControlSource = "aaScripts.EvtLog"
Column9.ReadOnly = .T.
Column9.Name = "colEventLog"
VPROCEDURE UIEnable
LPARAMETERS lEnable

IF lEnable
	This.Refresh
ENDIF
ENDPROC
�� ����%m��U%���
%�����
�����ULENABLETHISREFRESHUIEnable,��1q��A1K)�headerheaderHeader13frstestharn.frmMain.pgfmain.Page1.grdscript.Column1;FontName = "Tahoma"
Caption = "Select"
Name = "Header1"
textboxtextboxText13frstestharn.frmMain.pgfmain.Page1.grdscript.Column1-BorderStyle = 0
Margin = 0
Name = "Text1"
checkboxcheckboxCheck13frstestharn.frmMain.pgfmain.Page1.grdscript.Column1RFontName = "Tahoma"
Alignment = 0
Caption = ""
Visible = .T.
Name = "Check1"
headerheaderHeader13frstestharn.frmMain.pgfmain.Page1.grdscript.Column2>FontName = "Tahoma"
Caption = "Script ID"
Name = "Header1"
textboxtextboxText13frstestharn.frmMain.pgfmain.Page1.grdscript.Column2RFontName = "Tahoma"
BorderStyle = 0
Margin = 0
ReadOnly = .T.
Name = "Text1"
textboxtextboxText19frstestharn.frmMain.pgfmain.Page1.grdscript.colPostScriptRFontName = "Tahoma"
BorderStyle = 0
Margin = 0
ReadOnly = .T.
Name = "Text1"
headerheaderHeader17frstestharn.frmMain.pgfmain.Page1.grdscript.colEventLog>FontName = "Tahoma"
Caption = "Event Log"
Name = "Header1"
textboxtextboxText17frstestharn.frmMain.pgfmain.Page1.grdscript.colEventLogRFontName = "Tahoma"
BorderStyle = 0
Margin = 0
ReadOnly = .T.
Name = "Text1"

commandbutton
commandbuttoncmdDeleteScript!frstestharn.frmMain.pgfmain.Page1�Top = 182
Left = 481
Height = 27
Width = 84
FontName = "Tahoma"
Caption = "\<Delete"
TabIndex = 2
Name = "cmdDeleteScript"
EPROCEDURE Click
= ThisFormSet.DeleteScripts()

RETURN

ENDPROC
�� ���%`wo�U
��C����B�UTHISFORMSET
DELETESCRIPTSClick,��1�B2:)�shapeshapeShape1!frstestharn.frmMain.pgfmain.Page2cTop = 14
Left = 10
Height = 194
Width = 226
BackStyle = 0
SpecialEffect = 0
Name = "Shape1"
shapeshapeShape2!frstestharn.frmMain.pgfmain.Page2dTop = 14
Left = 229
Height = 194
Width = 336
BackStyle = 0
SpecialEffect = 0
Name = "Shape2"
labellabelLabel1!frstestharn.frmMain.pgfmain.Page2�AutoSize = .T.
FontName = "Tahoma"
Caption = "Recording"
Height = 16
Left = 22
Top = 6
Width = 56
TabIndex = 1
Style = 3
Name = "Label1"
labellabelLabel2!frstestharn.frmMain.pgfmain.Page2�AutoSize = .T.
FontName = "Tahoma"
Caption = "Playback"
Height = 16
Left = 241
Top = 6
Width = 48
TabIndex = 4
Style = 3
Name = "Label2"
optiongroupoptiongroupopgdelay!frstestharn.frmMain.pgfmain.Page2�ButtonCount = 2
BackStyle = 0
BorderStyle = 1
Value = 1
ControlSource = ""
Height = 84
Left = 241
Top = 106
Width = 156
TabIndex = 11
Name = "opgdelay"
Option1.FontName = "Tahoma"
Option1.BackStyle = 0
Option1.Caption = "\<Use recorded time"
Option1.Value = 1
Option1.ControlSource = ""
Option1.Height = 16
Option1.Left = 8
Option1.Top = 10
Option1.Width = 120
Option1.AutoSize = .T.
Option1.Name = "Option1"
Option2.FontName = "Tahoma"
Option2.BackStyle = 0
Option2.Caption = "Ti\<me interval (ms):"
Option2.Value = 0
Option2.ControlSource = ""
Option2.Height = 16
Option2.Left = 8
Option2.Top = 30
Option2.Width = 122
Option2.AutoSize = .T.
Option2.Name = "Option2"
RPROCEDURE InteractiveChange
= This.Parent.spnDelay.Refresh()

RETURN
ENDPROC
�� ��G�%k���U��C������B�UTHISPARENTSPNDELAYREFRESHInteractiveChange,��11B1G)�spinnerspinnerspndelay!frstestharn.frmMain.pgfmain.Page2�FontName = "Tahoma"
FontSize = 8
Enabled = .F.
Height = 24
Increment =  50.00
KeyboardLowValue = 0
Left = 331
SpinnerLowValue = -1000.00
TabIndex = 12
Top = 156
Width = 54
ControlSource = " Thisformset.nDelay"
Name = "spndelay"
�PROCEDURE Refresh
WITH This

	IF This.Parent.opgdelay.Value # 1
		.Enabled = .t.
	ELSE
		.Enabled = .f.
		.Value = 0
	ENDIF

ENDWITH

RETURN

ENDPROC
E�� ,,5�%����Ud
�����Y�%��������3�T��a���U�T��-��T��������B�UTHISPARENTOPGDELAYVALUEENABLEDRefresh,��1������ABB2�),optiongroupoptiongroup
opgfailoption!frstestharn.frmMain.pgfmain.Page2�ButtonCount = 3
BackStyle = 0
ControlSource = ""
Height = 84
Left = 409
Top = 106
Width = 144
TabIndex = 14
Name = "opgfailoption"
Option1.FontName = "Tahoma"
Option1.BackStyle = 0
Option1.Caption = "A\<bort playback"
Option1.Value = 1
Option1.ControlSource = ""
Option1.Height = 16
Option1.Left = 8
Option1.Top = 10
Option1.Width = 100
Option1.AutoSize = .T.
Option1.Name = "Option1"
Option2.FontName = "Tahoma"
Option2.BackStyle = 0
Option2.Caption = "S\<kip current event"
Option2.ControlSource = ""
Option2.Height = 16
Option2.Left = 8
Option2.Top = 30
Option2.Width = 121
Option2.AutoSize = .T.
Option2.Name = "Option2"
Option3.FontName = "Tahoma"
Option3.BackStyle = 0
Option3.Caption = "Continue pla\<yback"
Option3.Value = 0
Option3.ControlSource = ""
Option3.Height = 16
Option3.Left = 8
Option3.Top = 50
Option3.Width = 118
Option3.AutoSize = .T.
Option3.Name = "Option3"
labellabelLabel3!frstestharn.frmMain.pgfmain.Page2�AutoSize = .T.
FontName = "Tahoma"
Caption = "On script failure"
Height = 16
Left = 417
Top = 98
Width = 87
TabIndex = 13
Style = 3
Name = "Label3"
checkboxcheckboxchkoverwritescript!frstestharn.frmMain.pgfmain.Page2�Top = 26
Left = 20
Height = 16
Width = 151
FontName = "Tahoma"
AutoSize = .T.
Alignment = 0
BackStyle = 0
Caption = "Overwrite e\<xisting script"
Value = .F.
ControlSource = ""
TabIndex = 2
Name = "chkoverwritescript"
checkboxcheckbox
chkStartupWin!frstestharn.frmMain.pgfmain.Page2*Top = 26
Left = 241
Height = 16
Width = 242
FontName = "Tahoma"
AutoSize = .T.
Alignment = 0
BackStyle = 0
Caption = "\<Validate startup window before playback"
Value = .F.
ControlSource = ""
TabIndex = 5
ToolTipText = "Check the startup window/screen caption"
Name = "chkStartupWin"
spinnerspinnerspnRunCount!frstestharn.frmMain.pgfmain.Page2�FontName = "Tahoma"
FontSize = 8
Height = 24
KeyboardLowValue = 1
Left = 499
SpinnerLowValue =   1.00
TabIndex = 9
ToolTipText = "Repeat count"
Top = 68
Width = 54
ControlSource = ""
Name = "spnRunCount"
�PROCEDURE ProgrammaticChange
THIS.InteractiveChange()

ENDPROC
PROCEDURE InteractiveChange
THISFORMSET.nruncount=THIS.Value

ENDPROC
PROCEDURE Init
THIS.Value = THISFORMSET.nruncount
ENDPROC
��� ��2	%�*�U
��C����UTHISINTERACTIVECHANGET�������UTHISFORMSET	NRUNCOUNTTHISVALUET�������UTHISVALUETHISFORMSET	NRUNCOUNTProgrammaticChange,��InteractiveChangeY��Init���1�313118`���	)�labellabelLabel4!frstestharn.frmMain.pgfmain.Page2�AutoSize = .T.
FontName = "Tahoma"
BackStyle = 0
Caption = "\<Run count:"
Height = 16
Left = 433
Top = 71
Width = 63
TabIndex = 8
Name = "Label4"
checkboxcheckbox	chkNewVFP!frstestharn.frmMain.pgfmain.Page2�Top = 48
Left = 20
Height = 16
Width = 206
FontName = "Tahoma"
AutoSize = .T.
Alignment = 0
BackStyle = 0
Caption = "Always \<launch new VFP window *"
Value = .T.
ControlSource = ""
TabIndex = 3
Name = "chkNewVFP"
checkboxcheckboxchkobjectlevel!frstestharn.frmMain.pgfmain.Page2#Top = 48
Left = 241
Height = 16
Width = 209
FontName = "Tahoma"
AutoSize = .T.
Alignment = 0
BackStyle = 0
Caption = "C\<heck for presence of each object"
Value = .F.
ControlSource = ""
TabIndex = 6
ToolTipText = "Check the presence of all the objects"
Name = "chkobjectlevel"
checkboxcheckboxchkVFPError!frstestharn.frmMain.pgfmain.Page2Top = 70
Left = 241
Height = 16
Width = 150
FontName = "Tahoma"
AutoSize = .T.
Alignment = 0
BackStyle = 0
Caption = "Check for program \<error"
Value = .F.
ControlSource = ""
TabIndex = 7
ToolTipText = "Check for the program error (VFP)"
Name = "chkVFPError"
labellabelLabel6!frstestharn.frmMain.pgfmain.Page2�AutoSize = .T.
FontName = "Tahoma"
Caption = "Delay between events"
Height = 16
Left = 249
Top = 98
Width = 126
TabIndex = 10
Style = 3
Name = "Label6"
labellabelLabel5!frstestharn.frmMain.pgfmain.Page2�AutoSize = .T.
FontName = "Tahoma"
WordWrap = .T.
BackStyle = 0
Caption = "* Needed for Windows XP and above"
Height = 16
Left = 16
Top = 185
Width = 206
TabIndex = 10
Name = "Label5"
gridgrid
grdtestlog!frstestharn.frmMain.pgfmain.Page3�ColumnCount = 10
FontName = "Tahoma"
DeleteMark = .F.
Height = 160
Highlight = .F.
Left = 12
Panel = 1
RecordSource = "aatestlog"
TabIndex = 1
Top = 12
Width = 552
GridLineColor = 192,192,192
Name = "grdtestlog"
Column1.FontName = "Tahoma"
Column1.ColumnOrder = 3
Column1.ControlSource = "aatestlog.ScriptId"
Column1.Width = 52
Column1.ReadOnly = .T.
Column1.Name = "colScriptId"
Column2.FontName = "Tahoma"
Column2.ColumnOrder = 4
Column2.ControlSource = "aatestlog.iterno"
Column2.Width = 47
Column2.ReadOnly = .T.
Column2.Name = "Column2"
Column3.FontName = "Tahoma"
Column3.ColumnOrder = 5
Column3.ControlSource = "aatestlog.name"
Column3.Width = 144
Column3.ReadOnly = .T.
Column3.Name = "Column3"
Column4.FontName = "Tahoma"
Column4.ColumnOrder = 6
Column4.ControlSource = 'IIF(aatestlog.passed, "Pass", "Fail")'
Column4.Width = 61
Column4.ReadOnly = .T.
Column4.Name = "Column4"
Column5.FontName = "Tahoma"
Column5.ColumnOrder = 7
Column5.ControlSource = "aatestlog.results"
Column5.Width = 46
Column5.ReadOnly = .T.
Column5.Name = "Column5"
Column6.FontName = "Tahoma"
Column6.ColumnOrder = 8
Column6.ControlSource = "aatestlog.memuse"
Column6.Width = 86
Column6.ReadOnly = .T.
Column6.Name = "Column7"
Column7.FontName = "Tahoma"
Column7.ColumnOrder = 9
Column7.ControlSource = "aatestlog.duration"
Column7.Width = 75
Column7.ReadOnly = .T.
Column7.Name = "Column8"
Column8.FontName = "Tahoma"
Column8.ColumnOrder = 10
Column8.ControlSource = "aatestlog.playtime"
Column8.Width = 88
Column8.ReadOnly = .T.
Column8.Name = "Column10"
Column9.FontName = "Tahoma"
Column9.ColumnOrder = 1
Column9.ControlSource = "aaTestLog.Selected"
Column9.Width = 43
Column9.Sparse = .F.
Column9.Name = "Column6"
Column10.FontName = "Tahoma"
Column10.ColumnOrder = 2
Column10.ControlSource = "aatestlog.TestId"
Column10.ReadOnly = .T.
Column10.Name = "colTestId"
VPROCEDURE UIEnable
LPARAMETERS lEnable

IF lEnable
	This.Refresh
ENDIF
ENDPROC
�� ����%m��U%���
%�����
�����ULENABLETHISREFRESHUIEnable,��1q��A1K)�headerheaderHeader18frstestharn.frmMain.pgfmain.Page3.grdtestlog.colScriptId>FontName = "Tahoma"
Caption = "Script ID"
Name = "Header1"
textboxtextboxText18frstestharn.frmMain.pgfmain.Page3.grdtestlog.colScriptIdRFontName = "Tahoma"
BorderStyle = 0
Margin = 0
ReadOnly = .T.
Name = "Text1"
headerheaderHeader14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column2;FontName = "Tahoma"
Caption = "Iter #"
Name = "Header1"
textboxtextboxText14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column2RFontName = "Tahoma"
BorderStyle = 0
Margin = 0
ReadOnly = .T.
Name = "Text1"
headerheaderHeader14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column3@FontName = "Tahoma"
Caption = "Description"
Name = "Header1"
textboxtextboxText14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column3RFontName = "Tahoma"
BorderStyle = 0
Margin = 0
ReadOnly = .T.
Name = "Text1"
headerheaderHeader14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column4>FontName = "Tahoma"
Caption = "Pass/Fail"
Name = "Header1"
textboxtextboxText14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column4RFontName = "Tahoma"
BorderStyle = 0
Margin = 0
ReadOnly = .T.
Name = "Text1"
headerheaderHeader14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column5<FontName = "Tahoma"
Caption = "Results"
Name = "Header1"
textboxtextboxText14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column5RFontName = "Tahoma"
BorderStyle = 0
Margin = 0
ReadOnly = .T.
Name = "Text1"
headerheaderHeader14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column7AFontName = "Tahoma"
Caption = "Memory Usage"
Name = "Header1"
textboxtextboxText14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column7RFontName = "Tahoma"
BorderStyle = 0
Margin = 0
ReadOnly = .T.
Name = "Text1"
headerheaderHeader14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column8=FontName = "Tahoma"
Caption = "Duration"
Name = "Header1"
textboxtextboxText14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column8RFontName = "Tahoma"
BorderStyle = 0
Margin = 0
ReadOnly = .T.
Name = "Text1"
headerheaderHeader15frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column10=FontName = "Tahoma"
Caption = "Playtime"
Name = "Header1"
textboxtextboxText15frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column10RFontName = "Tahoma"
BorderStyle = 0
Margin = 0
ReadOnly = .T.
Name = "Text1"
headerheaderHeader14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column6;FontName = "Tahoma"
Caption = "Select"
Name = "Header1"
checkboxcheckboxCheck14frstestharn.frmMain.pgfmain.Page3.grdtestlog.Column6qTop = 34
Left = 33
Height = 17
Width = 60
FontName = "Tahoma"
Alignment = 0
Caption = ""
Name = "Check1"
headerheaderHeader16frstestharn.frmMain.pgfmain.Page3.grdtestlog.colTestId<FontName = "Tahoma"
Caption = "Test ID"
Name = "Header1"
textboxtextboxText16frstestharn.frmMain.pgfmain.Page3.grdtestlog.colTestIdRFontName = "Tahoma"
BorderStyle = 0
Margin = 0
ReadOnly = .T.
Name = "Text1"

commandbutton
commandbuttoncmdDeleteTestLog!frstestharn.frmMain.pgfmain.Page3�Top = 182
Left = 481
Height = 27
Width = 84
FontName = "Tahoma"
Caption = "\<Delete"
TabIndex = 2
Name = "cmdDeleteTestLog"
EPROCEDURE Click
= ThisFormSet.deletetestlog()

RETURN

ENDPROC
�� ���%`wo�U
��C����B�UTHISFORMSET
DELETETESTLOGClick,��1�B2:)�shapeshapeShape1!frstestharn.frmMain.pgfmain.Page4cTop = 14
Left = 12
Height = 192
Width = 553
BackStyle = 0
SpecialEffect = 0
Name = "Shape1"

commandbutton
commandbutton
cmdviewcovlog!frstestharn.frmMain.pgfmain.Page4�Top = 26
Left = 445
Height = 27
Width = 106
FontName = "Tahoma"
Caption = "\<View Log"
TabIndex = 3
Name = "cmdviewcovlog"
�PROCEDURE Click
IF NOT EMPTY(Thisformset.cCoverLogFile)
	MODIFY FILE (Thisformset.cCoverLogFile)
ELSE
	MODIFY FILE GETFILE("log","","",0,"Coverage Log file")
ENDIF

ENDPROC
'�� ��%����U\%�C���
��!�/������U�,/�C�log����Coverage Log file����UTHISFORMSET
CCOVERLOGFILEClick,��11���A2�)
commandbutton
commandbuttoncmdCovprofiler!frstestharn.frmMain.pgfmain.Page4�Top = 62
Left = 445
Height = 27
Width = 106
FontName = "Tahoma"
Caption = "Coverage \<Profiler"
TabIndex = 4
Name = "cmdCovprofiler"
=PROCEDURE Init
This.Enabled = NOT EMPTY(_COVERAGE)
ENDPROC
PROCEDURE Refresh
This.Enabled = NOT EMPTY(_COVERAGE)
ENDPROC
PROCEDURE Click
IF NOT EMPTY(_COVERAGE)

	IF NOT EMPTY(Thisformset.cCoverLogFile)
		DO (_COVERAGE) WITH (Thisformset.cCoverLogFile)
	ELSE
		DO (_COVERAGE)
	ENDIF

ENDIF

ENDPROC
��� ��A�%�5
�UT���C�B�
��UTHISENABLEDT���C�B�
��UTHISENABLEDQ%�C�B�
��J�%�C���
��5���B�������F�	��B����UTHISFORMSET
CCOVERLOGFILEInit,��RefreshT��Click|��1!2!2�21��AB23Qt�2)�checkboxcheckboxchkcovelogon!frstestharn.frmMain.pgfmain.Page4�Top = 26
Left = 25
Height = 16
Width = 248
FontName = "Tahoma"
AutoSize = .T.
Alignment = 0
BackStyle = 0
Caption = "Turn on coverage \<logging during playback"
Value = .F.
ControlSource = ""
TabIndex = 1
Name = "chkcovelogon"
�PROCEDURE Click
IF This.Value
	Thisformset.cCoverLogFile = GETFILE("log","","",0,"Coverage Log file")
ELSE
	Thisformset.cCoverLogFile = ""
ENDIF
ENDPROC
9��   �%����Ua%�����B�2T���C�log����Coverage Log file����Z�T�������UTHISVALUETHISFORMSET
CCOVERLOGFILEClick,��1!�A1�) checkboxcheckboxchkoverwritecovlog!frstestharn.frmMain.pgfmain.Page4�Top = 50
Left = 25
Height = 16
Width = 179
FontName = "Tahoma"
AutoSize = .T.
Alignment = 0
BackStyle = 0
Caption = "Overwrite the log if \<file exists"
Value = .F.
ControlSource = ""
TabIndex = 2
Name = "chkoverwritecovlog"
labellabelLabel1!frstestharn.frmMain.pgfmain.Page4FontName = "Tahoma"
WordWrap = .T.
BackStyle = 0
Caption = "Note: The coverage log is created when playing back the script. The coverage time also includes the playback overhead."
Height = 36
Left = 25
Top = 158
Width = 528
TabIndex = 5
Name = "Label1"
editboxeditbox	edtStatusfrstestharn.frmMain�FontName = "Tahoma"
Height = 50
Left = 10
ReadOnly = .T.
TabIndex = 2
Top = 279
Width = 582
ControlSource = ""
IntegralHeight = .T.
Name = "edtStatus"
�PROCEDURE ProgrammaticChange
WITH This
	*-- Positions mouse cursor on the last line
	*-- This will keep the user informed of the latest status update
	.SelStart = MAX(1, LEN(.Value))
ENDWITH

RETURN

ENDPROC
PROCEDURE Refresh
LPARAMETERS pl_UpdateIgnore

WITH Thisformset

	IF NOT pl_UpdateIgnore
	
		*-- Refresh the status value
		DO CASE
			CASE .cStatePrev = Cc_StatePlay
				*-- Don't reset the value if the previous state is play
			CASE .cState = Cc_StateRecord
				This.Value = MSG_RECORDING1_LOC + CHR(13)
			CASE .cState = Cc_StateRecordPause
				This.Value = MSG_RECORDING2_LOC + CHR(13)
			CASE .cState = Cc_StatePlay
				This.Value = MSG_PLAYBACK1_LOC + CHR(13)
			OTHERWISE
				This.Value = ""
		ENDCASE
		
		IF .cState = Cc_StateIdle
			This.ForeColor = RGB(0,0,0)
		ELSE
			*-- Set to red to show error
			This.ForeColor = RGB(255,0,0)
		ENDIF

	ENDIF

ENDWITH

RETURN

ENDPROC
"�� 		�!%I�v�U.
�����#�T��C�C�>D����B�UTHISSELSTARTVALUE����
�����{�%��
��w�
H�/�"�������B���������-T����Recording the script...C�
 ����������-T����Paused the recording...C�
 ��������
�5T����Preparing to play the script...C�
 ��2�"�T�������%������R�T���C����^���s�T���C�����^������B�UPL_UPDATEIGNORETHISFORMSET
CSTATEPREVCSTATETHISVALUE	FORECOLORProgrammaticChange,��Refreshu��1�cAB3q���12�1�1Q�A2���ABBB2���)	labellabelLabel1frstestharn.frmMainyFontName = "Tahoma"
Caption = "Status :"
Height = 15
Left = 12
Top = 264
Width = 40
TabIndex = 3
Name = "Label1"
	tbraatestaautils.vcxtoolbartbrTestfrstestharn[Caption = "Test Harness"
Height = 36
Left = 26
Top = 11
Width = 288
Name = "tbrTest"
�PROCEDURE Activate
IF TYPE("_SCREEN.ActiveForm.BaseClass") # "C"
	This.Parent.frmMain.Show()
ENDIF
ENDPROC
PROCEDURE Init
WITH This
	.Parent.oToolbar = This

	*-- Dock at the top
	.Dock(0)
ENDWITH
ENDPROC
��� yy�%� 
�UJ0%�C�_SCREEN.ActiveForm.BaseClassb�C��C���C�������UTHISPARENTFRMMAINSHOW3
�����,�T���������C������UTHISPARENTOTOOLBARDOCKActivate,��Init���11A2��A1e��)y
commandbutton
commandbutton	cmdrecordfrstestharn.tbrTest�Top = 3
Left = 5
Height = 30
Width = 30
Picture = record.bmp
Caption = ""
TabIndex = 1
ToolTipText = "Record the test script"
ZOrderSet = 0
Name = "cmdrecord"
�PROCEDURE Click
Thisformset.Record()

RETURN


ENDPROC
PROCEDURE Refresh
IF ThisformSet.cState = Cc_StateIdle
	This.Enabled = .t.
ELSE
	This.Enabled = .f.
ENDIF
ENDPROC
g�� NN�%��
��U
��C����B�UTHISFORMSETRECORD@%�������#�T���a���9�T���-���UTHISFORMSETCSTATETHISENABLEDClick,��RefreshY��1�B4Q���A13Q�)N
commandbutton
commandbuttoncmdplayfrstestharn.tbrTest�Top = 3
Left = 34
Height = 30
Width = 30
Picture = play.bmp
Caption = ""
TabIndex = 2
ToolTipText = "Play the script"
ZOrderSet = 1
Name = "cmdplay"
�PROCEDURE Click
Thisformset.Play
ENDPROC
PROCEDURE Refresh
IF INLIST(ThisformSet.cState, Cc_StateIdle)
	This.Enabled = .t.
ELSE
	This.Enabled = .f.
ENDIF	
ENDPROC
]�� DDk�%��	��U

����UTHISFORMSETPLAYA%�C�������$�T���a���:�T���-���UTHISFORMSETCSTATETHISENABLEDClick,��RefreshP��1�2a���A1!?�)DcheckboxcheckboxchkPausefrstestharn.tbrTest�Top = 3
Left = 63
Height = 30
Width = 30
Picture = pause.bmp
Alignment = 0
Caption = ""
Value = .F.
ControlSource = ""
Style = 1
TabIndex = 4
ToolTipText = "Pause/Resume Recording/Playback"
ZOrderSet = 2
Name = "chkPause"
%PROCEDURE Click
WITH This

	IF ThisformSet.cState = Cc_StatePlayPause
		.Value = .f.
		ThisFormSet.PlayResume()
	ELSE
		Thisformset.RecordPause(.Value)
	ENDIF

ENDWITH

RETURN

	
ENDPROC
PROCEDURE Refresh
WITH This

	*-- Reset the value because it could have paused and stopped
	IF .Value
		.Value = ThisformSet.cState = Cc_StateRecordPause
	ENDIF

	IF INLIST(ThisformSet.cState, Cc_StateRecord, Cc_StateRecordPause, ;
		Cc_StatePlayPause)
		.Enabled = .t.
	ELSE
		.Enabled = .f.
	ENDIF

ENDWITH

RETURN

ENDPROC
?�� &&�%���Uc
�����X�%�������;�T��-��
��C�����T���C��������B�UTHISTHISFORMSETCSTATEVALUE
PLAYRESUMERECORDPAUSE�
�����w�%����1�T���������%�C�����������_�T��a���s�T��-�����B�UTHISVALUETHISFORMSETCSTATEENABLEDClick,��Refresh���1�R���ABB4��aA����ABB2��)&
commandbutton
commandbuttoncmdstopfrstestharn.tbrTest�Top = 3
Left = 92
Height = 30
Width = 30
Picture = stop.bmp
Caption = ""
TabIndex = 3
ToolTipText = "Stop Recording/Playback"
ZOrderSet = 3
Name = "cmdstop"
`PROCEDURE Click
IF ThisformSet.cState = Cc_StatePlayPause
	ThisFormSet.PlayStop()
ELSE
	Thisformset.RecordStop()
ENDIF

RETURN

	

ENDPROC
PROCEDURE Refresh
IF INLIST(ThisformSet.cState,  Cc_StatePlay, Cc_StateRecord, Cc_StateRecordPause, ;
	Cc_StatePlayPause)

	This.Enabled = .t.
ELSE
	This.Enabled = .f.
ENDIF

RETURN
ENDPROC
�� ���%T6�UB%�������"�
��C�����7�
��C�����B�UTHISFORMSETCSTATEPLAYSTOP
RECORDSTOPQ"%�C�������������0�T���a���F�T���-���B�UTHISFORMSETCSTATETHISENABLEDClick,��Refresh���1Q���AB5"���AB1��U
)�	separator	separator
Separator2frstestharn.tbrTestATop = 3
Left = 129
Height = 0
Width = 0
Name = "Separator2"

commandbutton
commandbutton
cmdOpenLogfrstestharn.tbrTest�Top = 3
Left = 129
Height = 30
Width = 30
Picture = open.bmp
Caption = ""
TabIndex = 0
ToolTipText = "Edit the test script"
ZOrderSet = 5
Name = "cmdOpenLog"
�PROCEDURE Click
Thisformset.ViewEventLog
ENDPROC
PROCEDURE Refresh
IF ThisformSet.cState = Cc_StateIdle
	This.Enabled = .t.
ELSE
	This.Enabled = .f.
ENDIF
ENDPROC
d�� KK6C%��	��U

����UTHISFORMSETVIEWEVENTLOG@%�������#�T���a���9�T���-���UTHISFORMSETCSTATETHISENABLEDClick,��RefreshX��1�2Q���A1)G�)K
commandbutton
commandbuttoncmdinsscriptfrstestharn.tbrTest�Top = 3
Left = 158
Height = 30
Width = 30
Picture = insert.bmp
Caption = ""
TabIndex = 5
ToolTipText = "Insert new recording"
ZOrderSet = 6
Name = "cmdinsscript"
�PROCEDURE Click
Thisformset.RecordInsScript

RETURN
ENDPROC
PROCEDURE Refresh
IF ThisformSet.cState = Cc_StatePlayPause
	This.Enabled = .t.
ELSE
	This.Enabled = .f.
ENDIF

RETURN

ENDPROC
s�� ZZ�y%���U
����B�UTHISFORMSETRECORDINSSCRIPTD%�������#�T���a���9�T���-���B�UTHISFORMSETCSTATETHISENABLEDClick,��Refresh_��1�B2Q���AB26T�)Z	separator	separator
Separator1frstestharn.tbrTestATop = 3
Left = 195
Height = 0
Width = 0
Name = "Separator1"

commandbutton
commandbuttoncmdVFPfrstestharn.tbrTest�Top = 3
Left = 195
Height = 30
Width = 30
Picture = fox.bmp
Caption = ""
TabIndex = 8
ToolTipText = "Launch new VFP application/window"
ZOrderSet = 8
Name = "cmdVFP"
1PROCEDURE Click
Thisformset.LaunchVFP
ENDPROC
�� ���+%Ujd�U

����UTHISFORMSET	LAUNCHVFPClick,��1�1&)�
commandbutton
commandbuttoncmdexitfrstestharn.tbrTest�Top = 3
Left = 224
Height = 30
Width = 30
Picture = close.bmp
Caption = ""
TabIndex = 10
ToolTipText = "Exit"
ZOrderSet = 9
Name = "cmdexit"
-PROCEDURE Click
Thisformset.Abort
ENDPROC
�� ��H�%Qf`�U

����UTHISFORMSETABORTClick,��1�1")�
commandbutton
commandbuttoncmdhelpfrstestharn.tbrTest�Top = 3
Left = 253
Height = 30
Width = 30
Picture = help.bmp
Caption = ""
TabIndex = 8
ToolTipText = "Help/Readme"
ZOrderSet = 10
Name = "cmdhelp"
2PROCEDURE Click
Thisformset.LaunchHelp
ENDPROC
�� ��Q%Vke�U

����UTHISFORMSET
LAUNCHHELPClick,��1�1')�CArial, 0, 9, 5, 15, 12, 32, 3, 0
Tahoma, 0, 9, 5, 14, 12, 23, 2, 0
aatest.h�RPlK-