介绍Robotium+Orange实现androidUI自动化测试

发表于:2014-1-27 11:57

字体: | 上一篇 | 下一篇 | 我要投稿

 作者:mylovemengyu    来源:51Testing软件测试网采编

  1.4  测试结果收集功能
  每次运行一个用例结束的时候,会把当前用例的运行结果加入到xml的节点中,所有用例运行结束后,xml文件会保存在PC端的指定位置下。
  收集到的测试结果样式如下:
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
<testsuite name="com.netease.mobile.autotest.testing.LoginTest">
<testcase classname="com.netease.mobile.autotest.testing.LoginTest" name="testUnLogin"
time="59.499"/>
</testsuite>
<testsuite name="com.netease.mobile.autotest.testing.SubscribeTest">
<testcase classname="com.netease.mobile.autotest.testing.SubscribeTest" name="testAdd2"
time="74.099">
<failure message="junit.framework.AssertionFailedError: Button with the text: 取消订阅 is not found!"
type="junit.framework.AssertionFailedError">junit.framework.AssertionFailedError:
Button with the text: 取消订阅 is not found!
at com.jayway.android.robotium.solo.Clicker.clickOn(Clicker.java:324)
at com.jayway.android.robotium.solo.Solo.clickOnButton(Solo.java:684)
at  com.netease.mobile.autotest.common.PrisOperation.addSubscribe(PrisOperation.java:91)
at com.netease.mobile.autotest.testing.SubscribeTest.testAdd2(SubscribeTest.java:126)</failure>
</testcase>
</testsuite>
</testsuites>
  1.5  测试报告生成功能
  首先会获取到收集的测试结果xml文件,然后解析xml同时加入一些css样式,生成html文件,邮件中发送的正文内容就是html文件内容。
  这里就是一个解析xml以及样式处理的过程。
33/3<123
《2023软件测试行业现状调查报告》独家发布~

关注51Testing

联系我们

快捷面板 站点地图 联系我们 广告服务 关于我们 站长统计 发展历程

法律顾问:上海兰迪律师事务所 项棋律师
版权所有 上海博为峰软件技术股份有限公司 Copyright©51testing.com 2003-2024
投诉及意见反馈:webmaster@51testing.com; 业务联系:service@51testing.com 021-64471599-8017

沪ICP备05003035号

沪公网安备 31010102002173号