# AtomAction

Summary:[Ctors](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#pubctors)\|[Methods](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#inhmethods)\|[\[Expand All\]](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#)  

# AtomAction

| This package is part of the Android[support library](https://developer.android.com/topic/libraries/support-library)which is no longer maintained. The support library has been superseded by[AndroidX](https://developer.android.com/jetpack/androidx)which is part of[Jetpack](https://developer.android.com/jetpack). We recommend using the AndroidX libraries in all new projects. You should also consider[migrating](https://developer.android.com/jetpack/androidx/migrate)existing projects to AndroidX. To find the AndroidX class that maps to this deprecated class, see the AndroidX support library[class mappings](https://developer.android.com/jetpack/androidx/migrate/class-mappings).

`
public

final

class
AtomAction
`  
`

extends `[Object](https://developer.android.com/reference/java/lang/Object.html)`


``


implements

`[ViewAction](https://developer.android.com/reference/android/support/test/espresso/ViewAction)`,

`[Bindable](https://developer.android.com/reference/android/support/test/espresso/remote/Bindable)`


`

|---|----------------------------------------------------------|
| [java.lang.Object](https://developer.android.com/reference/java/lang/Object.html) ||
| ↳ | android.support.test.espresso.web.action.AtomAction\<E\> |

<br />

*** ** * ** ***

A ViewAction which causes the provided Atom to be evaluated within a webview.

It is not recommended to use AtomAction directly.

Instead for examples of how to interact with a WebView's content through Atoms.

If you must use AtomAction directly, take care to remember that they are Stateful (unlike most ViewActions) and the caller must call[get()](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#get())to ensure that the action has completed.  
**See also:**

- [Web](https://developer.android.com/reference/android/support/test/espresso/web/sugar/Web)

## Summary

|                                                                                                                                                                                                                                                                                                                                    ### Public constructors                                                                                                                                                                                                                                                                                                                                    ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[AtomAction](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#AtomAction(android.support.test.espresso.web.model.Atom<E>, android.support.test.espresso.web.model.WindowReference, android.support.test.espresso.web.model.ElementReference))`(`[Atom](https://developer.android.com/reference/android/support/test/espresso/web/model/Atom)`<E> atom, `[WindowReference](https://developer.android.com/reference/android/support/test/espresso/web/model/WindowReference)` window, `[ElementReference](https://developer.android.com/reference/android/support/test/espresso/web/model/ElementReference)` element) ` Creates an AtomAction. |

|                                                                                                                                                                                                                                                   ### Public methods                                                                                                                                                                                                                                                    ||
|--------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` E`                                                                                       | ` `[get](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#get(long, java.util.concurrent.TimeUnit))`(long val, `[TimeUnit](https://developer.android.com/reference/java/util/concurrent/TimeUnit.html)` unit) ` Blocks until the atom has completed execution with a configurable timeout.                                                                                       |
| ` E`                                                                                       | ` `[get](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#get())`() ` Blocks until the atom has completed execution.                                                                                                                                                                                                                                                             |
| ` Matcher<`[View](https://developer.android.com/reference/android/view/View.html)`>`       | ` `[getConstraints](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#getConstraints())`() ` A mechanism for ViewActions to specify what type of views they can operate on.                                                                                                                                                                                                       |
| ` `[String](https://developer.android.com/reference/java/lang/String.html)                 | ` `[getDescription](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#getDescription())`() ` Returns a description of the view action.                                                                                                                                                                                                                                            |
| ` `[Future](https://developer.android.com/reference/java/util/concurrent/Future.html)`<E>` | ` `[getFuture](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#getFuture())`() ` Return a Future, which will be set and transformed from futureEval.                                                                                                                                                                                                                            |
| ` `[IBinder](https://developer.android.com/reference/android/os/IBinder.html)              | ` `[getIBinder](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#getIBinder())`() `                                                                                                                                                                                                                                                                                              |
| ` `[String](https://developer.android.com/reference/java/lang/String.html)                 | ` `[getId](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#getId())`() `                                                                                                                                                                                                                                                                                                        |
| ` void`                                                                                    | ` `[perform](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#perform(android.support.test.espresso.UiController, android.view.View))`(`[UiController](https://developer.android.com/reference/android/support/test/espresso/UiController)` controller, `[View](https://developer.android.com/reference/android/view/View.html)` view) ` Performs this action on the given view. |
| ` void`                                                                                    | ` `[setIBinder](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#setIBinder(android.os.IBinder))`(`[IBinder](https://developer.android.com/reference/android/os/IBinder.html)` binder) ` Sets the[IBinder](https://developer.android.com/reference/android/os/IBinder.html)of the implementing class.                                                                            |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#)From class` `[java.lang.Object](https://developer.android.com/reference/java/lang/Object.html)` ` |-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------| | ` `[Object](https://developer.android.com/reference/java/lang/Object.html)          | ` clone() `                                                                                | | ` boolean`                                                                          | ` equals(`[Object](https://developer.android.com/reference/java/lang/Object.html)` arg0) ` | | ` void`                                                                             | ` finalize() `                                                                             | | ` final `[Class](https://developer.android.com/reference/java/lang/Class.html)`<?>` | ` getClass() `                                                                             | | ` int`                                                                              | ` hashCode() `                                                                             | | ` final void`                                                                       | ` notify() `                                                                               | | ` final void`                                                                       | ` notifyAll() `                                                                            | | ` `[String](https://developer.android.com/reference/java/lang/String.html)          | ` toString() `                                                                             | | ` final void`                                                                       | ` wait(long arg0, int arg1) `                                                              | | ` final void`                                                                       | ` wait(long arg0) `                                                                        | | ` final void`                                                                       | ` wait() `                                                                                 | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#)From interface` `[android.support.test.espresso.ViewAction](https://developer.android.com/reference/android/support/test/espresso/ViewAction)` ` |-----------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract Matcher<`[View](https://developer.android.com/reference/android/view/View.html)`>` | ` `[getConstraints](https://developer.android.com/reference/android/support/test/espresso/ViewAction#getConstraints())`() ` A mechanism for ViewActions to specify what type of views they can operate on.                                                                                                                                                                                                         | | ` abstract `[String](https://developer.android.com/reference/java/lang/String.html)           | ` `[getDescription](https://developer.android.com/reference/android/support/test/espresso/ViewAction#getDescription())`() ` Returns a description of the view action.                                                                                                                                                                                                                                              | | ` abstract void`                                                                              | ` `[perform](https://developer.android.com/reference/android/support/test/espresso/ViewAction#perform(android.support.test.espresso.UiController, android.view.View))`(`[UiController](https://developer.android.com/reference/android/support/test/espresso/UiController)` uiController, `[View](https://developer.android.com/reference/android/view/View.html)` view) ` Performs this action on the given view. | ||
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction#)From interface` `[android.support.test.espresso.remote.Bindable](https://developer.android.com/reference/android/support/test/espresso/remote/Bindable)` ` |----------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | ` abstract `[IBinder](https://developer.android.com/reference/android/os/IBinder.html) | ` `[getIBinder](https://developer.android.com/reference/android/support/test/espresso/remote/Bindable#getIBinder())`() `                                                                                                                                                                                                                   | | ` abstract `[String](https://developer.android.com/reference/java/lang/String.html)    | ` `[getId](https://developer.android.com/reference/android/support/test/espresso/remote/Bindable#getId())`() `                                                                                                                                                                                                                             | | ` abstract void`                                                                       | ` `[setIBinder](https://developer.android.com/reference/android/support/test/espresso/remote/Bindable#setIBinder(android.os.IBinder))`(`[IBinder](https://developer.android.com/reference/android/os/IBinder.html)` binder) ` Sets the[IBinder](https://developer.android.com/reference/android/os/IBinder.html)of the implementing class. | ||

## Public constructors

### AtomAction

```
AtomAction (Atom<E> atom, 
                WindowReference window, 
                ElementReference element)
```

Creates an AtomAction.

<br />

|                                         Parameters                                         ||
|-----------|---------------------------------------------------------------------------------|
| `atom`    | `Atom`: the atom to execute <br />                                              |
| `window`  | `WindowReference`: (optional/nullable) the window context to execute on. <br /> |
| `element` | `ElementReference`: (optional/nullable) the element to execute on. <br />       |

## Public methods

### get

```
E get (long val, 
                TimeUnit unit)
```

Blocks until the atom has completed execution with a configurable timeout.

<br />

|        Parameters         ||
|--------|-------------------|
| `val`  | `long` <br />     |
| `unit` | `TimeUnit` <br /> |

|   Returns   ||
|-----|--------|
| `E` | <br /> |

|                                                    Throws                                                     ||
|------------------------------------------------------------------------------------------------------------|---|
| [ExecutionException](https://developer.android.com/reference/java/util/concurrent/ExecutionException.html) |   |
| [InterruptedException](https://developer.android.com/reference/java/lang/InterruptedException.html)        |   |
| [TimeoutException](https://developer.android.com/reference/java/util/concurrent/TimeoutException.html)     |   |

### get

```
E get ()
```

Blocks until the atom has completed execution.

<br />

|   Returns   ||
|-----|--------|
| `E` | <br /> |

|                                                    Throws                                                     ||
|------------------------------------------------------------------------------------------------------------|---|
| [ExecutionException](https://developer.android.com/reference/java/util/concurrent/ExecutionException.html) |   |
| [InterruptedException](https://developer.android.com/reference/java/lang/InterruptedException.html)        |   |

### getConstraints

```
Matcher<View> getConstraints ()
```

A mechanism for ViewActions to specify what type of views they can operate on.

A ViewAction can demand that the view passed to perform meets certain constraints. For example it may want to ensure the view is already in the viewable physical screen of the device or is of a certain type.

<br />

|                                                                                                            Returns                                                                                                            ||
|-------------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------|
| `Matcher<`[View](https://developer.android.com/reference/android/view/View.html)`>` | a[`Matcher`](http://hamcrest.org/JavaHamcrest/javadoc/1.3/org/hamcrest/Matcher.html)that will be tested prior to calling perform. <br /> |

### getDescription

```
String getDescription ()
```

Returns a description of the view action. The description should not be overly long and should fit nicely in a sentence like: "performing %description% action on view with id ..."

<br />

|                                     Returns                                     ||
|-------------------------------------------------------------------------|--------|
| [String](https://developer.android.com/reference/java/lang/String.html) | <br /> |

### getFuture

```
Future<E> getFuture ()
```

Return a Future, which will be set and transformed from futureEval. Espresso's public API cannot have guava types in its method signatures, so return Future instead of ListenableFuture or SettableFuture.

<br />

|                                             Returns                                             ||
|-----------------------------------------------------------------------------------------|--------|
| [Future](https://developer.android.com/reference/java/util/concurrent/Future.html)`<E>` | <br /> |

### getIBinder

```
IBinder getIBinder ()
```

<br />

<br />

|                                      Returns                                       ||
|----------------------------------------------------------------------------|--------|
| [IBinder](https://developer.android.com/reference/android/os/IBinder.html) | <br /> |

### getId

```
String getId ()
```

<br />

<br />

|                                     Returns                                     ||
|-------------------------------------------------------------------------|--------|
| [String](https://developer.android.com/reference/java/lang/String.html) | <br /> |

### perform

```
void perform (UiController controller, 
                View view)
```

Performs this action on the given view.

<br />

|                                     Parameters                                      ||
|--------------|-----------------------------------------------------------------------|
| `controller` | `UiController`: the controller to use to interact with the UI. <br /> |
| `view`       | `View`: the view to act upon. never null. <br />                      |

### setIBinder

```
void setIBinder (IBinder binder)
```

Sets the[IBinder](https://developer.android.com/reference/android/os/IBinder.html)of the implementing class.

<br />

|                                                Parameters                                                 ||
|----------|-------------------------------------------------------------------------------------------------|
| `binder` | `IBinder`: the[IBinder](https://developer.android.com/reference/android/os/IBinder.html) <br /> |

-

  ## Interfaces

  - [IAtomActionResultPropagator](https://developer.android.com/reference/android/support/test/espresso/web/action/IAtomActionResultPropagator)
-

  ## Classes

  - [AtomAction](https://developer.android.com/reference/android/support/test/espresso/web/action/AtomAction)
  - [EnableJavascriptAction](https://developer.android.com/reference/android/support/test/espresso/web/action/EnableJavascriptAction)
  - [IAtomActionResultPropagator.Stub](https://developer.android.com/reference/android/support/test/espresso/web/action/IAtomActionResultPropagator.Stub)
  - [IAtomActionResultPropagator.Stub.Proxy](https://developer.android.com/reference/android/support/test/espresso/web/action/IAtomActionResultPropagator.Stub.Proxy)