Forum Discussion
3 Replies
Hi,
Set the cursor position to the beginning of the needed line and use the aqTextFile.ReadLine or VBScript native ReadLine method:
LineNumber = 7
Set myFile = aqFile.OpenTextFile("C:\1.txt", aqFile.faRead, aqFile.ctANSI)
myFile.SkipLine(LineNumber - 1)
Log.Message(myFile.ReadLine)- cklein_1Occasional ContributorThanks!
Can I do a Check Point on that? If the text didnt match a certain string then fail the test? I'm working in jscript.
Thanks again,
Chris
Hi,
You can post an error in this case - this will stop your test (note that the "Stop on error" option of your project properties must be enabled):
LineNumber = 7;
myFile = aqFile.OpenTextFile("C:\\1.txt", aqFile.faRead, aqFile.ctANSI);
myFile.SkipLine(LineNumber - 1);
if (myFile.ReadLine() != "stringToCompare")
Log.Error("The strings are not equal");