# InteractionRequest

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

*** ** * ** ***


```
public final class InteractionRequest implements EspressoRemoteMessage.To<MessageLite>
```

<br />

*** ** * ** ***

Encapsulates an request. Takes care of all the proto packing and unpacking.

## Summary

| ### Nested types |
|---|
| `public class https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest.Builder` Creates an instance of `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest` from a View matcher and action. |

| ### Public fields |
|---|---|
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/androidx/test/espresso/Root>` | `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest#rootMatcher()` |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/test/espresso/ViewAction` | `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest#viewAction()` |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://developer.android.com/reference/androidx/test/espresso/ViewAssertion` | `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest#viewAssertion()` |
| `final @https://developer.android.com/reference/androidx/annotation/Nullable https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/view/View.html>` | `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest#viewMatcher()` |

| ### Public methods |
|---|---|
| `https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/androidx/test/espresso/Root>` | `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest#getRootMatcher()()` Returns the `https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html` associated with this `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest` or ` null` if no `https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html` was set. |
| `https://developer.android.com/reference/androidx/test/espresso/ViewAction` | `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest#getViewAction()()` Returns the `https://developer.android.com/reference/androidx/test/espresso/ViewAction` associated with this `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest` or `null` if no `https://developer.android.com/reference/androidx/test/espresso/ViewAction` was set. |
| `https://developer.android.com/reference/androidx/test/espresso/ViewAssertion` | `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest#getViewAssertion()()` Returns the `https://developer.android.com/reference/androidx/test/espresso/ViewAssertion` associated with this `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest` or ` null` if no `https://developer.android.com/reference/androidx/test/espresso/ViewAssertion` was set. |
| `https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html<https://developer.android.com/reference/android/view/View.html>` | `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest#getViewMatcher()()` Returns the `https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html` associated with this `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest` or ` null` if no view matcher was set. |
| `https://protobuf.dev/reference/java/api-docs/com/google/protobuf/MessageLite.html` | `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest#toProto()()` |

## Public fields

### rootMatcher

```
public final @Nullable Matcher<Root> rootMatcher
```

### viewAction

```
public final @Nullable ViewAction viewAction
```

### viewAssertion

```
public final @Nullable ViewAssertion viewAssertion
```

### viewMatcher

```
public final @Nullable Matcher<View> viewMatcher
```

## Public methods

### getRootMatcher

```
public Matcher<Root> getRootMatcher()
```

Returns the `https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html` associated with this `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest` or `
null` if no `https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html` was set.

### getViewAction

```
public ViewAction getViewAction()
```

Returns the `https://developer.android.com/reference/androidx/test/espresso/ViewAction` associated with this `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest` or `null` if no `https://developer.android.com/reference/androidx/test/espresso/ViewAction` was set.

### getViewAssertion

```
public ViewAssertion getViewAssertion()
```

Returns the `https://developer.android.com/reference/androidx/test/espresso/ViewAssertion` associated with this `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest` or `
null` if no `https://developer.android.com/reference/androidx/test/espresso/ViewAssertion` was set.

### getViewMatcher

```
public Matcher<View> getViewMatcher()
```

Returns the `https://junit.org/junit4/javadoc/latest/org/hamcrest/Matcher.html` associated with this `https://developer.android.com/reference/androidx/test/espresso/remote/InteractionRequest` or `
null` if no view matcher was set.

### toProto

```
public MessageLite toProto()
```