# WebAssertion

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

# WebAssertion

| 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


abstract
class
WebAssertion
`  
`

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


``


`

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

<br />

*** ** * ** ***

Similar to a[ViewAssertion](https://developer.android.com/reference/android/support/test/espresso/ViewAssertion), a[WebAssertion](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion)allows users to check the results of an atom evaluated against the provided[WebView](https://developer.android.com/reference/android/webkit/WebView.html).

## Summary

|                                                                                                                                     ### Public constructors                                                                                                                                     ||
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| ` `[WebAssertion](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion#WebAssertion(android.support.test.espresso.web.model.Atom<E>))`(`[Atom](https://developer.android.com/reference/android/support/test/espresso/web/model/Atom)`<E> atom) ` |

|                                                                                                                          ### Public methods                                                                                                                           ||
|---------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` final `[Atom](https://developer.android.com/reference/android/support/test/espresso/web/model/Atom)`<E>`    | ` `[getAtom](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion#getAtom())`() `                          |
| ` final `[ViewAssertion](https://developer.android.com/reference/android/support/test/espresso/ViewAssertion) | ` `[toViewAssertion](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion#toViewAssertion(E))`(E result) ` |

|                                                                                                                                                                 ### Protected methods                                                                                                                                                                  ||
|------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` abstract void` | ` `[checkResult](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion#checkResult(android.webkit.WebView, E))`(`[WebView](https://developer.android.com/reference/android/webkit/WebView.html)` view, E result) ` Extension point to validate a view and atom result on the main thread. |

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

## Public constructors

### WebAssertion

```
WebAssertion (Atom<E> atom)
```

<br />

<br />

|      Parameters       ||
|--------|---------------|
| `atom` | `Atom` <br /> |

## Public methods

### getAtom

```
Atom<E> getAtom ()
```

<br />

<br />

|                                                  Returns                                                  ||
|---------------------------------------------------------------------------------------------------|--------|
| [Atom](https://developer.android.com/reference/android/support/test/espresso/web/model/Atom)`<E>` | <br /> |

### toViewAssertion

```
ViewAssertion toViewAssertion (E result)
```

<br />

<br />

|      Parameters      ||
|----------|------------|
| `result` | `E` <br /> |

|                                                   Returns                                                    ||
|------------------------------------------------------------------------------------------------------|--------|
| [ViewAssertion](https://developer.android.com/reference/android/support/test/espresso/ViewAssertion) | <br /> |

## Protected methods

### checkResult

```
void checkResult (WebView view, 
                E result)
```

Extension point to validate a view and atom result on the main thread.

<br />

|                               Parameters                                ||
|----------|---------------------------------------------------------------|
| `view`   | `WebView`: the WebView that the Atom was evaluated on. <br /> |
| `result` | `E`: the result of atom evaluation. <br />                    |

-

  ## Interfaces

  - [WebViewAssertions.ResultDescriber](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions.ResultDescriber)
-

  ## Classes

  - [TagSoupDocumentParser](https://developer.android.com/reference/android/support/test/espresso/web/assertion/TagSoupDocumentParser)
  - [WebAssertion](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebAssertion)
  - [WebViewAssertions](https://developer.android.com/reference/android/support/test/espresso/web/assertion/WebViewAssertions)