poco.sdk.exceptions module

This module provides several exceptions for poco-sdk. These exceptions are raised only in sdk corresponding runtime.

exception InvalidSurfaceException(target, msg='None')[source]

Bases: Exception

Raised when the device surface is invalid

exception NoSuchComparatorException(matchingMethod, matcherName)[source]

Bases: Exception

Raised when the matcher does not support the given comparison method.

exception NoSuchTargetException[source]

Bases: Exception

Raised when the index is out of range for selecting the UI element by given index.

exception NodeHasBeenRemovedException(attrName, node)[source]

Bases: Exception

Raised when the node (UI element) is refreshed (updated, recycled or destroyed) while retrieving the attributes during traversing the hierarchy.

In some engines implementations, the UI hierarchy is refreshed in a stand-alone thread while poco is performing the traverse process, so the engine error might be triggered when poco is trying to retrieve the attribute of the UI element but the attribute is being updated at the same time. In this situation, poco sdk catches the engine error and raises this exception.

exception NonuniqueSurfaceException(selector)[source]

Bases: Exception

Raised when the device selector matches multiple devices surface

exception UnableToSetAttributeException(attrName, node)[source]

Bases: Exception

Raised when settings the attribute of the given UI element failed. In most cases, the reason why it failed is that the UI element does not support mutation. From the point of view of SDK implementation, this exception can be raised proactively to indicate that the modification of the attribute is not allowed.