Open Test Architecture API

The Focal Point of all customizations are the OTA Api (Application Programming Interface). They are a group of interfaces that help user to manage all QC objects.

 

The first thing to do to access to the Model Object is to instance the TDConnection Object. The QC object hierarchy starts from it.

 

Here an image of the Object Model (it is from QC version 9 but it is usefull to understand how it is organize):

 

 

 

 

Now let's to understand the hierarchy and how to instance a single object.

 

Usually an object like requirements, test, testset, bug, etc could be created directly through this type of instruction (vbscript or script editor - suppose tdc is the TDConnection object):

 

set myObject = tdc.ObjFactory.Item(ID)

 

where Objis one the type of object to instance and ID  is and integer, unique identifier of the object. Note that to reference a particular object you have to use the Item property. 

 

Often you need to work on several (or all) objects of a particular type. To do this is necessary:

  • Access to the Factory that manage that kind of objects
  • Create the List of Objects
  • Do a Cycle to work on each object

 

for example:

set myObjList = tdc.ObjFactory.NewList("")

 

NewList downloads the object list filtered by the argument. ("") is the list of all object without filter.

 

 

Suppose we want to know in which status the bug number 5 is. I will do like this:

 

set myBug = tdc.BugFactory.Item(5)

msgbox myBug.Status

set myBug = nothing

 

Note: TDConnection is already instance and present if you are working directly on the script editor. From and external .vbs file you need to use this instruction:

set tdc = CreateObject("tdapiole80.tdconnection.1")

 

From the .chm files that you can download from the documental part of the projects you can know which are all the Properties and Methods of all the objects of the pic above.

 

For more details you can see the example under the How To - Tips&Tricks section.