# PickerActions

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

*** ** * ** ***


```
public final class PickerActions
```

<br />

*** ** * ** ***

Espresso action for interacting with `https://developer.android.com/reference/android/widget/DatePicker.html` and `https://developer.android.com/reference/android/widget/TimePicker.html`.

See [Pickers API guide](http://developer.android.com/guide/topics/ui/controls/pickers.html)

## Summary

| ### Public methods |
|---|---|
| `static https://developer.android.com/reference/androidx/test/espresso/ViewAction` | `https://developer.android.com/reference/androidx/test/espresso/contrib/PickerActions#setDate(int,int,int)(int year, int monthOfYear, int dayOfMonth)` Returns a `https://developer.android.com/reference/androidx/test/espresso/ViewAction` that sets a date on a `https://developer.android.com/reference/android/widget/DatePicker.html`. |
| `static https://developer.android.com/reference/androidx/test/espresso/ViewAction` | `https://developer.android.com/reference/androidx/test/espresso/contrib/PickerActions#setTime(int,int)(int hours, int minutes)` Returns a `https://developer.android.com/reference/androidx/test/espresso/ViewAction` that sets a time on a `https://developer.android.com/reference/android/widget/TimePicker.html`. |

## Public methods

### setDate

```
public static ViewAction setDate(int year, int monthOfYear, int dayOfMonth)
```

Returns a `https://developer.android.com/reference/androidx/test/espresso/ViewAction` that sets a date on a `https://developer.android.com/reference/android/widget/DatePicker.html`.

| Parameters |
|---|---|
| `int year` | The year. |
| `int monthOfYear` | The month which is starting from zero. |
| `int dayOfMonth` | The day of the month. |

### setTime

```
public static ViewAction setTime(int hours, int minutes)
```

Returns a `https://developer.android.com/reference/androidx/test/espresso/ViewAction` that sets a time on a `https://developer.android.com/reference/android/widget/TimePicker.html`.

| Parameters |
|---|---|
| `int hours` | the hour to set, in the range (0-23). |
| `int minutes` | the minute to set, in the range (0-59). |