selection_actions.go
func (s *Selection) Tap(event Tap) error {
	var touchFunc func(*api.Element) error
	switch event {
	case SingleTap:
		touchFunc = s.session.TouchClick
	case DoubleTap:
		touchFunc = s.session.TouchDoubleClick
	case LongTap:
		touchFunc = s.session.TouchLongClick
	default:
		return fmt.Errorf("failed to %s on %s: invalid tap event", event, s)
	}

	return s.forEachElement(func(selectedElement element.Element) error {
		if err := touchFunc(selectedElement.(*api.Element)); err != nil {
			return fmt.Errorf("failed to %s on %s: %s", event, s, err)
		}
		return nil
	})
}
func (s *Selection) Tap(event Tap) error {
	var touchFunc func(*api.Element) error
	switch event {
	case SingleTap:
		touchFunc = s.session.TouchClick
	case DoubleTap:
		touchFunc = s.session.TouchDoubleClick
	case LongTap:
		touchFunc = s.session.TouchLongClick
	default:
		return fmt.Errorf("failed to %s on %s: invalid tap event", event, s)
	}

	return s.forEachElement(func(selectedElement element.Element) error {
		if err := touchFunc(selectedElement.(*api.Element)); err != nil {
			return fmt.Errorf("failed to %s on %s: %s", event, s, err)
		}
		return nil
	})
}
// Tap performs the provided Tap event on each element in the selection.