# EnableJavascriptAction

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

# EnableJavascriptAction

| 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


class
EnableJavascriptAction
`  
`

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


``


implements

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


`

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

<br />

*** ** * ** ***

Forcibly enables Javascript on a WebView.

This has side-effects callers should be aware of:

- On Jellybean and below - the WebView will be reloaded.
- Javascript will be enabled for the rest of the view's lifetime

<br />

## Summary

|                                                                        ### Public constructors                                                                        ||
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[EnableJavascriptAction](https://developer.android.com/reference/android/support/test/espresso/web/action/EnableJavascriptAction#EnableJavascriptAction())`() ` |

|                                                                                                                                                                                                                                                      ### Public methods                                                                                                                                                                                                                                                       ||
|--------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` Matcher<`[View](https://developer.android.com/reference/android/view/View.html)`>` | ` `[getConstraints](https://developer.android.com/reference/android/support/test/espresso/web/action/EnableJavascriptAction#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/EnableJavascriptAction#getDescription())`() ` Returns a description of the view action.                                                                                                                                                                                                                                            |
| ` void`                                                                              | ` `[perform](https://developer.android.com/reference/android/support/test/espresso/web/action/EnableJavascriptAction#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. |

| ### Inherited methods |
|-----------------------|---|
| [![](https://developer.android.com/static/assets/images/styles/disclosure_down.png)](https://developer.android.com/reference/android/support/test/espresso/web/action/EnableJavascriptAction#)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/EnableJavascriptAction#)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. | ||

## Public constructors

### EnableJavascriptAction

```
EnableJavascriptAction ()
```

<br />

<br />

## Public methods

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

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

-

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