QTK.Comos
The assembly QTK.Comos.dll contains COMOS specific functions and tests. Most of these functions only can be executed within COMOS, therefore the host
attribute should be set to remote
.
ButtonClickExecutor
Stupka.QTK.Comos.ButtonClickExecutor (QTK.Comos.dll)
Executes a click on a specification of type button by calling the OnClick
event.
Properties
Name | Type | Required | Description |
---|---|---|---|
comosobject | xsd:IDREF | Yes | Reference to a selector holding a COMOS object which holds the specification. |
nestedname | xsd:string | Yes | NestedName of the specification. |
CaptureMessageBoxExecutor
Stupka.QTK.Comos.CaptureMessageBoxExecutor (QTK.Comos.dll)
Enables or disables capturing of COMOS message boxes. If enabled, the message boxes are not shown to the user.
To test for specific message boxes, use the MessageBoxTest
.
Info
You can only capture message boxes which are created via Project.Workset.Lib.ComosMsgBox
. Regular VB message boxes are not captured.
Properties
Name | Type | Required | Description |
---|---|---|---|
depth | xsd:integer | Yes | Maximum count of message boxes to store for later tests. |
CDeviceByNameSelector
Stupka.QTK.Comos.CDeviceByNameSelector (QTK.Comos.dll)
Selects a COMOS CDevice by its fullname. Internally, the CDevice is loaded by Project.GetCDeviceBySystemFullname(SystemFullName, 1)
.
Properties
Name | Type | Required | Description |
---|---|---|---|
systemfullname | xsd:string | Yes | Systemfullname of the CDevice. |
Usage
<?xml version="1.0" encoding="utf-8" ?>
<Script identifier="..." comment="..." xmlns="http://www.stupka.at/qtk">
<Positions>
<Group comment="Init">
<Comos.CDeviceByNameSelector identifier="cdevice" systemfullname="@30|M00|A30|A20|A10|A20|A10" comment="Select CDevice @30|M00|A30|A20|A10|A20|A10"/>
</Group>
</Positions>
</Script>
DeviceByClassificationSelector
Stupka.QTK.Comos.DeviceByClassificationSelector (QTK.Comos.dll)
Selects a COMOS device by its classification.
Info
The devices is search below the 'ComosObject', the test itself is performed using Device.ClassificationExists(...)
.
If more than one classification is specified, all classifications have to match.
For a recursive search a new selector will be available in one of the next versions of Quality Toolkit.
Properties
Name | Type | Required | Description |
---|---|---|---|
classification1 | xsd:string | If specified, the selected device has to match this classification. | |
classification2 | xsd:string | If specified, the selected device has to match this classification. | |
classification3 | xsd:string | If specified, the selected device has to match this classification. | |
classification4 | xsd:string | If specified, the selected device has to match this classification. | |
comosobject | xsd:IDREF | Yes | Reference to a selector holding a COMOS device which is used as owner for the search. |
index | xsd:integer | Use this parameter to specify which matching device should be returned (starting with 1). If not specified, the first matching device is selected. |
DeviceByNameSelector
Stupka.QTK.Comos.DeviceByNameSelector (QTK.Comos.dll)
Selects a COMOS device by its absolute or relative name.
Info
The device is loaded without processing the class information. As the name of a COMOS device has to be unique per hierarchy level and class, the function might not work as expected.
If the class information is required to select the correct object, use the ObjectByPathSelector
instead.
Properties
Name | Type | Required | Description |
---|---|---|---|
comosobject | xsd:IDREF | Reference to a selector holding a COMOS device. If set, the RelativeName has to be specified relative to this object. |
|
relativename | xsd:string | Yes | SystemFullName of the COMOS device. If the parameter ComosObject holds a valid reference to a COMOS object, the device is selected relative to this object. Otherwise the device is selected by its absolute SystemFullname relative to the project. |
DeviceCreateSelector
Stupka.QTK.Comos.DeviceCreateSelector (QTK.Comos.dll)
Creates and selects a new COMOS device.
Properties
Name | Type | Required | Description |
---|---|---|---|
cdevice | xsd:IDREF | Yes | Reference to a selector holding a COMOS CDevice. |
description | xsd:string | Description of the new device. | |
label | xsd:string | Label of the new device. If no value is specified, the label is created by using the mask. | |
name | xsd:string | Name of the new device. If no value is specified, the name is created by using the mask. | |
owner | xsd:IDREF | Yes | Reference to a selector holding a COMOS Device which is the owner of the new device. |
DocumentByNameSelector
Stupka.QTK.Comos.DocumentByNameSelector (QTK.Comos.dll)
Selects a COMOS document below a specified COMOS device.
Properties
Name | Type | Required | Description |
---|---|---|---|
comosobject | xsd:IDREF | Yes | Reference to a selector holding a COMOS device which is the owner of the document. |
name | xsd:string | Yes | Name of the document. |
GlobalsExecutor
Stupka.QTK.Comos.GlobalsExecutor (QTK.Comos.dll)
Properties
Name | Type | Required | Description |
---|---|---|---|
name | xsd:string | Yes | |
value | xsd:string | Yes |
MessageBoxTest
Stupka.QTK.Comos.MessageBoxTest (QTK.Comos.dll)
Checks if a COMOS message box has been fired with the specified content. Capturing of message boxes has to be enabled using the function CaptureMessageBoxExecutor
.
Info
Note that pure VB messageboxes cannot be captured by the COMOS Agent. To capture a message box, the COMOS function Project.Workset.Lib.ComosMsgBox
has to be used within your customizing.
Properties
Name | Type | Required | Description |
---|---|---|---|
caption | xsd:string | Text to be contained within the message box caption. | |
depth | xsd:integer | Maximum search depth within the captured message boxes. If not specified, only the last captured message box is checked. | |
text | xsd:string | Text to be contained within the message box message. |
ObjectByLinkSelector
Stupka.QTK.Comos.ObjectByLinkSelector (QTK.Comos.dll)
Selects a COMOS object by a link specification. The function can select different types of COMOS objects (like Device, CDevice, Queries or Documents).
Properties
Name | Type | Required | Description |
---|---|---|---|
nestedname | xsd:string | Yes | NestedName of the link specification. |
specowner | xsd:IDREF | Yes | Reference to a selector holding a COMOS, which owns the link specification. |
ObjectByOwnerSelector
Stupka.QTK.Comos.ObjectByOwnerSelector (QTK.Comos.dll)
Selects the owner of a COMOS object.
Properties
Name | Type | Required | Description |
---|---|---|---|
comosobject | xsd:IDREF | Yes | Reference to a selector holding a COMOS object. |
ObjectByPathSelector
Stupka.QTK.Comos.ObjectByPathSelector (QTK.Comos.dll)
Selects a COMOS object by its path full name.
Properties
Name | Type | Required | Description |
---|---|---|---|
comosobject | xsd:IDREF | Reference to a selector holding a COMOS device. If not set, the current project is used as starting point. | |
relativepath | xsd:string | Yes | Pathfullname of the object, relative to comosobject . To allow easier configuration within xml, you may use the pipe character instead of pointed brackets. |
ObjectByScriptletSelector
Stupka.QTK.Comos.ObjectByScriptletSelector (QTK.Comos.dll)
Selected a COMOS object, using the logic provided by a scriptlet in rtf format.
Warning
This function is in early Beta state and might not work as expected.
This function calls a visual basic scriptlet which has been created (and saved) by the COMOS object debugger in rtf format.
You can use the Output(...)
command to create feedback as within COMOS.
You can specify the selector target by setting A.Workset.Globals.QTK_ScriptletSelection
to the COMOS object.
You can specify the result by setting A.Workset.Globals.QTK_ScriptletResult
to OK
or FAILED
.
See the the documentation of ObjectScriptletExecutor for a detailed usage example.
Properties
Name | Type | Required | Description |
---|---|---|---|
a | xsd:IDREF | Reference to a selector holding a COMOS object, which can be accessed from the scriptlet by A as within the COMOS object debugger. If not specified, the current COMOS project is used as default. |
|
b | xsd:IDREF | Reference to a selector holding a COMOS object, which can be accessed from the scriptlet by B as within the COMOS object debugger. |
|
c | xsd:IDREF | Reference to a selector holding a COMOS object, which can be accessed from the scriptlet by C as within the COMOS object debugger. |
|
param1 | xsd:string | Generic string parameter, which can be accessed from the scriptlet by A.Workset.Globals.QTK_ScriptletParam1 . |
|
param2 | xsd:string | Generic string parameter, which can be accessed from the scriptlet by A.Workset.Globals.QTK_ScriptletParam2 . |
|
param3 | xsd:string | Generic string parameter, which can be accessed from the scriptlet by A.Workset.Globals.QTK_ScriptletParam3 . |
|
scriptlet | xsd:IDREF | Yes | Reference to a pre-loaded scriptlet in rtf format, see example for usage details. |
ObjectByScriptSelector
Stupka.QTK.Comos.ObjectByScriptSelector (QTK.Comos.dll)
Selects a COMOS object by calling a script function defined at a COMOS CDevice. Currently, no parameters can be forwarded to the function.
Info
This function can be used to select an existing object, but can also be used to create new objects during runtime.
Properties
Name | Type | Required | Description |
---|---|---|---|
scriptname | xsd:string | Yes | Name of the script function. |
systemfullname | xsd:string | Yes | SystemFullName of a CDevice which holds the script function. |
ObjectByUIDSelector
Stupka.QTK.Comos.ObjectByUIDSelector (QTK.Comos.dll)
Selects a COMOS object by calling the COMOS function Workset.LoadObjectByType(SystemType, SystemUID)
Properties
Name | Type | Required | Description |
---|---|---|---|
systemtype | xsd:integer | SystemType of the COMOS object. if not specified, the value 8 (=Device) is used. |
|
systemuid | xsd:string | Yes | SystemUID of the COMOS object. |
ObjectScriptletExecutor
Stupka.QTK.Comos.ObjectScriptletExecutor (QTK.Comos.dll)
Executes a scriptlet in rtf format.
Warning
This function is in early Beta state and might not work as expected.
This function calls a visual basic scriptlet which has been created (and saved) by the COMOS object debugger in rtf format.
You can use the Output(...)
command to create feedback as within COMOS.
You can specify the result by setting A.Workset.Globals.QTK_ScriptletResult
to OK
or FAILED
.
Properties
Name | Type | Required | Description |
---|---|---|---|
a | xsd:IDREF | Reference to a selector holding a COMOS object, which can be accessed from the scriptlet by A as within the COMOS object debugger. If not specified, the current COMOS project is used as default. |
|
b | xsd:IDREF | Reference to a selector holding a COMOS object, which can be accessed from the scriptlet by B as within the COMOS object debugger. |
|
c | xsd:IDREF | Reference to a selector holding a COMOS object, which can be accessed from the scriptlet by C as within the COMOS object debugger. |
|
param1 | xsd:string | Generic string parameter, which can be accessed from the scriptlet by A.Workset.Globals.QTK_ScriptletParam1 . |
|
param2 | xsd:string | Generic string parameter, which can be accessed from the scriptlet by A.Workset.Globals.QTK_ScriptletParam2 . |
|
param3 | xsd:string | Generic string parameter, which can be accessed from the scriptlet by A.Workset.Globals.QTK_ScriptletParam3 . |
|
scriptlet | xsd:IDREF | Yes | Reference to a pre-loaded scriptlet in rtf format, see example for usage details. |
Usage
The example below shows a simple scenario which copies the label to the description of a COMOS object, creates some feedback and provides a result.
script.rtf
'Create feedback by the Output command.
'If the text is prefixed with FAILURE, DEBUG or INFO the feedback is classified as specified.
Output "INFO: Copy label to description."
If Not (A Is Nothing) Then
Output "DEBUG: Label = " & A.Label
A.Description = A.Label
A.Workset.Globals.QTK_ScriptletResult = "OK"
Else
Output "FAILURE: No object provided."
A.Workset.Globals.QTK_ScriptletResult = "FAILED"
End If
script.xml
<Script xmlns="http://www.stupka.at/qtk" identifier="..." comment="...">
<Resources>
<Resource identifier="res" location="path\to\script" name="script.rtf"/>
</Resources>
<Positions>
<Group comment="Test">
<Content.DocumentFromResourceSelector host="local" id="scriptlet" resource="res" comment="Load scriptlet from resource" />
<Comos.DeviceByNameSelector host="remote" id="comosobj" relativename="..." comment="Select object by relative name" />
<Comos.ObjectByScriptletExecutor host="remote" a="comosobj" comment="Execute scriptlet" />
</Group>
</Positions>
</Script>
ObjectScriptletTest
Stupka.QTK.Comos.ObjectScriptletTest (QTK.Comos.dll)
Executes a test provided by a scriptlet in rtf format.
Warning
This function is in early Beta state and might not work as expected.
This function calls a visual basic scriptlet which has been created (and saved) by the COMOS object debugger in rtf format.
You can use the Output(...)
command to create feedback as within COMOS.
You can specify the result by setting A.Workset.Globals.QTK_ScriptletResult
to OK
or FAILED
.
See the documentation of ObjectScriptletExecutor for a detailed usage example.
Properties
Name | Type | Required | Description |
---|---|---|---|
a | xsd:IDREF | Reference to a selector holding a COMOS object, which can be accessed from the scriptlet by A as within the COMOS object debugger. If not specified, the current COMOS project is used as default. |
|
b | xsd:IDREF | Reference to a selector holding a COMOS object, which can be accessed from the scriptlet by B as within the COMOS object debugger. |
|
c | xsd:IDREF | Reference to a selector holding a COMOS object, which can be accessed from the scriptlet by C as within the COMOS object debugger. |
|
param1 | xsd:string | Generic string parameter, which can be accessed from the scriptlet by A.Workset.Globals.QTK_ScriptletParam1 . |
|
param2 | xsd:string | Generic string parameter, which can be accessed from the scriptlet by A.Workset.Globals.QTK_ScriptletParam2 . |
|
param3 | xsd:string | Generic string parameter, which can be accessed from the scriptlet by A.Workset.Globals.QTK_ScriptletParam3 . |
|
scriptlet | xsd:IDREF | Yes | Reference to a pre-loaded scriptlet in rtf format, see example for usage details. |
ObjectTest
Stupka.QTK.Comos.ObjectTest (QTK.Comos.dll)
Tests if a COMOS object exists, and matches various properties. If no property is specified, only the existence is checked.
Info
Currently the values have to match exactly, no wildcards are supported.
Properties
Name | Type | Required | Description |
---|---|---|---|
comosobject | xsd:IDREF | Yes | Reference to a selector holding a COMOS object. |
description | xsd:string | Text to be tested against the Description of the COMOS object. |
|
label | xsd:string | Text to be tested against the Label of the COMOS object. |
|
name | xsd:string | Text to be tested against the Name of the COMOS object. |
|
rights | xsd:integer | Numerical value to be tested against the ObjectRights of the object. |
|
systemfullname | xsd:string | Text to be tested against the SystemFullName of the COMOS object. |
PersonSelector
Stupka.QTK.Comos.PersonSelector (QTK.Comos.dll)
Selects a person object from the USERS project.
Info
Internally, first the system user is selected, afterwards the person object is loaded via the SystemUID
as returned by user.GetRemark(5)
.
Properties
Name | Type | Required | Description |
---|---|---|---|
username | xsd:string | Name of the user. If not specified, the person object belonging to the current user is selected. |
ProjectByNameSelector
Stupka.QTK.Comos.ProjectByNameSelector (QTK.Comos.dll)
Selects a COMOS project by its name.
Properties
Name | Type | Required | Description |
---|---|---|---|
name | xsd:string | Yes | Name of the project. |
QueryRecordsetSelector
Stupka.QTK.Comos.QueryRecordsetSelector (QTK.Comos.dll)
Selects a recordset by a COMOS query.
Info
The recordset selected by this function can be forwarded to the RecordsetContentTest
to perform content-sensitive checks on the result of the COMOS query.
Properties
Name | Type | Required | Description |
---|---|---|---|
filter | xsd:IDREF | Reference to a recorset which is used to pre-filter the data. The filter recordset has to provide two columns column and text , the specified text is expected exactly in the corresponding column. |
|
query | xsd:IDREF | Yes | Reference to a selector holding a COMOS query. |
root | xsd:IDREF | Reference to a selector holding a COMOS device to be used as root object for the query. |
RecordsetContentTest
Stupka.QTK.Comos.RecordsetContentTest (QTK.Comos.dll)
Checks if a recordset contains a specific record, identified by a row key. Additionally, the value of a specified column can be checked.
Info
The recordset can be loaded from the file system (xml oder csv), or can be created by other selectors which result in a recordset.
Properties
Name | Type | Required | Description |
---|---|---|---|
columnname | xsd:string | Name of the column which holds the data. | |
columnobject | xsd:IDREF | Reference to a selector, which holds the COMOS object that is expected as column object at the specified position. | |
columntext | xsd:string | Value which is expected at the specified position. | |
keycolumnname | xsd:string | Name of the column which holds the row key. | |
recordset | xsd:IDREF | Yes | Reference to a selector, which provides a recordset. |
rowobject | xsd:IDREF | Yes | Reference to a selector, which holds the COMOS object that is expected as row object. |
Errorcodes
Value | Errorcode | Description |
---|---|---|
1 | RecordExistsButDataDoesNotMatch | The record has been found, but the text does not match. |
2 | RecordDoesNotExist | The record does not exist at all. |
Usage
<Recordsets>
<Recordset id="identifer">
<Rows>
<Row Col1="value1.1" Col2="value1.2" Col3="value1.3"/>
<Row Col1="value2.1" Col2="value2.2" Col3="value2.3"/>
<Row Col1="value3.1" Col2="value3.2" Col3="value3.3"/>
</Rows>
</Recordset>
</Recordsets>
script.xml
<Script xmlns="http://www.stupka.at/qtk" identifier="..." comment="...">
<Resources>
<Resource identifier="data" location="path\to\file" name="file.xml"/>
</Resources>
<Positions>
<Group comment="Init">
<Common.XmlRecordsetSelector host="local" identifier="candidate" xpath="//Recordset[@id='identifer']/Rows/Row" resource="data"/>
<Common.RecordsetContentTest records="candidate" keycolumnname="col1" rowkey="value2.1" columname="col2" columntext="value2.2"/>
</Group>
</Positions>
</Script>
ReleaseAllObjectsExecutor
Stupka.QTK.Comos.ReleaseAllObjectsExecutor (QTK.Comos.dll)
Releases all objects by calling Workset.ReleaseAllObjects
three times.
RenderDocumentSelector
Stupka.QTK.Comos.RenderDocumentSelector (QTK.Comos.dll)
Renders a COMOS to document to a PDF document. The document can be used for content-specific tests provided by QTK.Content.dll.
Info
Internally, the PDF document is created using the PDFExport
class.
Properties
Name | Type | Required | Description |
---|---|---|---|
document | xsd:IDREF | Yes | Reference to a COMOS document. |
Usage
For pixel-based tests it is recommended to create the reference document by COMOS object debugger using the same technology.
'Drag COMOS document to A
Set oDocument = A
Set pdfExport = CreateObject("Comos.PDFExport.PdfExport")
pdfExport.SilentMode = True
pdfExport.DoIntelligentExport = False
pdfExport.DoIntelligentExportDocuments = False
pdfExport.DoIntelligentExportLocation = False
pdfExport.DoIntelligentExportUnit = False
pdfExport.DoCreateBookmarks = False
Call pdfExport.Export("c:\temp\export.pdf", oDocument, oDocument.Workset)
SaveAllObjectsExecutor
Stupka.QTK.Comos.SaveAllObjectsExecutor (QTK.Comos.dll)
Saves all objects by calling Workset.SaveAll
.
SaveExecutor
Stupka.QTK.Comos.SaveExecutor (QTK.Comos.dll)
Saves all objects which have been modified (or created) by Quality Toolkit. Before the objects are saved, the standard COMOS check is called.
ScriptInformationSelector
Stupka.QTK.Comos.ScriptInformationSelector (QTK.Comos.dll)
Properties
Name | Type | Required | Description |
---|---|---|---|
comosobject | xsd:IDREF | Yes |
SpecificationExecutor
Stupka.QTK.Comos.SpecificationExecutor (QTK.Comos.dll)
Updates the value (or the linkobject) of a COMOS specification. Before the attribut is changed, the rights are checked.
Info
If the restrictive mode is enabled, this executor also checks inheritance, working areas and if the value matches a linked standardtable to mimic COMOS GUI behavior.
Additionally, in restrictive mode the script IsValueValid
or IsLinkObjectValid
is called if available.
Properties
Name | Type | Required | Description |
---|---|---|---|
comosobject | xsd:IDREF | Yes | Reference to a selector holding a COMOS object. |
linkobject | xsd:IDREF | Reference to a selector holding a COMOS object which will be set as the new linkobject. If not set, the link is not changed. | |
nestedname | xsd:string | NestedName of the specification. |
|
restrictive | xsd:boolean | Use this setting to enable or disable restrictive mode. If enabled, the attribut value is only changed if the pending action would be only allowed within the COMOS GUI. If not set, the default value true is used. If not set, restrictive mode is activated by default. |
|
value | xsd:string | New value for the specification. If not set, the value is not changed. |
Errorcodes
Value | Errorcode | Description |
---|---|---|
1 | IsValueValidFailed | |
2 | IsLinkObjectValidFailed |
SpecificationTest
Stupka.QTK.Comos.SpecificationTest (QTK.Comos.dll)
Tests if a COMOS specification exists, and matches various properties. If no property is specified, only the existence of the specification is checked.
Info
Currently the values have to match exactly, no wildcards are supported.
Properties
Name | Type | Required | Description |
---|---|---|---|
comosobject | xsd:IDREF | Yes | Reference to a selector holding a COMOS object which holds the specification. |
displayvalue | xsd:string | Text to be tested against the DisplayValue of the COMOS specification. |
|
linkobject | xsd:IDREF | Reference to a selector holding a COMOS object, which is expected as LinkObject . |
|
nestedname | xsd:string | NestedName of the specification. |
|
rights | xsd:integer | Numerical value to be tested against the ObjectRights of the specification. |
|
value | xsd:string | Text to be tested against the Value of the COMOS specification. |
SpecificationWaiter
Stupka.QTK.Comos.SpecificationWaiter (QTK.Comos.dll)
Waits until the value of a COMOS specification has a specific value. The value is re-tested every second.
Properties
Name | Type | Required | Description |
---|---|---|---|
expectedvalue | xsd:string | Yes | Text to be tested against the Value of the COMOS specification. |
nestedname | xsd:string | Yes | NestedName of the specification to be evaluated. |
specowner | xsd:IDREF | Yes | Reference to a selector holding a COMOS object. |
timeout | xsd:integer | Timeout in seconds. If no timeout is specified, the value is only tested once. |
UserSelector
Stupka.QTK.Comos.UserSelector (QTK.Comos.dll)
Selects a COMOS user object.
Properties
Name | Type | Required | Description |
---|---|---|---|
username | xsd:string | Name of the user. If not specified, the current user is selected. |
UserTest
Stupka.QTK.Comos.UserTest (QTK.Comos.dll)
Tests if an users exists. Additionally, a check for administrative rights can be performed.
Properties
Name | Type | Required | Description |
---|---|---|---|
adminrights | xsd:integer | Numerical value tests against the information, if the user is an administrator. Specifiy 0 for normal user rights, and 1 for administrative rights. | |
comosobject | xsd:IDREF | Reference to a selector holding a COMOS User object. |