Forum Discussion

sanket2799's avatar
sanket2799
Occasional Contributor
12 months ago

Text file reading

What is the value of AFileName in this code snippet I copied from test complete documentation. I tried putting  the path of the file but it is giving error.  "D:\Grid.txt"

 

 

 

function ReadWholeFile(AFileName)
{
var s = aqFile.ReadWholeTextFile(AFileName, aqFile.ctANSI);
Log.Message("File entire contents:");
Log.Message(s);
}

function ReadFileLines(AFileName)
{
var F, s;

F = aqFile.OpenTextFile(AFileName, aqFile.faRead, aqFile.ctANSI);
F.Cursor = 0;
Log.Message("File by lines:");
while(! F.IsEndOfFile()){
s = F.ReadLine();
Log.Message(s);
}
F.Close();
}