|
RegisterUserFunc "WebEdit","Set","WriteLog_WebEdit_Set"
Browser("佳信捷综合视频管理平台").Page("佳信捷综合视频管理平台").WebEdit("username").Set "123456"
Function Write_WebEdit_Set(Object,SetValue)
Object.Set SetValue
Const ForAppending = 8
Const ForReading = 1
Const ForWriting = 2
Set fso = CreateObject("scripting.filesystemobject")
LogFileName = cstr(Year(Now)&Month(Now)&Day(Now))+".txt"
oParentFolder = Environment.Value("ResultDir")
LogFilePath = oParentFolder+"\"+LogFileName
If not fso.FileExists(LogFilePath) Then
Set txtFile =fso.CreateTextFile(LogFilePath,false)
Else
Set txtFile = fso.OpenTextFile(LogFilePath,ForAppending,True)
End If
WriteConent = cstr(Time)+"Object:["+_
Object.GetTOProperty("micClass")+"-"+_
Object.GetTOProperty("TestObjName")+_
"] - Description:"+" “Set Value is <" + SetValue + ">" + "“"
txtFile.WriteLine WriteConent
Set txtFile = Nothing
Set fso = Nothing
End Function
报错哦 对象不支持此属性或方法: 'Browser(...).Page(...).WebEdit(...).Set'
但是把那句话放到注册函数前 这个函数就没用了 |
|