Robotium+ant+android-junit-report

Source: Internet
Author: User

    1. Follow the steps in this link to automatically generate Ant's Build.xml files for an existing Robotium project: http://xiaomaozi.blog.51cto.com/925779/932284/

    2. Follow the steps in this link to import android-junit-report.jar items and manipulate them according to the links: http://www.xuebuyuan.com/2148574.html

    3. Http://www.tuicool.com/articles/Rzayie

      Add the following code to the Build.xml file:


< target name="Fetch-test-report">

< XPath input="${tested.project.dir}/ Androidmanifest.xml "

expression="/manifest/instrumentation/@android: Targetpackage" OUTPU T="Tested.package"/>

< Echo > Downloading XML test Report ... </ Echo >

          < Span style= "COLOR: #4e9192" >mkdir dir = "${reports.dir}" />

          < Span style= "COLOR: #4e9192" >exec executable = "${adb}" failonerror= "True" >

< arg line="${adb.device.arg}"/>

< Arg Value="Pull" />

< arg value="/data/data/${tested.package}/files/junit-r Eport.xml "/>

< arg value="${reports.dir}/junit-report.xml" />

</ exec >

</target>

"/manifest/instrumentation/@android: Targetpackage" It is important to note that the package that should point to the instrumentation in Androidmanifest.xml in the test project will be an error.

<instrumentation

android:name="Com.zutubi.android.junitreport.JUnitReportTestRunner"

android:targetpackage="com.example.example"/>

and add it to the Ant.property.

test.runner=Com.zutubi.android.junitreport.JUnitReportTestRunner



Robotium+ant+android-junit-report

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.