Wiki Home

VFP Test Harness


Namespace: WIN_COM_API
VFP 7 has a new test harness “aatest”. this is supposed to use the MS active accessibility to test applications. I have tried to apply this in 2 different applications with differing success. Our main APP is a codebook application with many classlibs for bizness classes and for classes some 250 forms all together. The test harness would fail with this application very consistently with the form.object not having focus error. We also have a utility application base strictly of base forms. Using the same recording techniques, I was able to get the scripts to work fairly well and call up several forms, edit data choice menus to do forms, and interact with buttons, comboboxes, and a treeview. I have to conclude from this that the libs based forms do not report the hWin handles correctly to WIN OS. Any one know if this is accurate or have any other experience to share on test HarNess?
AllanLindgren

There were several bugs in VFP 7's implementation of MSAA that were corrected in SP 1. While I have not done any work with the test harness, I can verify that some of the bugs involved incorrect reporting of control information through MSAA, and several others caused C5 crash errors. If you haven't installed SP 1, do so and try it again.
Ken Dibble

I have SP1 and tried this. I couldn't put together a very complete test (it's a bit of a pain to revert data right now, since we have several developers using it) but it seemed to work fine with the VCX-based form. However, the playback is somewhat slow (on both VCX- and SCX-based forms, I think). Has anyone else experienced this? It's not consistently slow, like a throttle issue. -- Zahid Ali

I have SP1. I can't get the test harness to function correctly with pageframes or popup menus. Playback is at one speed regardless of settings. To avoid the constant 'Lost Focus' error it's best to set 'On Script Failure' to 'Continue Playback' - but then when it does fail you can't escape!
-- Rhodri C Evans

I've been hacking around with the script file since I can't find any documentation anywhere.

Key Presses
Action      ????????   # Times Repeat  ??  Key Value   Shift/Ctrl/Alt  Pause
KeyPress    00000100   1               10  65          0               0.00001F
KeyPress    00000100   3               10  66          4096            0.00001F

this would issue: aBBB

List of the key values for common keystrokes. Some do not match the VFP Key Values.
Key   Value Mod      Key   Value Mod      Key   Value Mod
a     65 0           0     96 0           "     222 4096
b     66 0           1     97 0           <     188 4096
c     67 0           2     98 0           >     190 4096
d     68 0           3     99 0           ?     191 4096
e     69 0           4     100 0          ,     188 0
f     70 0           5     101 0          .     190 0
g     71 0           6     102 0          /     191 0
h     72 0           7     103 0          ;     186 0
i     73 0           8     104 0          '     222 0
j     74 0           9     105 0          [     219 0
k     75 0           !     49 4096        ]     221 0
l     76 0           @     50 4096        \     220 0
m     77 0           #     51 4096        -     189 0
n     78 0           $     52 4096        =     187 0
o     79 0           %     53 4096
p     80 0           ^     54 4096
q     81 0           &     55 4096
r     82 0           *     56 4096
s     83 0           (     57 4096
t     84 0           )     48 4096
u     85 0           _     189 4096
v     86 0           +     187 4096
w     87 0           {     219 4096
x     88 0           }     221 4096
y     89 0           |     220 4096
z     90 0           :     186 4096

SHIFT: 4096
CTRL:  8192
ALT:   16384


Mouse Clicks
Action     ????????     X     Y  ????????  Target                     Pause
MouseDown  00000201     5     2  00000001  Microsoft Visual FoxPro    0.00000F
MouseUp    00000202     5     2  00000000  Microsoft Visual FoxPro    0.36100F

MouseDown   00000201    71    19 00000001  Command                    1.51100F
MouseUp     00000202    71    19 00000000  Command                    0.07300F


On the options tab there is a "Delay between events" setting for script playback. I found that no matter what this was set to, playback still happened at the same pace. I edit the pause value to "0.00001F" in the script file for actions that do not need a system response, such as typing in a command window. This speeds up the script significantly.

I've also found the mouse to be inaccurate at times so I try and stick to keyboard navigation as much as possible.
-- BarryDempsey

( Topic last updated: 2008.11.13 12:19:41 PM )