# RemoteInteraction

Artifact: [androidx.test.espresso:espresso-core](https://developer.android.com/jetpack/androidx/releases/test-espresso) [View Source](https://cs.android.com/search?q=file:androidx/test/espresso/remote/RemoteInteraction.java+class:androidx.test.espresso.remote.RemoteInteraction)

*** ** * ** ***


```
public interface RemoteInteraction
```

<br />

Known direct subclasses [EspressoRemote](https://developer.android.com/reference/androidx/test/espresso/remote/EspressoRemote), [NoopRemoteInteraction](https://developer.android.com/reference/androidx/test/espresso/remote/NoopRemoteInteraction)

|---|---|
| `https://developer.android.com/reference/androidx/test/espresso/remote/EspressoRemote` | A singleton class that facilitates communication between other Espresso instance that may be running in different processes. |
| `https://developer.android.com/reference/androidx/test/espresso/remote/NoopRemoteInteraction` | Noop RemoteInteraction object |

*** ** * ** ***

Facilitates communication between other Espresso instance that may be running in different processes.

## Summary

| ### Constants |
|---|---|
| `default static final https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/androidx/test/espresso/remote/RemoteInteraction#BUNDLE_EXECUTION_STATUS() = "executionStatus"` |

| ### Public methods |
|---|---|
| `abstract https://developer.android.com/reference/java/util/concurrent/Callable.html<https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/test/espresso/remote/RemoteInteraction#createRemoteCheckCallable(org.hamcrest.Matcher<androidx.test.espresso.Root>,org.hamcrest.Matcher<android.view.View>,java.util.Map<java.lang.String,android.os.IBinder>,androidx.test.espresso.ViewAssertion)( https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/androidx/test/espresso/Root> rootMatcher, https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/view/View.html> viewMatcher, https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/android/os/IBinder.html> iBinders, https://developer.android.com/reference/androidx/test/espresso/ViewAssertion viewAssert )` Creates a callable to run Espresso check interaction on remote processes |
| `abstract https://developer.android.com/reference/java/util/concurrent/Callable.html<https://developer.android.com/reference/java/lang/Void.html>` | `https://developer.android.com/reference/androidx/test/espresso/remote/RemoteInteraction#createRemotePerformCallable(org.hamcrest.Matcher<androidx.test.espresso.Root>,org.hamcrest.Matcher<android.view.View>,java.util.Map<java.lang.String,android.os.IBinder>,androidx.test.espresso.ViewAction...)( https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/androidx/test/espresso/Root> rootMatcher, https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/view/View.html> viewMatcher, https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/android/os/IBinder.html> iBinders, ViewAction[] viewActions )` Creates a callable to run a perform interaction on remote processes. |
| `default boolean` | `https://developer.android.com/reference/androidx/test/espresso/remote/RemoteInteraction#isRemoteClient()()` Returns {code true} if the current Espresso instance is communicating with another Espresso instance in a remote process. |
| `abstract boolean` | `https://developer.android.com/reference/androidx/test/espresso/remote/RemoteInteraction#isRemoteProcess()()` Returns `true` if the current Espresso instance running in a remote process. |

## Constants

### BUNDLE_EXECUTION_STATUS

```
default static final String BUNDLE_EXECUTION_STATUS = "executionStatus"
```

## Public methods

### createRemoteCheckCallable

```
abstract Callable<Void> createRemoteCheckCallable(
    Matcher<Root> rootMatcher,
    Matcher<View> viewMatcher,
    Map<String, IBinder> iBinders,
    ViewAssertion viewAssert
)
```

Creates a callable to run Espresso check interaction on remote processes

The caller is expected to schedule the task to run.

| Parameters |
|---|---|
| `https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/androidx/test/espresso/Root> rootMatcher` | the root matcher to use. |
| `https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/view/View.html> viewMatcher` | the view matcher to use. |
| `https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/android/os/IBinder.html> iBinders` | a list of binders to pass along to the remote process instance |
| `https://developer.android.com/reference/androidx/test/espresso/ViewAssertion viewAssert` | the view assertion to use. |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/util/concurrent/Callable.html<https://developer.android.com/reference/java/lang/Void.html>` | a `https://developer.android.com/reference/java/util/concurrent/Callable.html` that will perform the check pending completion of the task. |

### createRemotePerformCallable

```
abstract Callable<Void> createRemotePerformCallable(
    Matcher<Root> rootMatcher,
    Matcher<View> viewMatcher,
    Map<String, IBinder> iBinders,
    ViewAction[] viewActions
)
```

Creates a callable to run a perform interaction on remote processes.

If there no remote Espresso currently running in a timely manner the interaction will not be executed and a `https://developer.android.com/reference/androidx/test/espresso/remote/NoRemoteEspressoInstanceException` will be thrown.

| Parameters |
|---|---|
| `https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/androidx/test/espresso/Root> rootMatcher` | the root matcher to use. |
| `https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/view/View.html> viewMatcher` | the view matcher to use. |
| `https://developer.android.com/reference/java/util/Map.html<https://developer.android.com/reference/java/lang/String.html, https://developer.android.com/reference/android/os/IBinder.html> iBinders` | a list of binders to pass along to the remote process instance |
| `ViewAction[] viewActions` | one or more actions to execute. |

| Returns |
|---|---|
| `https://developer.android.com/reference/java/util/concurrent/Callable.html<https://developer.android.com/reference/java/lang/Void.html>` | a `https://developer.android.com/reference/java/util/concurrent/Callable.html` that performs the action. |

### isRemoteClient

```
default boolean isRemoteClient()
```

Returns {code true} if the current Espresso instance is communicating with another Espresso instance in a remote process.

### isRemoteProcess

```
abstract boolean isRemoteProcess()
```

Returns `true` if the current Espresso instance running in a remote process.