def scroll(self, direction='<STR_LIT>', percent=<NUM_LIT>, duration=<NUM_LIT>):
if direction not in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>raise ValueError('<STR_LIT>'<EOL>.format(repr(direction)))<EOL><DEDENT>focus1 = self._focus or [<NUM_LIT:0.5>, <NUM_LIT:0.5>]<EOL>focus2 = list(focus1)<EOL>half_distance = percent / <NUM_LIT:2><EOL>if direction == '<STR_LIT>':<EOL><INDENT>focus1[<NUM_LIT:1>] += half_distance<EOL>focus2[<NUM_LIT:1>] -= half_distance<EOL><DEDENT>else:<EOL><INDENT>focus1[<NUM_LIT:0>] += half_distance<EOL>focus2[<NUM_LIT:0>] -= half_distance<EOL><DEDENT>return self.focus(focus1).drag_to(self.focus(focus2), duration=duration)<EOL>
Simply touch down from point A and move to point B then release up finally. This action is performed within
specific motion range and duration.

Args:
    direction (:py:obj:`str`): scrolling direction. "vertical" or "horizontal"
    percent (:py:obj:`float`): scrolling distance percentage of selected UI height or width according to
     direction
    duration (:py:obj:`float`): time interval in which the action is performed

Raises:
    PocoNoSuchNodeException: raised when the UI element does not exist