通过 ALM 在 UFT 中执行测试时会跳过代码中的某些行。我的代码如下从文本文件中读取行数:
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
当我在本地运行它时, ir 会遍历所有行并成功执行。当我从设置 tso 到 tso.close 的 ALM 行中运行此测试时,将跳过执行。您能否提出相同的解决方案。