poco.utils.hrpc.hierarchy module¶
-
class
RemotePocoHierarchy
(dumper, selector, attributor)[source]¶ Bases:
poco.sdk.interfaces.hierarchy.HierarchyInterface
-
dump
(**kwargs)[source]¶ Get the UI hierarchy with its origin structure and attributes, then store the structure and attributes into a json serializable dictionary.
Returns: dict representing the hierarchy structure. Structure specification refers to IDumper
.Return type: dict
-
getAttr
(**kwargs)[source]¶ Get attribute of UI element.
Parameters: - 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
(**kwargs)[source]¶ Select UI element(s) matching the given query expression and return the list of selected UI element(s)
Parameters: - 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
Returns: list of UI elements corresponding to the given query expression
Return type: list
- query (
-
setAttr
(**kwargs)[source]¶ Set attribute of UI element.
Parameters: - 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
-