poco.sdk.exceptions module

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

exception NodeHasBeenRemovedException(attrName, node)[源代码]

基类:exceptions.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 UnableToSetAttributeException(attrName, node)[源代码]

基类:exceptions.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.

exception NoSuchTargetException[源代码]

基类:exceptions.Exception

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

待处理

Maybe this is a little bit redundant to poco.exceptions.PocoNoSuchNodeException. Should be optimized.

exception NoSuchComparatorException(matchingMethod, matcherName)[源代码]

基类:exceptions.Exception

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

exception NonuniqueSurfaceException(selector)[源代码]

基类:exceptions.Exception

Raised when the device selector matches mutiple devices surface

exception InvalidSurfaceException(target, msg='None')[源代码]

基类:exceptions.Exception

Raised when the device surface is invalid