Metadata in Robot Framework Runner

In your .robot file, you can insert Squash Metadata into test cases via tags.

For example:

_images/metadata_example_in_robot_script.png

Metadata syntax conventions

In order to work properly, the following syntax rules have to be followed.

Spaces

In a Robot script, all tags must at least have two spaces between each other to be considered as a new tag. If you put only one space, it will be considered as the same tag.

_images/space-between-tags.png

Prefix

To be recognized as a metadata, you have to prefixed it with “tf:”.

_images/metadata-prefixe.png

Metadata Key

In a Metadata annotation, the key is mandatory. A metadata key MUST be ONE WORD which contains only alphanumeric characters, dashes, underscores and dots.

_images/metadata-key-syntax.png

Important

Metadata key is case insensitive and must be unique in a test case.

The same metadata key can be found in different test cases but values can’t be the same. This is not a problem if the metadata key has no value.

Metadata Value

The value is optional. A metadata value MUST be ONE WORD which contains only alphanumeric characters, dashes, slashes, underscores and dots.

You must separate the metada key and value with an “=” symbol.

_images/metadata-value-syntax.png

Important

Metadata value is case sensitive and must be assigned to a metadata key.

If you duplicate two tags with exactly the same key and value, Robot Framework will automatically ignore the second tag with the same value.

Furthermore, if you put two metadata in the same test case with the same key but with different values, our runner will inform you that there is a duplicate key.

Metadata with multiple values

It is possible to have many metadata values associated to a same key.

To separate the different values, you must use a “|” symbol (Press AltGr and 6).

_images/metadata-with-multiple-values.png