poco.utils.hrpc.hierarchy module¶
-
class
RemotePocoHierarchy
(dumper, selector, attributor)[源代码]¶ 基类:
poco.sdk.interfaces.hierarchy.HierarchyInterface
-
dump
()[源代码]¶ Get the UI hierarchy with its origin structure and attributes, then store the structure and attributes into a json serializable dictionary.
返回: dict representing the hierarchy structure. Structure specification refers to IDumper
.返回类型: dict
-
getAttr
(nodes, name)[源代码]¶ Get attribute of UI element.
参数: - nodes – UI element or list of UI elements, if there is a list of UI elements provided, then only the first UI element will be used
- name (
str
) – attribute name
-
select
(query, multiple=False)[源代码]¶ Select UI element(s) matching the given query expression and return the list of selected UI element(s)
参数: - query (
tuple
) – query expression, for the structure specification refer toSelector
. - multiple (
bool
) – whether or not to select multiple elements, if False, the method terminates immediately once the node is found, otherwise the method travers through all nodes and then terminates
返回: list of UI elements corresponding to the given query expression
返回类型: list
- query (
-
setAttr
(nodes, name, value)[源代码]¶ Set attribute of UI element.
参数: - nodes – UI element or list of UI elements, if there is a list of UI elements provided, then only the first UI element will be used
- name (
str
) – attribute name - value – new value to be set.
Raises: UnableToSetAttributeException
– raised when:- fails to set attributes on given UI element
- the engine does not support mutating attributes
- developer does not allow to change the attribute value by implementation
-