MCPcopy Index your code
hub / github.com/AirtestProject/Poco / rclick

Method rclick

poco/proxy.py:343–372  ·  view source on GitHub ↗

Perform the right click action on the UI element(s) represented by the UI proxy. If this UI proxy represents a set of UI elements, the first one in the set is clicked and the anchor point of the UI element is used as the default one. It is also possible to click another poin

(self, focus=None, sleep_interval=None)

Source from the content-addressed store, hash-verified

341
342 @wait
343 def rclick(self, focus=None, sleep_interval=None):
344 """
345 Perform the right click action on the UI element(s) represented by the UI proxy. If this UI proxy represents a set of
346 UI elements, the first one in the set is clicked and the anchor point of the UI element is used as the default
347 one. It is also possible to click another point offset by providing ``focus`` argument.
348
349 See ``CoordinateSystem`` for more details.
350
351 Args:
352 focus (2-:obj:`tuple`/2-:obj:`list`/:obj:`str`): an offset point (x, y) from the top left corner of the UI
353 element(s), values must be in range of 0~1. This argument can be also specified by 'anchor' or 'center'.
354 'Center' means to click the center of bounding box of UI element.
355 sleep_interval: number of seconds to wait after this action. Default is None which is the default sleep
356 interval. This value can be configured by Poco initialization. See configuration at poco
357 :py:class:`initialization <poco.pocofw.Poco>` for more details.
358
359 Raises:
360 PocoNoSuchNodeException: raised when the UI element does not exist
361 """
362
363 focus = focus or self._focus or 'center'
364 pos_in_percentage = self.get_position(focus)
365 self.poco.pre_action('rclick', self, pos_in_percentage)
366 ret = self.poco.rclick(pos_in_percentage)
367 if sleep_interval:
368 time.sleep(sleep_interval)
369 else:
370 self.poco.wait_stable()
371 self.poco.post_action('rclick', self, pos_in_percentage)
372 return ret
373
374 @wait
375 def double_click(self, focus=None, sleep_interval=None):

Callers

nothing calls this directly

Calls 4

get_positionMethod · 0.95
pre_actionMethod · 0.80
wait_stableMethod · 0.80
post_actionMethod · 0.80

Tested by

no test coverage detected