guard let window = elementAsView.window! as UIView! else {
          let errorInfo = [NSLocalizedDescriptionKey:
            NSLocalizedString("Element is not attached to a window",
                              comment: "")]
          errorOrNil?.pointee = NSError(domain: kGREYInteractionErrorDomain,