page.title=UiAutomatorTestCase
parent.title=uiautomator
parent.link=index.html
@jd:body
<style>
    h4.jd-details-title {background-color: #DEE8F1;}
</style>
<h2>Class Overview</h2>
<p>UI automation tests should extend this class. This class provides access
 to the following:
<ul>
<li><code><a href="UiDevice.html">UiDevice</a></code> instance</li>
<li>Bundle for command line parameters</li>
</ul>
</p>





</div><!-- jd-descr -->
















<div class="jd-descr">


<h2>Summary</h2>























<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<table id="pubctors" class="jd-sumtable"><tr><th colspan="12">Public Constructors</th></tr>



	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="#UiAutomatorTestCase()">UiAutomatorTestCase</a></span>()
        
  </td></tr>



</table>






<!-- ========== METHOD SUMMARY =========== -->
<table id="pubmethods" class="jd-sumtable"><tr><th colspan="12">Public Methods</th></tr>



	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            <a href="IAutomationSupport.html">IAutomationSupport</a>
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="#getAutomationSupport()">getAutomationSupport</a></span>()
        
        <div class="jd-descrdiv">Provides support for running tests to report interim status</div>
  
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            Bundle
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="#getParams()">getParams</a></span>()
        
        <div class="jd-descrdiv">Get command line parameters.</div>
  
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            <a href="UiDevice.html">UiDevice</a>
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="#getUiDevice()">getUiDevice</a></span>()
        
        <div class="jd-descrdiv">Get current instance of <code><a href="UiDevice.html">UiDevice</a></code>.</div>
  
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad"><a href="#sleep(long)">sleep</a></span>(long ms)
        
        <div class="jd-descrdiv">Calls <code><a href="null#sleep(long)">sleep(long)</a></code> to sleep</div>
  
  </td></tr>



</table>







<!-- ========== METHOD SUMMARY =========== -->
<table id="inhmethods" class="jd-sumtable"><tr><th>
  <a href="#" class="toggle-all" onclick="return toggleAllInherited(this, null)">[Expand]</a>
  <div style="clear:left;">Inherited Methods</div></th></tr>


<tr class="api apilevel-" >
<td colspan="12">
  <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-junit.framework.TestCase" class="jd-expando-trigger closed"
          ><img id="inherited-methods-junit.framework.TestCase-trigger"
          src="../../../../../assets/images/triangle-closed.png"
          class="jd-expando-trigger-img" /></a>
From class

  junit.framework.TestCase

<div id="inherited-methods-junit.framework.TestCase">
  <div id="inherited-methods-junit.framework.TestCase-list"
        class="jd-inheritedlinks">
  </div>
  <div id="inherited-methods-junit.framework.TestCase-summary" style="display: none;">
    <table class="jd-sumtable-expando">
    


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            int
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">countTestCases</span>()
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            String
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">getName</span>()
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            TestResult
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">run</span>()
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">run</span>(TestResult arg0)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">runBare</span>()
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">setName</span>(String arg0)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            String
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">toString</span>()
        
  </td></tr>


</table>
  </div>
</div>
</td></tr>



<tr class="api apilevel-" >
<td colspan="12">
  <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-junit.framework.Assert" class="jd-expando-trigger closed"
          ><img id="inherited-methods-junit.framework.Assert-trigger"
          src="../../../../../assets/images/triangle-closed.png"
          class="jd-expando-trigger-img" /></a>
From class

  junit.framework.Assert

<div id="inherited-methods-junit.framework.Assert">
  <div id="inherited-methods-junit.framework.Assert-list"
        class="jd-inheritedlinks">
  </div>
  <div id="inherited-methods-junit.framework.Assert-summary" style="display: none;">
    <table class="jd-sumtable-expando">
    


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(short arg0, short arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(String arg0, int arg1, int arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(String arg0, short arg1, short arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(char arg0, char arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(String arg0, String arg1, String arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(int arg0, int arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(String arg0, double arg1, double arg2, double arg3)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(String arg0, long arg1, long arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(byte arg0, byte arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(Object arg0, Object arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(boolean arg0, boolean arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(String arg0, float arg1, float arg2, float arg3)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(String arg0, boolean arg1, boolean arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(String arg0, String arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(float arg0, float arg1, float arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(String arg0, byte arg1, byte arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(double arg0, double arg1, double arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(String arg0, char arg1, char arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(String arg0, Object arg1, Object arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertEquals</span>(long arg0, long arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertFalse</span>(String arg0, boolean arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertFalse</span>(boolean arg0)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertNotNull</span>(String arg0, Object arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertNotNull</span>(Object arg0)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertNotSame</span>(Object arg0, Object arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertNotSame</span>(String arg0, Object arg1, Object arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertNull</span>(Object arg0)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertNull</span>(String arg0, Object arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertSame</span>(Object arg0, Object arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertSame</span>(String arg0, Object arg1, Object arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertTrue</span>(String arg0, boolean arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">assertTrue</span>(boolean arg0)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">fail</span>(String arg0)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">fail</span>()
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">failNotEquals</span>(String arg0, Object arg1, Object arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">failNotSame</span>(String arg0, Object arg1, Object arg2)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">failSame</span>(String arg0)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            static
            
            String
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">format</span>(String arg0, Object arg1, Object arg2)
        
  </td></tr>


</table>
  </div>
</div>
</td></tr>



<tr class="api apilevel-" >
<td colspan="12">
  <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-java.lang.Object" class="jd-expando-trigger closed"
          ><img id="inherited-methods-java.lang.Object-trigger"
          src="../../../../../assets/images/triangle-closed.png"
          class="jd-expando-trigger-img" /></a>
From class

  java.lang.Object

<div id="inherited-methods-java.lang.Object">
  <div id="inherited-methods-java.lang.Object-list"
        class="jd-inheritedlinks">
  </div>
  <div id="inherited-methods-java.lang.Object-summary" style="display: none;">
    <table class="jd-sumtable-expando">
    


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            boolean
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">equals</span>(Object arg0)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            final
            
            
            Class&lt;?&gt;
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">getClass</span>()
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            int
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">hashCode</span>()
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            final
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">notify</span>()
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            final
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">notifyAll</span>()
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            
            
            
            String
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">toString</span>()
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            final
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">wait</span>()
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            final
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">wait</span>(long arg0, int arg1)
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            
            
            final
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">wait</span>(long arg0)
        
  </td></tr>


</table>
  </div>
</div>
</td></tr>



<tr class="api apilevel-" >
<td colspan="12">
  <a href="#" onclick="return toggleInherited(this, null)" id="inherited-methods-junit.framework.Test" class="jd-expando-trigger closed"
          ><img id="inherited-methods-junit.framework.Test-trigger"
          src="../../../../../assets/images/triangle-closed.png"
          class="jd-expando-trigger-img" /></a>
From interface

  junit.framework.Test

<div id="inherited-methods-junit.framework.Test">
  <div id="inherited-methods-junit.framework.Test-list"
        class="jd-inheritedlinks">
  </div>
  <div id="inherited-methods-junit.framework.Test-summary" style="display: none;">
    <table class="jd-sumtable-expando">
    


	 
    <tr class="api" >
        <td class="jd-typecol">
            abstract
            
            
            
            
            int
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">countTestCases</span>()
        
  </td></tr>


	 
    <tr class="api" >
        <td class="jd-typecol">
            abstract
            
            
            
            
            void
        </td>
        <td class="jd-linkcol" width="100%">
        <span class="sympad">run</span>(TestResult arg0)
        
  </td></tr>


</table>
  </div>
</div>
</td></tr>


</table>


</div><!-- jd-descr (summary) -->

<!-- Details -->








<!-- XML Attributes -->


<!-- Enum Values -->


<!-- Constants -->


<!-- Fields -->


<!-- Public ctors -->


<!-- ========= CONSTRUCTOR DETAIL ======== -->
<h2>Public Constructors</h2>



<a id="UiAutomatorTestCase()"></a>

<div class="jd-details api "> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
         
        
      </span>
      <span class="sympad">UiAutomatorTestCase</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p></p></div>

    </div>
</div>





<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- Protected ctors -->



<!-- ========= METHOD DETAIL ======== -->
<!-- Public methdos -->

<h2>Public Methods</h2>



<a id="getAutomationSupport()"></a>

<div class="jd-details api "> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
         
        <a href="IAutomationSupport.html">IAutomationSupport</a>
      </span>
      <span class="sympad">getAutomationSupport</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p>Provides support for running tests to report interim status</p></div>

    </div>
</div>


<a id="getParams()"></a>

<div class="jd-details api "> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
         
        Bundle
      </span>
      <span class="sympad">getParams</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p>Get command line parameters. On the command line when passing <code>-e key value</code>
 pairs, the Bundle will have the key value pairs conveniently available to the
 tests.
</p></div>

    </div>
</div>


<a id="getUiDevice()"></a>

<div class="jd-details api "> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
         
        <a href="UiDevice.html">UiDevice</a>
      </span>
      <span class="sympad">getUiDevice</span>
      <span class="normal">()</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p>Get current instance of <code><a href="UiDevice.html">UiDevice</a></code>. Works similar to calling the static
 <code><a href="UiDevice.html#getInstance()">getInstance()</a></code> from anywhere in the test classes.
</p></div>

    </div>
</div>


<a id="sleep(long)"></a>

<div class="jd-details api "> 
    <h4 class="jd-details-title">
      <span class="normal">
        public 
         
         
         
         
        void
      </span>
      <span class="sympad">sleep</span>
      <span class="normal">(long ms)</span>
    </h4>
      <div class="api-level">
        <div>

</div>
        
  

      </div>
    <div class="jd-details-descr">
      
  <div class="jd-tagdata jd-tagdescr"><p>Calls <code><a href="null#sleep(long)">sleep(long)</a></code> to sleep</p></div>
  <div class="jd-tagdata">
      <h5 class="jd-tagtitle">Parameters</h5>
      <table class="jd-tagtable">
        <tr>
          <th>ms</th>
          <td>is in milliseconds.
</td>
        </tr>
      </table>
  </div>

    </div>
</div>

