Some lines in the code are skipped while exceuting test in UFT through ALM. My code is below to read number of lines from the text file:
Function GetTextFileLineCount(Filepath)
Const ForReading = 1
Set fso = CreateObject("Scripting.FileSystemObject")
Set tso = fso.OpenTextFile(Filepath,ForReading)
tso.ReadAll
GetTextFileLineCount = tso.Line
tso.Close
Set tso = Nothing
Set fso = Nothing
End Function
When I run it locally, ir runs through all the lines and exceutes succesfully. When I ru this test from ALM lines from set tso to tso.close are skipped for exceuting. Could you please suggest the solution for the same.