Change the attribute value of the UI element. Not all attributes can be casted to text. If changing the immutable attributes or attributes which do not exist, the InvalidOperationException exception is raised. Args: name: attribute name val: new attr
(self, name, val)
| 742 | |
| 743 | @refresh_when(PocoTargetRemovedException) |
| 744 | def setattr(self, name, val): |
| 745 | """ |
| 746 | Change the attribute value of the UI element. Not all attributes can be casted to text. If changing the |
| 747 | immutable attributes or attributes which do not exist, the InvalidOperationException exception is raised. |
| 748 | |
| 749 | Args: |
| 750 | name: attribute name |
| 751 | val: new attribute value to cast |
| 752 | |
| 753 | Raises: |
| 754 | InvalidOperationException: when it fails to set the attribute on UI element |
| 755 | """ |
| 756 | |
| 757 | nodes = self._do_query(multiple=False) |
| 758 | try: |
| 759 | return self.poco.agent.hierarchy.setAttr(nodes, name, val) |
| 760 | except UnableToSetAttributeException as e: |
| 761 | raise InvalidOperationException('"{}" of "{}"'.format(str(e), self)) |
| 762 | |
| 763 | @volatile_attribute |
| 764 | def exists(self): |
no test coverage detected