code: def setattr(self, name, val):
          
  
          nodes = self._do_query(multiple=False)
          try:
              return self.poco.agent.hierarchy.setAttr(nodes, name, val)
          except UnableToSetAttributeException as e:
              raise InvalidOperationException('"{}" of "{}"'.format(str(e), self))
docs: 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 attribute value to cast
  
          Raises:
              InvalidOperationException: when it fails to set the attribute on UI element