Forum Discussion

TinaA's avatar
TinaA
New Contributor
15 years ago

OpenTextFile too slow or hangs


Hi,



I am evaluating TestComplete 7.51.

I am using the proc below to access the Logfile of the application that I am testing. The logfile can be tens of lines long.

I find that if it is more than a few lines long, TestComplete hangs. I cannot even stop the test and I need to kill the process.

I am attaching a simle text file that fails to read. If I only use lines up to "t" then it works fine.

Being able to analyse the text in the LogFile is very important for our QA.



Kind regards



Tina



function readTotalTime()

{


readTotalTime(){

var logfile;


var nolines, s, l;


 


logfile = aqFile.OpenTextFile("C:\\test2",aqFile.faRead, aqFile.ctANSI);


logfile.Cursor = 0;


Log.Message("Opened file");


nolines = logfile.LinesCount;


Log.Message("There are " + nolines + " lines in LOGFILE");


 


l = nolines - 2;


logfile.SetPosition(l, 0);


s = logfile.ReadLine();


Log.Message("Read from line " + l);


Log.Message(s);


logfile.Close();


}