Description
This object provides a scripting interface to tags assigned to a BDD scenario or feature file.
To obtain this object, you use code like this –
JavaScript
let tags = Features.Item(0).Tags; // Feature tags
let tags = Features.Item(0).Scenarios.Item(0).Tags; // Scenario tags
Python
tags = Features.Item[0].Tags # Feature tags
tags = Features.Item[0].Scenarios.Item[0].Tags # Scenario tags
VBScript
Set tags = Features.Item(0).Tags ' Feature tags
Set tags = Features.Item(0).Scenarios.Item(0).Tags ' Scenario tags
DelphiScript
// DelphiScript does not support BDD.
C++Script, C#Script
var tags = Features["Item"](0)["Tags"] // Feature tags
var tags = Features["Item"](0)["Scenarios"]["Item"](0)["Tags"] // Scenario tags
Members
The object has the following methods and properties:
Member | Description |
---|---|
Contains(Tag) |
Checks if the tags collection includes the tag specified by the Tag parameter. The method returns
|
Count |
Returns the number of tags assigned to a scenario or feature. |
Item(Index) |
Returns a tag name (string) by the tag’s index (zero-based) in the collection. The resulting value includes the |
Example
For examples of using the Tags
collection in scripts, see the following topic:
See Also
Behavior-Driven Development (BDD) With TestComplete
Tags
Scripting