QTP动态加载对象库

Public Function AddObjectRepository(path)
    On Error Resume Next
    Dim pos, repath
    If instr(path,".tsr") Then
        repath = path
    else
        repath = path & ".tsr"
    End If
    RepositoriesCollection.RemoveAll()
    print repath
    RepositoriesCollection.Add (repath)
    
    pos = RepositoriesCollection.Find(repath)
    If pos<>1 Then
        print "cannot find repository"
    End If
    
End Function

Call AddObjectRepository("D:\hell")

 

posted @ 2014-11-07 14:43  平静缓和用胸音说爱  阅读(491)  评论(0编辑  收藏  举报