1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119<!DOCTYPE html> 120<html devsite> 121<head> 122 123 124 <meta name="top_category" value="develop" /> 125 126 <meta name="subcategory" value="reference" /> 127 128 129 <meta name="book_path" value="/reference/android/support/test/_book.yaml" /> 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145<title>FailureHandler</title> 146 147 148</head> 149 150<body class="gc-documentation develop reference api apilevel-"> 151<div id="doc-api-level" class="" style="display:none"></div> 152 153 154 155 156<div id="naMessage"></div> 157 158<div id="api-info-block"> 159<div class="api-level"> 160 161 162 163 164</div> 165 166 167 168 169<div class="sum-details-links"> 170 171Summary: 172 173 174 175 176 177 178 179 180 181 182 183 <a href="#pubmethods">Methods</a> 184 185 186 187 188| <a href="#" onclick="return toggleAllClassInherited()" id="toggleAllClassInherited">[Expand All]</a> 189 190</div><!-- end sum-details-links --> 191</div><!-- end api-info-block --> 192 193<div class="api apilevel-" id="jd-content"> 194 195<!-- ======== START OF CLASS DATA ======== --> 196 197<h1 class="api-title">FailureHandler</h1> 198<p> 199<code class="api-signature"> 200 public 201 202 203 204 interface 205 FailureHandler 206</code> 207<br> 208 209 210<code class="api-signature"> 211 212 213 214</code> 215 216</p><table class="jd-inheritance-table"> 217 218 219 <tr> 220 221 <td colspan="1" class="jd-inheritance-class-cell">android.support.test.espresso.FailureHandler 222 </td> 223 </tr> 224 225 226</table> 227 228 <table class="jd-sumtable jd-sumtable-subclasses"><tr><td colspan="2" style="border:none;margin:0;padding:0;"> 229 230 <a href="#" onclick="return toggleInherited(this, null)" id="subclasses-indirect" class="jd-expando-trigger closed" 231 ><img height="34" id="subclasses-indirect-trigger" 232 src="/assets/images/styles/disclosure_down.png" 233 class="jd-expando-trigger-img" /></a>Known Indirect Subclasses 234 235 <div id="subclasses-indirect"> 236 <div id="subclasses-indirect-list" 237 class="jd-inheritedlinks" 238 239 > 240 241 242 <a href="/reference/android/support/test/espresso/base/DefaultFailureHandler.html">DefaultFailureHandler</a> 243 244 245 </div> 246 <div id="subclasses-indirect-summary" 247 style="display: none;" 248 > 249 250 <table class="jd-sumtable-expando"> 251 252 <tr class="alt-color api apilevel-" > 253 <td class="jd-linkcol"><a href="/reference/android/support/test/espresso/base/DefaultFailureHandler.html">DefaultFailureHandler</a></td> 254 <td class="jd-descrcol" width="100%"> 255 Espresso's default <code><a href="/reference/android/support/test/espresso/FailureHandler.html">FailureHandler</a></code>. 256 257 258 259 </td> 260 </tr> 261 262 263 </table> 264 265 </div> 266 </div> 267 </td></tr></table> 268 269 270 271<br><hr> 272 273 274 <p>Handles failures that happen during test execution. 275</p> 276 277 278 279 280 281 282 283<h2 class="api-section">Summary</h2> 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311<!-- ========== METHOD SUMMARY =========== --> 312<table id="pubmethods" class="responsive methods"> 313<tr><th colspan="2"><h3>Public methods</h3></th></tr> 314 315 316 317 318 <tr class="api apilevel-" > 319 320 321 <td><code> 322 abstract 323 324 325 326 327 void</code> 328 </td> 329 330 <td width="100%"> 331 <code> 332 <a href="/reference/android/support/test/espresso/FailureHandler.html#handle(java.lang.Throwable, org.hamcrest.Matcher<android.view.View>)">handle</a>(Throwable error, Matcher<View> viewMatcher) 333 </code> 334 335 <p>Handle the given error in a manner that makes sense to the environment in which the test is 336 executed (e.g. 337 338 339</p> 340 341 </td> 342 </tr> 343 344 345 346</table> 347 348 349 350 351 352 353 354 355<!-- XML Attributes --> 356 357 358<!-- Enum Values --> 359 360 361<!-- Constants --> 362 363 364<!-- Fields --> 365 366 367<!-- Public ctors --> 368 369 370 371<!-- ========= CONSTRUCTOR DETAIL ======== --> 372<!-- Protected ctors --> 373 374 375 376<!-- ========= METHOD DETAIL ======== --> 377<!-- Public methdos --> 378 379<h2 class="api-section">Public methods</h2> 380 381 382 383<A NAME="handle(java.lang.Throwable, org.hamcrest.Matcher<android.view.View>)"></A> 384 385<div class="api apilevel-"> 386 <h3 class="api-name">handle</h3> 387 <div class="api-level"> 388 <div></div> 389 390 391 392 </div> 393<pre class="api-signature no-pretty-print"> 394void handle (Throwable error, 395 Matcher<View> viewMatcher)</pre> 396 397 398 399 400 <p>Handle the given error in a manner that makes sense to the environment in which the test is 401 executed (e.g. take a screenshot, output extra debug info, etc). Upon handling, most handlers 402 will choose to propagate the error. 403</p> 404 <table class="responsive"> 405 <tr><th colspan=2>Parameters</th></tr> 406 <tr> 407 <td><code>error</code></td> 408 <td width="100%"> 409 <code>Throwable</code> 410 <!-- no parameter comment --></td> 411 </tr> 412 <tr> 413 <td><code>viewMatcher</code></td> 414 <td width="100%"> 415 <code>Matcher</code> 416 <!-- no parameter comment --></td> 417 </tr> 418 </table> 419 420</div> 421 422 423 424 425 426<!-- ========= METHOD DETAIL ======== --> 427 428 429 430<!-- ========= END OF CLASS DATA ========= --> 431 432</div><!-- end jd-content --> 433 434 435 436<div class="data-reference-resources-wrapper"> 437 438 <ul data-reference-resources> 439 440 441 <li><h2>Interfaces</h2> 442 <ul> 443 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/BaseLayerComponent.html">BaseLayerComponent</a></li> 444 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/EspressoException.html">EspressoException</a></li> 445 <li class="selected api apilevel-"><a href="/reference/android/support/test/espresso/FailureHandler.html">FailureHandler</a></li> 446 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/IdlingResource.html">IdlingResource</a></li> 447 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/IdlingResource.ResourceCallback.html">IdlingResource.ResourceCallback</a></li> 448 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/UiController.html">UiController</a></li> 449 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/ViewAction.html">ViewAction</a></li> 450 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/ViewAssertion.html">ViewAssertion</a></li> 451 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/ViewFinder.html">ViewFinder</a></li> 452 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/ViewInteractionComponent.html">ViewInteractionComponent</a></li> 453 </ul> 454 </li> 455 456 <li><h2>Classes</h2> 457 <ul> 458 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/AmbiguousViewMatcherException.Builder.html">AmbiguousViewMatcherException.Builder</a></li> 459 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/DataInteraction.html">DataInteraction</a></li> 460 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/Espresso.html">Espresso</a></li> 461 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/GraphHolder.html">GraphHolder</a></li> 462 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/IdlingPolicies.html">IdlingPolicies</a></li> 463 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/IdlingPolicy.html">IdlingPolicy</a></li> 464 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/NoMatchingViewException.Builder.html">NoMatchingViewException.Builder</a></li> 465 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/PerformException.Builder.html">PerformException.Builder</a></li> 466 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/Root.html">Root</a></li> 467 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/Root.Builder.html">Root.Builder</a></li> 468 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/ViewInteraction.html">ViewInteraction</a></li> 469 </ul> 470 </li> 471 472 473 <li><h2>Exceptions</h2> 474 <ul> 475 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/AmbiguousViewMatcherException.html">AmbiguousViewMatcherException</a></li> 476 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/AppNotIdleException.html">AppNotIdleException</a></li> 477 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/IdlingResourceTimeoutException.html">IdlingResourceTimeoutException</a></li> 478 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/InjectEventSecurityException.html">InjectEventSecurityException</a></li> 479 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/NoActivityResumedException.html">NoActivityResumedException</a></li> 480 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/NoMatchingRootException.html">NoMatchingRootException</a></li> 481 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/NoMatchingViewException.html">NoMatchingViewException</a></li> 482 <li class="api apilevel-"><a href="/reference/android/support/test/espresso/PerformException.html">PerformException</a></li> 483 </ul> 484 </li> 485 486 </ul> 487 488</div> 489 490 491 492</body> 493</html> 494