GlobalMapping

class GlobalMapping

Returned by

AddItem(mappingItem)

Adds a mapping item to the mapping.

Parameters:
mappingItem

The mapping item to be added

Clone()

Call this method if you want to use API-objects in multiple contexts, e.g. if you want to insert a specific test step in multiple blocks.

Returns:

A copy of this object

Return type:

GlobalMapping

GetFilename()

Returns the path to the .xam file.

Returns:

Path to the .xam file or None if mapping is not saved yet.

Return type:

str

GetItemByName(name)

Searches the mapping for the mapping item by its name and returns it if existing.

Parameters:
name : str

The name of the mapping item to be searched for

Returns:

mapping item with the given name or None if no such mapping item exists

Return type:

MappingItem

GetItems()

Returns a list of all the mapping items of the mapping.

Returns:

List of all the mapping items of the mapping.

Return type:

list[MappingItem]

GetItemsByTargetPath(targetPath)

Searches the mapping for all mapping items that have the target path and returns them if existing.

Parameters:
targetPath : str

The target path of the mapping items to be searched for

Returns:

List of mapping items that have the target path.

Return type:

list[MappingItem]

HasItem(mappingItem)

Checks whether the given mapping item belongs to the mapping.

Parameters:
mappingItem

The mapping item to be checked

Returns:

True if the given mapping item belongs to the mapping.

Return type:

boolean

RemoveItemByName(name)

Removes a mapping item from the mapping.

Parameters:
name : str

The name of the mapping item to be removed

ReplaceItem(mappingItem)

Replaces a mapping item from the mapping

Parameters:
mappingItem

The new mapping item to replace an existing one of the same name

Save(filename='', allowCompatibilityFallback=False)

Saves the mapping space as an .xam file. Appends file ending if needed.

Parameters:
filename : str

File name of the mapping file; Either absolute or relative to the ‘Parameters’ directory. If left out, use the existing file name and path (from a previous call of Save() or MappingApi.OpenMapping())

allowCompatibilityFallback : bool

If True and a compatibility mode is active, save in the minimum compatible version when needed. If False, compatibility problems raise an exception instead.