10.Android uiautomator Junit Assertion function usage

Source: Internet
Author: User
<span id="Label3"></p>first, the Assertion function Introduction 1. assert function:<p><p>Determine if the method being tested works as expected</p></p> <ul> <ul> <li>For example:</li> </ul> </ul><pre><pre><span style="color: #0000ff;">if</span> <span style="color: #000000;">(assuming) { Pass test}</span><span style="color: #0000ff;">else</span><span style="color: #000000;">{ error and terminate current use case test}</span></pre></pre>2. Assert the function use case structure: <ul> <ul> <li>An assertion function is required for a complete test case</li> </ul> </ul><pre><pre>SetUp<span style="color: #008000;">//</span> <span style="color: #008000;">initialization</span> <span style="color: #008000;">//</span> <span style="color: #008000;">test case, JUNIT4 version can use multiple use case</span> <span style="color: #000000;">test to initialize scene and data test Simulation Operation Step Test Assertion Test recovery scenario tearDown</span><span style="color: #008000;">//</span> <span style="color: #008000;">Recycle initialization garbage</span></pre></pre>3. Assertion function Java error type: 1) error: <blockquote> <blockquote> <p>Generally refers to virtual machine-related problems, such as System crashes, virtual machine errors, Insufficient memory space, method call stack overflow and so On. Application outages caused by such errors are not recoverable and prevented by the program itself (assertion)</p> </blockquote> </blockquote>2) exeeption: <blockquote> <blockquote> <p>Represents an exception that a program can handle, which can be captured and possibly Recovered. If you encounter such an exception, you should handle the exception as much as possible so that the program resumes running and should not terminate the exception at will (most commonly, exceptions that the UI object cannot Find)</p> </blockquote> </blockquote>second, assert function api:1. assertion function classification:<p><p></p></p> <ul> <ul> <li>For example:</li> </ul> </ul><pre><pre><span style="color: #008000;">//</span> <span style="color: #008000;">assert that two objects are equal</span> <span style="color: #000000;">asserequals (String message,object expected,object actual) { </span><span style="color: #0000ff;">if</span> (expected==<span style="color: #0000ff;">null</span> & & actual==<span style="color: #0000ff;">null</span><span style="color: #000000;">) { </span><span style="color: #0000ff;">return</span> <span style="color: #000000;"> ; } </span> <span style="color: #0000ff;">if</span> (expected!=<span style="color: #0000ff;">null</span> &&<span style="color: #000000;"> expected.equals (actual)) { </span><span style="color: #0000ff;">return</span><span style="color: #000000;"> } failnotequals (message,expected,actual);}</span></pre></pre><p><p></p></p> <table style="width: 515px;" border="0" cellspacing="0" cellpadding="2"> <tbody> <tr> <td valign="top" width="200"><p align="center"><strong>Parameters</strong></p></td> <td valign="top" width="313"><p align="center"><strong>Description</strong></p></td> </tr> <tr> <td valign="top" width="200">Message</td> <td valign="top" width="313">Optional message, which is thrown after an assertion failure</td> </tr> <tr> <td valign="top" width="200">Expected</td> <td valign="top" width="313">The expected value</td> </tr> <tr> <td valign="top" width="200">Actual</td> <td valign="top" width="313">The actual value</td> </tr> </tbody> </table><p><p></p></p>2. Related api:1) <table style="width: 728px;" border="0" cellspacing="0" cellpadding="2"> <tbody> <tr> <td valign="top" width="250">Method</td> <td valign="top" width="476">Description</td> </tr> <tr> <td valign="top" width="250">Assertequals (boolean,boolean)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (string,boolean,boolean)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (byte,byte)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (string,byte,byte)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (char,char)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (string,char,char)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (int,int)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (string,int,int)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (long,long)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (string,long,long)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (object,object)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (string,object,object)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (short,short)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (string,short,short)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (string,string)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> <tr> <td valign="top" width="250">Assertequals (string,string,string)</td> <td valign="top" width="476">Pass if expected (expected) and actual (actual) are equal, otherwise fail</td> </tr> </tbody> </table><p><p></p></p> <ul> <ul> <li>API Example:</li> </ul> </ul><pre><pre><span style="color: #0000ff;"></span> public <span style="color: #0000ff;">void</span> <span style="color: #0000ff;">throws</span> <span style="color: #000000;">uiobjectnotfoundexception{ </span><span style="color: #008000;">//</span> <span style="color: #008000;">Assertion Equality Example</span> assertequals (5, add (2,3<span style="color: #000000;">)); </span> <span style="color: #008000;">//</span> Examples of assertions <span style="color: #008000;">that are not equal</span> Assertequals (6, Add (2,3<span style="color: #000000;">));}</span> <span style="color: #008000;">//</span> <span style="color: #008000;">Create a new addition easy to use assertion functions</span> <span style="color: #0000ff;"></span> public <span style="color: #0000ff;">int</span> Add (<span style="color: #0000ff;">int</span> a,<span style="color: #0000ff;">int</span> <span style="color: #000000;"> b) { </span><span style="color: #0000ff;">return</span> A +<span style="color: #000000;">b;}</span></pre></pre>2) <blockquote> <blockquote> <p> Floating-point arithmetic is not foolproof, so when comparing floating-point values, introduce the exact degree of </p> <p> Assertequals (double expected,double actual,double delta) </p> <!-- blockquote--> </blockquote> </blockquote> <table style="width: 777px;" border="0" cellspacing="0" cellpadding="2"> <tbody> <tr> <td valign="top" width="279">< P align= "center" > <strong> method </strong> <p></p> </td> <td valign="top" width="496"><p align="center"> <strong> description </strong> </p> </td> </tr> <tr> <td valign="top" width="279">assertequals (double,double,double) </td> <td valign="top" width="496" if expected (expected) and actual (actual) difference does not exceed the precision value (delta) is passed, otherwise fails < td> </td> </tr> <tr> <td valign="top" width="279">assertequals (string,double,double,double) </td> <td valign="top" width="496"> If the expected (expected) and actual (actual) difference does not exceed the precision value (delta), otherwise fails </td> </tr> <tr> <td valign="top" width="279">assertequals (float,float,float) </td> <td valign="top" width="496"> if desired ( Expected) and the actual (actual) difference does not exceed the precision value (delta), otherwise fails </td> </tr> <tr> <td valign="top" width="279">assertequals (String, Float,float,float) </td> <td valign="top" width="496"> If the expected (expected) and actual (actual) difference does not exceed the precision value (delta) is passed, otherwise fails </td> </tr> </tbody> </table><p><p></p></p> <ul> <ul> <li>API Example:</li> </ul> </ul><pre><span style="color: #0000ff;"><span style="color: #0000ff;"></span> public</span> <span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span>TestDemo1 ()<span style="color: #0000ff;"><span style="color: #0000ff;">throws</span></span><span style="color: #000000;"><span style="color: #000000;">uiobjectnotfoundexception{</span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">examples of assertions that are not equal</span></span>Assertequals (0.3333, double.valueof (1)/3,0<span style="color: #000000;"><span style="color: #000000;">); </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">examples of assertion equality</span></span>Assertequals (0.3333, double.valueof (1)/3,4<span style="color: #000000;"><span style="color: #000000;">); </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">examples of assertion equality</span></span>Assertequals (0.3333, double.valueof (1)/3,0.0001<span style="color: #000000;"><span style="color: #000000;">);}</span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">Create a new addition easy to use assertion functions</span></span><span style="color: #0000ff;"><span style="color: #0000ff;"></span> public</span> <span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span>Add<span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span>A<span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span><span style="color: #000000;"><span style="color: #000000;">B) { </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">return</span></span>A +<span style="color: #000000;"><span style="color: #000000;">b;}</span></span></pre>3) <table style="width: 877px;" border="0" cellspacing="0" cellpadding="2"> <tbody> <tr> <td valign="top" width="308"><p align="center"><strong>Method</strong></p></td> <td valign="top" width="567"><p align="center"><strong>Description</strong></p></td> </tr> <tr> <td valign="top" width="308">Assertfalse (boolean)</td> <td valign="top" width="567">Pass if condition (condition) is false, otherwise fail</td> </tr> <tr> <td valign="top" width="308">Assertfalse (string,boolean)</td> <td valign="top" width="567">Pass if condition (condition) is false, otherwise fail</td> </tr> <tr> <td valign="top" width="308">Asserttrue (boolran)</td> <td valign="top" width="567">Pass if condition (condition) is true, otherwise fail</td> </tr> <tr> <td valign="top" width="308">Asserttrue (string,boolran)</td> <td valign="top" width="567">Pass if condition (condition) is true, otherwise fail</td> </tr> <tr> <td valign="top" width="308">Assertnotnull (Object)</td> <td valign="top" width="567">Pass if the condition (condition) is non-empty, otherwise fail</td> </tr> <tr> <td valign="top" width="308">Assertnotnull (string,object)</td> <td valign="top" width="567">Pass if the condition (condition) is non-empty, otherwise fail</td> </tr> <tr> <td valign="top" width="308">Assertnull (Object)</td> <td valign="top" width="567">Pass if the condition (condition) is empty, otherwise fail</td> </tr> <tr> <td valign="top" width="308">Assertnull (string,object)</td> <td valign="top" width="567">Pass if the condition (condition) is empty, otherwise fail</td> </tr> <tr> <td valign="top" width="308">Assertnotsame (object,object)</td> <td valign="top" width="567">If expected (expected) and actual (actual) refer to different Memory object objects then pass, otherwise fail</td> </tr> <tr> <td valign="top" width="308">Assertnotesame (string,object,object)</td> <td valign="top" width="567">If expected (expected) and actual (actual) refer to different Memory object objects then pass, otherwise fail</td> </tr> <tr> <td valign="top" width="308">Assertsame (object,object)</td> <td valign="top" width="567">If expected (expected) and actual (actual) refer to the same Memory object object then pass, otherwise fail</td> </tr> <tr> <td valign="top" width="308">Assertsame (string,object,object)</td> <td valign="top" width="567">If expected (expected) and actual (actual) refer to the same Memory object object then pass, otherwise fail</td> </tr> </tbody> </table><p><p></p></p><p><p>API Example:</p></p><pre><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">Example One:</span></span><span style="color: #0000ff;"><span style="color: #0000ff;"></span> public</span> <span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span>TestDemo1 ()<span style="color: #0000ff;"><span style="color: #0000ff;">throws</span></span><span style="color: #000000;"><span style="color: #000000;">uiobjectnotfoundexception{</span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">declare a Boolean value yourself in order to test the use of the assertion function</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">Boolean</span></span>is=<span style="color: #0000ff;"><span style="color: #0000ff;">true</span></span><span style="color: #000000;"><span style="color: #000000;">; </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">examples of assertion success</span></span><span style="color: #000000;"><span style="color: #000000;">asserttrue (is);</span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">examples of assertion failures</span></span><span style="color: #000000;"><span style="color: #000000;">Assertfalse (is);} </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">Example Two:</span></span><span style="color: #0000ff;"><span style="color: #0000ff;"></span> public</span> <span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span>TestDemo1 ()<span style="color: #0000ff;"><span style="color: #0000ff;">throws</span></span><span style="color: #000000;"><span style="color: #000000;">uiobjectnotfoundexception{</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span>A = 100<span style="color: #000000;"><span style="color: #000000;">; </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">int</span></span>b = 100<span style="color: #000000;"><span style="color: #000000;">; Integer C</span></span>=<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>Integer (100<span style="color: #000000;"><span style="color: #000000;">); </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">example of a successful assertion, a comparison of values</span></span><span style="color: #000000;"><span style="color: #000000;">assertsame (a, b); </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">examples of assertion failures</span></span><span style="color: #000000;"><span style="color: #000000;">assertnotsame (a, b); </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">example of assertion failure, memory address comparison</span></span><span style="color: #000000;"><span style="color: #000000;">assertsame (a, c); </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">examples of assertion success</span></span><span style="color: #000000;"><span style="color: #000000;">assertsame ((Object) a, c);}</span></span></pre><p><p></p></p><p><p>4)</p></p> <table style="width: 623px;" border="0" cellspacing="0" cellpadding="2"> <tbody> <tr> <td valign="top" width="244"><p align="center"><strong>Method</strong></p></td> <td valign="top" width="377"><p align="center"><strong>Description</strong></p></td> </tr> <tr> <td valign="top" width="244">Fail ()</td> <td valign="top" width="377">Use case immediately fails</td> </tr> <tr> <td valign="top" width="244">Fail (String)</td> <td valign="top" width="377">The use case immediately fails with the specified message thrown</td> </tr> <tr> <td valign="top" width="244">Failnotequals (string,object,object)</td> <td valign="top" width="377">The use case immediately fails with a message that specifies that the message is not equal to the expected, actual value</td> </tr> <tr> <td valign="top" width="244">Failnotsame (string,string,string)</td> <td valign="top" width="377">The use case immediately fails with a message that specifies that the message is not equal to the expected, actual value</td> </tr> <tr> <td valign="top" width="244">Failsame (String)</td> <td valign="top" width="377">The use case immediately fails with the specified message thrown</td> </tr> </tbody> </table><p><p></p></p> <ul> <ul> <li>API Example:</li> </ul> </ul><pre><pre><span style="color: #0000ff;"></span> public <span style="color: #0000ff;">void</span> <span style="color: #0000ff;">throws</span> <span style="color: #000000;">uiobjectnotfoundexception{ uidevice.getinstance (). pressback (); Uidevice.getinstance (). Pressmenu (); Uidevice.getinstance (). presshome (); </span> <span style="color: #008000;">//</span> <span style="color: #008000;">use case failed with exception thrown</span> Fail ("Failed"<span style="color: #000000;">);}</span></pre></pre>Iii. demonstration of an instance using an assertion function<pre><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">Start</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">protected</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span>SetUp ()<span style="color: #0000ff;"><span style="color: #0000ff;">throws</span></span><span style="color: #000000;"><span style="color: #000000;">exception{</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">Super</span></span><span style="color: #000000;"><span style="color: #000000;">. SetUp ();}</span></span><span style="color: #0000ff;"><span style="color: #0000ff;"></span> public</span> <span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span>TestDemo1 ()<span style="color: #0000ff;"><span style="color: #0000ff;">throws</span></span><span style="color: #000000;"><span style="color: #000000;">uiobjectnotfoundexception{</span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">initializing a scene</span></span><span style="color: #000000;"><span style="color: #000000;">uidevice.getinstance (). Pressback (); Uidevice.getinstance (). Pressback (); Uidevice.getinstance (). Pressback (); Uidevice.getinstance (). presshome (); </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">Open File Management</span></span>UiObject app=<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>UiObject (<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>Uiselector (). Description ("apply"<span style="color: #000000;"><span style="color: #000000;">)); UiObject file</span></span>=<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>UiObject (<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>Uiselector (). Text ("file manager"<span style="color: #000000;"><span style="color: #000000;">)); App.clickandwaitfornewwindow (); File.clickandwaitfornewwindow (); </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">Verify Open Success</span></span>String packagename=<span style="color: #000000;"><span style="color: #000000;">uidevice.getinstance (). getcurrentpackagename (); Assertequals (</span></span>"File Open succes!", "com.cyanogenmod.filemanager"<span style="color: #000000;"><span style="color: #000000;">, packagename); </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">to check the directory named Test</span></span>UiObject test=<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>UiObject (<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>Uiselector (). Text ("test"<span style="color: #000000;"><span style="color: #000000;">)); Uiscrollable ListView</span></span>=<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>Uiscrollable (<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>Uiselector (). ClassName ("android.widget.ListView"<span style="color: #000000;"><span style="color: #000000;">)); </span></span><span style="color: #0000ff;"><span style="color: #0000ff;">Boolean</span></span>findresult=<span style="color: #000000;"><span style="color: #000000;">Listview.scrollintoview (test); </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">stop execution of the use case if there is a directory</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;">if</span></span>(findresult==<span style="color: #0000ff;"><span style="color: #0000ff;">true</span></span><span style="color: #000000;"><span style="color: #000000;">) {fail (</span></span>"test Directory already exists"<span style="color: #000000;"><span style="color: #000000;">); } </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">Create a new test directory if it does not have this directory</span></span>UiObject dos=<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>UiObject (<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>Uiselector (). Description ("action"<span style="color: #000000;"><span style="color: #000000;">)); Dos.clickandwaitfornewwindow (); UiObject NewFile</span></span>=<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>UiObject (<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>Uiselector (). Text ("new folder"<span style="color: #000000;"><span style="color: #000000;">)); Newfile.clickandwaitfornewwindow (); UiObject input</span></span>=<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>UiObject (<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>Uiselector (). ClassName ("android.widget.EditText"<span style="color: #000000;"><span style="color: #000000;">)); Input.settext (</span></span>"test"<span style="color: #000000;"><span style="color: #000000;">); UiObject OK</span></span>=<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>UiObject (<span style="color: #0000ff;"><span style="color: #0000ff;">New</span></span>Uiselector (). Text ("ok"<span style="color: #000000;"><span style="color: #000000;">)); Ok.click (); </span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">Verify new Success</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;">Boolean</span></span>Findresult2=<span style="color: #000000;"><span style="color: #000000;">Listview.scrollintoview (test); Asserttrue (</span></span>"test Directory Creation succeeded"<span style="color: #000000;"><span style="color: #000000;">, FindResult2);}</span></span><span style="color: #008000;"><span style="color: #008000;">//</span></span><span style="color: #008000;"><span style="color: #008000;">Complete</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">protected</span></span> <span style="color: #0000ff;"><span style="color: #0000ff;">void</span></span>TearDown ()<span style="color: #0000ff;"><span style="color: #0000ff;">throws</span></span><span style="color: #000000;"><span style="color: #000000;">exception{</span></span><span style="color: #0000ff;"><span style="color: #0000ff;">Super</span></span><span style="color: #000000;"><span style="color: #000000;">. TearDown (); Uidevice.getinstance (). Pressback (); Uidevice.getinstance (). Pressback (); Uidevice.getinstance (). Pressback (); Uidevice.getinstance (). presshome ();}</span></span></pre><p><p>10.Android uiautomator Junit Assertion function usage</p></p></span>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.