|
我这边有个方法,有点笨,发你看看是否需要采用: Dim fso, logFile
Set fso = CreateObject("Scripting.FileSystemObject")
Set logFile = fso.OpenTextFile("D:\陈元元\QTP脚本\Demo\log\runtime.txt", 8, True)'自行修改你自己本地的日志路劲,在路劲里面新建一个txt文本即可
logFile.WriteLine("+++++++++++++++++++++++++++++++++++++++++++++++++++
logFile.WriteLine("+++++++++++++++++++++++++++++++++++++++++++++++++++")
logFile.WriteLine("+++++++++++++++++++++++++++++++++++++++++++++++++++")
logFile.Close
'Public Function ErrorHandle()
If Err.Number <> 0 Then
logFile.WriteLine( "Error Num: " & Err.Number & "; Error Src: " & Err.Source & "; Error Desc: " & Err.Description) '报错处理
Err.Clear
End If |
|