QTP的tsr对象库文件转换成XML

Function exportTsrToXml(tsrFilePath,xmlFilePath)
    Dim autoRepository
    
    Set autoRepository = CreateObject("Mercury.ObjectRepositoryUtil") '创建ORAOM对象
    
    If Not fso.FileExists(tsrFilePath) Then '如果tsr文件不存在
        MsgBox "Error:Missed the ObjectRepository file !",48,"Export tsr to xls"
        WScript.Quit
    Else'否则导出为xml文件
        autoRepository.ExportToXML "H:\Repository\2Obj_2d.tsr",xmlFilePath
        Set autoRepository = Nothing    
    End If
End Function

posted on 2012-08-01 12:46  张飞_  阅读(1072)  评论(1编辑  收藏  举报

导航