Code to export QTP OR into txt format
Set Repo= CreateObject("Mercury.ObjectRepositoryUtil")
Repo.Load "C:\Users\ajindal\Desktop\POC\Kmantra.tsr"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("C:\Users\ajindal\Desktop\POC\KMantraOR.txt", 8, True)
Set TOCollection = Repo.GetAllObjects
For i = 0 To TOCollection.Count - 1
Set TestObject = TOCollection.Item(i)
Msg = Repo.GetLogicalName(TestObject) & vbNewLine
Set PropertiesCollection = TestObject.GetTOProperties()
For n = 0 To PropertiesCollection.Count - 1
Set Property = PropertiesCollection.Item(n)
Msg = Msg & Property.Name & "-" & Property.Value & vbNewLine
Next
f.Writeline Msg
Next
f.Close
Set fso=Nothing
Set Repo=Nothing
Repo.Load "C:\Users\ajindal\Desktop\POC\Kmantra.tsr"
Set fso = CreateObject("Scripting.FileSystemObject")
Set f = fso.OpenTextFile("C:\Users\ajindal\Desktop\POC\KMantraOR.txt", 8, True)
Set TOCollection = Repo.GetAllObjects
For i = 0 To TOCollection.Count - 1
Set TestObject = TOCollection.Item(i)
Msg = Repo.GetLogicalName(TestObject) & vbNewLine
Set PropertiesCollection = TestObject.GetTOProperties()
For n = 0 To PropertiesCollection.Count - 1
Set Property = PropertiesCollection.Item(n)
Msg = Msg & Property.Name & "-" & Property.Value & vbNewLine
Next
f.Writeline Msg
Next
f.Close
Set fso=Nothing
Set Repo=Nothing
Comments
Post a Comment