Re: Problem with running tests using call_close and eval in array
CORRECTION: Actually, I didn't use X in array. I used a for loop with getArraySize, so that the tests ran in order. Sorry about the confusion.
Problem with running tests using call_close and eval in array
I ran into a particular nasty problem in WR 7.0 & 7.5 that has just taken me a week to fix. I was running a batch file of a series of stand alone tests, stored in an array, and executed using 'call_close' in an eval statement. The tests had all been designed and tested separately and then amalgamated in this batch file which looked something like this:
</font><blockquote><font size="1" face="Verdana, Arial, Helvetica">code:</font><hr /><pre style="font-size:x-small; font-family: monospace;">
static testNameArray  =
for(i in testNameArray)
eval("call_close\"" & testNameArray[i] & "\"();"
}</pre><hr /></blockquote><font size="2" face="Verdana, Arial, Helvetica">(This is an extreme simplification of my batch program, which calls over a hundred different scripts created by three different people and stored in over 50 different subdirectories. All of the directory and file names are parameterized in variables to make name changes easy to affect.)
Test results show:
call test test3
call test test4
c:\tests\test4: Error: Test not found in the search path.
At which point execution halted, of course. I checked test 4, but the path and file name matched the array. I hashed it out and tried again, and this time I got the error:
c:\tests\test3: Error: Test not found in the search path.
Finally, after I ran all tests separately I discovered that test5 had been updated and renamed to test5a and not updated in the batch (a coworker's mistake). This should have been an easy mistake to catch. The problem is in the way WinRunner reported it. WinRunner reported that the previous test, test4, was the one that couldn't be found, when in fact, test5 was the missing test.
I'm really just posting this as an FYI, but has anyone else ran into this problem?