# RemoteInteraction

# 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)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/test/espresso/remote/RemoteInteraction "View this page in Java")

<br />

```
interface RemoteInteraction
```

<br />

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

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

*** ** * ** ***

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

## Summary

|                                        ### Constants                                         |
|----------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!` | [BUNDLE_EXECUTION_STATUS](https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/RemoteInteraction#BUNDLE_EXECUTION_STATUS())` = "executionStatus"` |

|                                                                       ### Public functions                                                                        |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`!>!` | [createRemoteCheckCallable](https://developer.android.com/reference/kotlin/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))`(` ` rootMatcher: `[Matcher](https://junit.org/junit4/javadoc/4.12/org/hamcrest/Matcher.html)`<`[Root](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root)`!>!,` ` viewMatcher: `[Matcher](https://junit.org/junit4/javadoc/4.12/org/hamcrest/Matcher.html)`<`[View](https://developer.android.com/reference/android/view/View.html)`!>!,` ` iBinders: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, `[IBinder](https://developer.android.com/reference/android/os/IBinder.html)`!>!,` ` viewAssert: `[ViewAssertion](https://developer.android.com/reference/kotlin/androidx/test/espresso/ViewAssertion)`!` `)` Creates a callable to run Espresso check interaction on remote processes                                                                                |
| [Callable](https://developer.android.com/reference/java/util/concurrent/Callable.html)`<`[Void](https://developer.android.com/reference/java/lang/Void.html)`!>!` | [createRemotePerformCallable](https://developer.android.com/reference/kotlin/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...))`(` ` rootMatcher: `[Matcher](https://junit.org/junit4/javadoc/4.12/org/hamcrest/Matcher.html)`<`[Root](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root)`!>!,` ` viewMatcher: `[Matcher](https://junit.org/junit4/javadoc/4.12/org/hamcrest/Matcher.html)`<`[View](https://developer.android.com/reference/android/view/View.html)`!>!,` ` iBinders: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, `[IBinder](https://developer.android.com/reference/android/os/IBinder.html)`!>!,` ` viewActions: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[ViewAction](https://developer.android.com/reference/kotlin/androidx/test/espresso/ViewAction)`!>!` `)` Creates a callable to run a perform interaction on remote processes. |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                               | [isRemoteClient](https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/RemoteInteraction#isRemoteClient())`()` Returns {code true} if the current Espresso instance is communicating with another Espresso instance in a remote process.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     |
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                               | [isRemoteProcess](https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/RemoteInteraction#isRemoteProcess())`()` Returns`true`if the current Espresso instance running in a remote process.                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  |

## Constants

### BUNDLE_EXECUTION_STATUS

```
const val BUNDLE_EXECUTION_STATUS = "executionStatus": String!
```  

## Public functions

### createRemoteCheckCallable

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

Creates a callable to run Espresso check interaction on remote processes

The caller is expected to schedule the task to run.  

|                                                                                                                                                                                     Parameters                                                                                                                                                                                     |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|
| `rootMatcher: `[Matcher](https://junit.org/junit4/javadoc/4.12/org/hamcrest/Matcher.html)`<`[Root](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root)`!>!`                                                                                                                                                                                                | the root matcher to use.                                       |
| `viewMatcher: `[Matcher](https://junit.org/junit4/javadoc/4.12/org/hamcrest/Matcher.html)`<`[View](https://developer.android.com/reference/android/view/View.html)`!>!`                                                                                                                                                                                                            | the view matcher to use.                                       |
| `iBinders: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, `[IBinder](https://developer.android.com/reference/android/os/IBinder.html)`!>!` | a list of binders to pass along to the remote process instance |
| `viewAssert: `[ViewAssertion](https://developer.android.com/reference/kotlin/androidx/test/espresso/ViewAssertion)`!`                                                                                                                                                                                                                                                              | the view assertion to use.                                     |

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

### createRemotePerformCallable

```
fun createRemotePerformCallable(
    rootMatcher: Matcher<Root!>!,
    viewMatcher: Matcher<View!>!,
    iBinders: (Mutable)Map<String!, IBinder!>!,
    viewActions: Array<ViewAction!>!
): Callable<Void!>!
```

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[NoRemoteEspressoInstanceException](https://developer.android.com/reference/kotlin/androidx/test/espresso/remote/NoRemoteEspressoInstanceException)will be thrown.  

|                                                                                                                                                                                     Parameters                                                                                                                                                                                     |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------|
| `rootMatcher: `[Matcher](https://junit.org/junit4/javadoc/4.12/org/hamcrest/Matcher.html)`<`[Root](https://developer.android.com/reference/kotlin/androidx/test/espresso/Root)`!>!`                                                                                                                                                                                                | the root matcher to use.                                       |
| `viewMatcher: `[Matcher](https://junit.org/junit4/javadoc/4.12/org/hamcrest/Matcher.html)`<`[View](https://developer.android.com/reference/android/view/View.html)`!>!`                                                                                                                                                                                                            | the view matcher to use.                                       |
| `iBinders: (`[Mutable](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-mutable-map/index.html)`)`[Map](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin.collections/-map/index.html)`<`[String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)`!, `[IBinder](https://developer.android.com/reference/android/os/IBinder.html)`!>!` | a list of binders to pass along to the remote process instance |
| `viewActions: `[Array](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-array/index.html)`<`[ViewAction](https://developer.android.com/reference/kotlin/androidx/test/espresso/ViewAction)`!>!`                                                                                                                                                                               | one or more actions to execute.                                |

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

### isRemoteClient

```
fun isRemoteClient(): Boolean
```

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

### isRemoteProcess

```
fun isRemoteProcess(): Boolean
```

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