Forum Discussion
hlalumiere
11 years agoRegular Contributor
The only practical way to do this is by reading the XML files themselves (.MDS, .PJS, etc..). The TestComplete COM interfaces are utterly incompetent in this regard, they are clearly just an automation layer on the UI, not a proper API. Even the XML files are pretty ugly, but you can manage them through the XDocument class and Linq.
Here is a very simple example on how to read the weird XML in TC project and project suite files:
Here is a very simple example on how to read the weird XML in TC project and project suite files:
Public Function GetPJSProjects(ByVal pathProjectSuite As String) As List(Of String)
Dim xDoc = XDocument.Load(pathProjectSuite)
Return (From n In xDoc...<Node> Where n.@name = "files" Select n.<Node>.@name).ToList
End Function[/xcode]
This would return any "name" property off "Node" nodes that are descendants of the "files" node. Obviously you will have to locate the information you need within the XML tree and construct your Linq code accordingly, but this should get you started.