WO2014015572A1 - 一种Android自动测试跨应用的装置及方法 - Google Patents

一种Android自动测试跨应用的装置及方法 Download PDF

Info

Publication number
WO2014015572A1
WO2014015572A1 PCT/CN2012/083954 CN2012083954W WO2014015572A1 WO 2014015572 A1 WO2014015572 A1 WO 2014015572A1 CN 2012083954 W CN2012083954 W CN 2012083954W WO 2014015572 A1 WO2014015572 A1 WO 2014015572A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
application
unit
secondary application
main
Prior art date
Application number
PCT/CN2012/083954
Other languages
English (en)
French (fr)
Inventor
吴瑾
赵慧
丁玮
Original Assignee
北京播思无线技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 北京播思无线技术有限公司 filed Critical 北京播思无线技术有限公司
Publication of WO2014015572A1 publication Critical patent/WO2014015572A1/zh
Priority to US14/325,101 priority Critical patent/US9396096B2/en

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3676Test management for coverage analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Definitions

  • the present invention relates to an apparatus and method for testing an application, and more particularly to an apparatus and method for automatically testing a cross-application by Android.
  • Android is a Linux-based open source operating system, mainly used in portable devices.
  • Instrumentation is a testing framework with no startup capability and is used to monitor other devices.
  • An automated test tool for the application under test. Mainly through the command line (adb Shell) to start a set of tests and give the results in the form of a command line.
  • Instrumentation via command line (adb Shell) to start the test, if the tested application has been started, kill the application under test, and then restart the application under test, the Instrumentation will make it in the same process as the test program, thus achieving operation and monitoring. Test the purpose of the application.
  • test application can precisely control the application
  • the secondary application is tested in the test main application test
  • the secondary application is started in another process and is not in the same process as the main application, so that the Instrumentation object cannot operate or monitor the secondary application. That is, cross-application testing is not supported.
  • the object of the present invention is to provide an apparatus and method for automatically testing cross-applications of Android, and realizing cross-application automatic testing and interactive complex test scenarios based on the Instrumentation framework on the Android platform. Trigger multiple applications from the tested main application to achieve interactive switching between multiple applications.
  • an Android automatic test cross-application device including a main application test unit, a trigger monitor unit, a secondary application test control unit, a secondary application test unit, and a secondary application test result record. a unit, a library file storage unit, a main application test check unit, a test result processing unit, and a test result output unit, wherein
  • the main application test unit is configured to test the main application, collect test results of the main application, and trigger the launch of the secondary application during the test;
  • the triggering listening unit is configured to monitor trigger activation of a secondary application in a main application testing process
  • the secondary application test control unit is configured to control a test process of the secondary application
  • the secondary application testing unit is configured to test the secondary application, the next-level application, and collect the test result of the application
  • the secondary application test result recording unit is configured to record a test result of saving the secondary application or the next-level application
  • the library file storage unit for storing a method library of an open innovation layer of a test manager enhancement framework across applications
  • the main application test checking unit is configured to check test results recorded by the secondary application or the next-level application;
  • the test result processing unit is configured to process test results of the main application
  • the test result output unit is configured to output a test result of the main application collected by the main application test unit into a test report for output.
  • the secondary application test control unit controls the secondary application test unit to test the secondary application when the trigger monitoring unit monitors that there is a secondary application triggering startup in the main application testing process.
  • the cross-application test manager enhances the framework of the open innovation layer of the framework, and provides an interface for the test manager to enhance the development layer of the framework, and implements a trigger listening unit, a secondary application test control unit, and a secondary application test unit.
  • the function of the secondary application test result recording unit is not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to, but not limited to enhance the framework, and provides an interface for the test manager to enhance the development layer of the framework, and implements a trigger listening unit, a secondary application test control unit, and a secondary application test unit.
  • the function of the secondary application test result recording unit is not limited to be used to enhance the development layer of the framework.
  • the present invention provides a method for Android to automatically test cross-applications, including the following steps:
  • the step 1) is to start the test manager through the command line to enhance the process of opening the innovation layer of the framework, and monitor the startup of the secondary application in the main application test process.
  • step 2) tests the secondary application, and further includes the following steps:
  • the secondary application is injected into the open innovation layer of the test manager enhancement framework, and the test manager enhances the open innovation layer of the framework to track the whole state of the secondary application;
  • Start the thread enhancement framework test manager obtain the activity object of the secondary application and the test manager enhance the test environment of the open innovation layer of the framework, and collect the test results of the secondary application;
  • test application enhancement framework of the secondary application is passed to the test case of the secondary application
  • the test of the secondary application is completed, and the test result of the next application is recorded, and the test of the main application is continued.
  • step 2) the test result of the secondary application is collected and processed, including the following steps:
  • test result of the secondary application is not generated within the specified time, the test of the main application ends, the output test result is timeout, and the test of the main application ends;
  • test result of the secondary application is failed within the specified time, the test of the main application is ended.
  • the invention is directed to the startup mechanism of the activity window of the Android platform and the binding relationship between the activity window and the instrumentation.
  • the TrefoilInstrumentation framework monitors the real-time state of the tested application, and intercepts the active window of the current application when the tested application starts.
  • (Activity) object Realize the automatic operation of the tested application interface, and at the same time, pass the activity object (Activity) object managed by TrefoilInstrumentation to the test case (Test Case) object, and the entire operation process is packaged in the test suite (Test Suite), by the test management platform (Test Runner) unified control, realizes cross-application automatic testing and interactive complex test scenarios based on the Instrumentation framework on the Android platform.
  • FIG. 1 is a block diagram showing the principle of an Android automatic test cross-application according to the present invention.
  • FIG. 2 is a flow chart of a method for automatically testing cross-applications in Android according to the present invention
  • FIG. 3 is a flow chart of a secondary application test in accordance with the present invention.
  • the Android automatic test cross-application device of the present invention includes a main application test unit 101, a trigger monitoring unit 102, and a secondary application.
  • the main application testing unit 101 starts the Instrumentation process through the command line, tests the main application, collects the test result of the main application, and triggers the launch of the secondary application during the testing process;
  • the triggering listening unit 102 is configured to monitor the triggering start of the secondary application in the main application testing process by the main application testing unit 101, and send the triggering startup information to the secondary application testing control unit 103; meanwhile, the monitoring unit 102 is triggered. It is also possible to monitor the trigger start of the next level application in the test process of the secondary application test unit 104, and send the startup information to the secondary application test control unit 103;
  • the secondary application test control unit 103 receives the trigger activation information sent by the trigger monitoring unit 102, and controls the application test process of the secondary application testing unit 104;
  • the secondary application testing unit 104 receives the control of the secondary application testing control unit 103, tests the secondary application, the next-level application, and passes the collected application's test result to the secondary application test result recording unit 105. Record keeping;
  • the main application test checking unit 107 is configured to check whether the sub-application test result recording unit 105 generates a test result of the sub-application, and submit the test result to the test result processing unit 108,
  • the test result processing unit 108 is configured to process the test result submitted by the secondary application test check unit 107; the test program of the main application periodically checks whether the test result of the application is generated within a specified timeout period, if the test of the secondary application If the result is generated within the specified timeout period, the test of the main application continues. If the test result of the secondary application is not generated within the specified time, the test of the main application ends, the current test case fails to execute, and the result is timeout.
  • the test result output unit 109 is configured to output a test result of the main application collected by the main application test unit 101 into a test report for output.
  • FIG. 2 is a flow chart of a method for automatically testing cross-applications of Android according to the present invention. The method for automatically testing cross-applications of Android according to the present invention will be described in detail below with reference to FIG. 2 .
  • step 201 the command line starts the TrefoilInstrumentation test command of the test secondary application, starts the TrefoilInstrumentation process, and monitors the startup of the secondary application;
  • step 202 the command line starts an Instrumentation test command for testing the main application, starts the test of the main application, and triggers the secondary application during the test;
  • step 203 the triggering listening unit 102 monitors that the secondary application is triggered during the main application testing process, and the secondary application testing control unit 103 controls the secondary application testing unit 104 to start, tests the secondary application, and collects the application.
  • the test result is saved to the secondary application test result recording unit 105;
  • step 204 the main application test checking unit 107, periodically checks whether the test result of the secondary application is generated within a specified timeout period, and transmits the test result to the test result processing unit 108;
  • step 205 the test result processing unit 108 determines whether to generate a test result of the secondary application, if the test result of the secondary application is generated, proceed to the next step, if the test result of the secondary application is not generated, then go to step 207;
  • step 206 the test result processing unit 108 determines whether the test result is successful or not. If the test result is successful, then go to step 209, otherwise go to the next step;
  • step 207 the main application test checking unit 107 does not check the generation of the secondary application test result within the specified timeout period, then the test result processing unit 108 outputs the test result as a timeout, proceeds to step 210;
  • step 208 the main application test checking unit 107 checks that the test result of the secondary application is a failure, then the test result processing unit 108 outputs the test result as a failure, proceeds to step 210;
  • the test result processing unit 108 notifies the main application test unit 101 to continue the test of the main application;
  • step 210 the main application test ends, and the test result output unit 109 outputs a corresponding test report.
  • FIG. 3 is a flow chart of a secondary application test according to the present invention.
  • the secondary application test flow of the present invention will be described in detail below with reference to FIG. 3.
  • the triggering listening unit 102 listens to trigger the secondary application during the main application testing process, the secondary application testing control unit controls the secondary application testing unit to start, and the secondary application is injected into the TrefoilInstrumentation (enhanced framework testing device) Method library), thereby implementing TrefoilInstrumentation to track the whole state of the secondary application;
  • the TrefoilInstrumentation enhanced framework testing device
  • step 302 the thread TrefoilTestRunner (the test manager of the enhanced framework) is started, the activity object of the secondary application and the test environment of the TrefoilIstrumentation are obtained, and the test result of the secondary application is collected and sent to the secondary application test checking unit 106;
  • a TrefoilBaseTestRunner (Enhanced Framework Basic Test Manager) object is created to run the test case of the secondary application
  • the TrefoilIstrumentation test environment of the secondary application is passed to the test case of the secondary application;
  • step 305 the test of the secondary application is completed, and the test result of the next application is recorded, and the test of the main application is continued.
  • the Android automatic test cross-application device and method of the present invention can test across multiple applications, that is, the secondary application can trigger the launch of the next-level application, and then the TrefoilInstrumentation process is used to start the test process of the next-level application, in turn. Recursive.
  • test scenario it is necessary to receive a phone number from the short message, save the number to the address book, and dial the number from the address book.
  • This test scenario involves three applications: short message, address book, and telephone.
  • the TrefoilInstrumentation process of the phone and address book is started. After startup, the two applications are injected into their respective TrefoilInstrumentation, and the status of the two applications is monitored by TrefoilInstrumentation.
  • the TrefoilInstrumentation process of the address book monitors that the address book application is triggered, and immediately starts the test program of the address book application, and the test process of the SMS application enters the waiting state.
  • the test timeout fails until the test process of the address book application returns the test result, or the test result of the address book application is not generated within the specified timeout period.
  • the TefoilInstrumentation process of the phone application is triggered during the test of the address book. The test program for the phone application will be launched.
  • test process of the address book and the phone application When the test process of the address book and the phone application generates test results, the test process of the SMS application stops waiting, and the test step continues until all test steps are completed.

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

一种Android自动测试跨应用的装置及方法,包括,主应用程序测试单元、触发监听单元、次应用程序测试控制单元、次应用程序测试单元、次应用程序测试结果记录单元、库文件存储单元、主应用程序测试检查单元、测试结果处理单元,以及测试结果输出单元,在对应用程序进行测试时,首先,监听主应用程序测试过程中次应用程序的启动;对次应用程序进行测试,收集次应用程序的测试结果并进行处理;如果次应用程序的测试成功,继续主应用程序的测试;重复上述步骤,直至主应用程序测试结束。如果次应用程序的测试超时或失败,结束主应用程序的测试。本发明的装置及方法,实现了Android平台上基于Instrumentation框架的跨应用自动测试和交互复杂的测试场景,从被测主应用触发多个别的应用,实现在多个应用之间交互切换。

Description

一种Android自动测试跨应用的装置及方法 技术领域
本发明涉及一种测试应用程序的装置及方法,尤其涉及一种Android自动测试跨应用的装置及方法。
背景技术
Android是一种以Linux为基础的开放源代码操作系统,主要使用于便携设备中,目前Android中有一种叫Instrumentation的测试框架,它是一种没有图形界面,具有启动能力的,用于监控其它被测应用的自动测试工具。其主要通过命令行(adb shell)来启动一组测试,并且通过命令行的形式给出结果。其主要原理:当应用程序运行的时候Instrumentation处于开启,Instrumentation将在任何应用程序运行前初始化,可以通过它监测系统与应用程序之间的交互。Instrumentation通过命令行(adb shell)来启动测试,如果被测应用程序已启动存在,则先杀掉该被测应用,然后重新启动被测应用,Instrumentation会使其与测试程序在同一个进程中,从而达到操作和监控被测应用程序的目的。
虽然在Instrumentation框架下,测试应用程序可以精确控制应用程序, 但是,当被测主应用程序测试中调起次应用程序时,次应用程序启动后在另外一个进程中,与主应用程序不在同一个进程中,从而Instrumentation对象就不能操作或监控次应用程序,即不支持跨应用测试。
技术问题
为了解决现有技术存在的不足,本发明的目的在于提供一种Android自动测试跨应用的装置及方法,实现Android平台上基于Instrumentation框架的跨应用自动测试和交互复杂的测试场景。从被测主应用触发多个次应用,实现在多个应用之间交互切换。
技术解决方案
为实现上述目的,本发明提供的一种Android自动测试跨应用的装置,包括,主应用程序测试单元、触发监听单元、次应用程序测试控制单元、次应用程序测试单元、次应用程序测试结果记录单元、库文件存储单元、主应用程序测试检查单元、测试结果处理单元,以及测试结果输出单元,其中,
所述主应用程序测试单元,其用于对主应用程序进行测试、收集主应用程序的测试结果,并在测试过程中触发启动次应用程序;
所述触发监听单元,其用于监听主应用程序测试进程中次应用程序的触发启动;
所述次应用程序测试控制单元,其用于控制次应用程序的测试进程;
所述次应用程序测试单元,用于对次应用程序、下一级应用程序进行测试,并收集应用程序的测试结果;
所述次应用程序测试结果记录单元,其用于记录保存次应用程序或下一级应用程序的测试结果;
所述库文件存储单元,其用于存储跨应用的测试管理器增强框架开放创新层的方法库;
所述主应用程序测试检查单元,其用于检查次应用程序或下一级应用程序记录下的测试结果;
所述测试结果处理单元,用于对主应用程序的测试结果进行处理;
所述测试结果输出单元,其用于将所述主应用程序测试单元收集的主应用程序的测试结果形成测试报告进行输出。
其中,所述次应用程序测试控制单元,当所述触发监听单元监听到在主应用程序测试进程中有次应用程序触发启动时,控制所述次应用程序测试单元对次应用程序进行测试。
其中,所述跨应用的测试管理器增强框架开放创新层的方法库,对外提供测试管理器增强框架开发创新层的接口,实现触发监听单元、次应用程序测试控制单元、次应用程序测试单元以及次应用程序测试结果记录单元的功能。
为实现上述目的,本发明提供一种Android自动测试跨应用的方法,包括以下步骤:
1)监听主应用程序测试过程中次应用程序的启动;
2)对次应用程序进行测试,收集次应用程序的测试结果并进行处理;
3)如果次应用程序的测试成功,继续主应用程序的测试;
4)重复上述步骤,直至主应用程序测试结束;
5)如果次应用程序的测试超时或失败,结束主应用程序的测试。
其中,所述步骤1)是通过命令行启动测试管理器增强框架开放创新层的进程,监听主应用程序测试过程中次应用程序的启动。
其中,所述步骤2)中对次应用程序进行测试,进一步包括以下步骤:
次应用程序被注入至测试管理器增强框架开放创新层,实现测试管理器增强框架开放创新层对次应用程序的全程状态跟踪;
启动线程增强框架测试管理器,获取次应用的Activity对象及测试管理器增强框架开放创新层的测试环境,并收集次应用的测试结果;
创建增强框架的基础测试管理器对象,运行次应用的测试用例;
在增强框架测试用例中,将次应用的测试管理器增强框架开放创新层测试环境传递至次应用的测试用例;
次应用的测试完成,并记录下次应用的测试结果,继续主应用程序的测试。
其中,所述步骤2)中收集次应用程序的测试结果并进行处理,包括以下步骤:
如果在规定时间内,次应用程序的测试结果未生成,则主应用程序的测试结束,输出测试结果为超时,结束主应用程序的测试;
如果在规定时间内,次应用程序的测试结果为失败,结束主应用程序的测试。
本发明针对Android平台活动窗口(Activity)的启动机制以及活动窗口(Activity)、Instrumentation的绑定关系,由TrefoilInstrumentation框架监听被测应用的实时状态,当被测应用启动时,截获当前应用的活动窗口(Activity)对象, 实现对被测应用界面的自动化操作,同时,将TrefoilInstrumentation管理的活动窗口(Activity)对象传入测试用例(Test Case)对象,并将整个操作流程封装在测试套件(Test Suite)中,由测试管理平台(Test Runner)统一控制,实现Android平台上基于Instrumentation框架的跨应用自动测试和交互复杂的测试场景。
本发明的其它特征和优点将在随后的说明书中阐述,并且,部分地从说明书中变得显而易见,或者通过实施本发明而了解。
附图说明
附图用来提供对本发明的进一步理解,并且构成说明书的一部分,并与本发明的实施例一起,用于解释本发明,并不构成对本发明的限制。在附图中:
图1为根据本发明的Android自动测试跨应用的装置原理框图;
图2为根据本发明的Android自动测试跨应用的方法流程图;
图3为根据本发明的次应用测试流程图。
本发明的实施方式
以下结合附图对本发明的优选实施例进行说明,应当理解,此处所描述的优选实施例仅用于说明和解释本发明,并不用于限定本发明。
图1为根据本发明的Android自动测试跨应用的装置原理框图,如图1所示,本发明的Android自动测试跨应用的装置,包括,主应用程序测试单元101、触发监听单元102、次应用程序测试控制单元103、次应用程序测试单元104、次应用程序测试结果记录单元105、库文件存储单元106、主应用程序测试检查单元107、测试结果处理单元108,以及测试结果输出单元109,其中,
主应用程序测试单元101,其通过命令行启动Instrumentation进程,对主应用程序进行测试,收集主应用程序的测试结果,并在测试过程中触发启动次应用程序;
触发监听单元102,其用于监听主应用程序测试单元101在主应用程序测试进程中次应用程序的触发启动,并将触发启动信息发送给次应用程序测试控制单元103;同时,触发监听单元102也可以监听次应用程序测试单元104的测试进程中下一级应用程序的触发启动,并将启动信息发送给次应用程序测试控制单元103;
次应用程序测试控制单元103,接收触发监听单元102发送的触发启动信息,并控制次应用程序测试单元104的应用程序测试进程;
次应用程序测试单元104,其接受次应用程序测试控制单元103的控制,对次应用程序、下一级应用程序进行测试,并将收集的应用程序的测试结果通过次应用程序测试结果记录单元105记录保存;
库文件存储单元106,其用于存储跨应用的trefoil.jar库文件,trefoil.jar(TestRunner Enhancement Framework Open Innovative Layout)库文件(测试管理器增强框架开放创新层的方法库),该库文件对外提供测试管理器增强框架开发创新层的接口,实现触发监听单元102、次应用程序测试控制单元103、次应用程序测试单元104以及次应用程序测试结果记录单元105的功能;
主应用程序测试检查单元107,其用于检查次应用程序测试结果记录单元105是否生成次应用的测试结果,并将测试结果提交给测试结果处理单元108,
测试结果处理单元108,用于对次应用程序测试检查单元107提交的测试结果进行处理;主应用的测试程序在规定的超时时间内,定期去检查是否生成应用的测试结果,如果次应用的测试结果在规定的超时时间内已生成,则主应用的测试继续进行,如果在规定时间内,次应用的测试结果未生成,则主应用的测试结束,当前测试用例执行失败,结果为超时;
测试结果输出单元109,其用于将主应用程序测试单元101收集的主应用程序的测试结果形成测试报告进行输出。
图2为根据本发明的Android自动测试跨应用的方法流程图,下面将参考图2,对本发明的Android自动测试跨应用的方法进行详细描述。
首先,在步骤201,命令行启动测试次应用程序的TrefoilInstrumentation测试命令,启动TrefoilInstrumentation进程,监听次应用程序的启动;
在步骤202,命令行启动测试主应用程序的Instrumentation测试命令,启动主应用程序的测试,并在测试过程中触发次应用程序;
在步骤203,触发监听单元102监听到主应用程序测试过程中触发次应用程序,次应用程序测试控制单元103控制次应用程序测试单元104启动,对次应用程序进行测试,将收集的应用程序的测试结果,保存到次应用程序测试结果记录单元105;
在步骤204,主应用程序测试检查单元107,在规定的超时时间内,定期去检查是否生成次应用程序的测试结果,并将检查结果传送给测试结果处理单元108;
在步骤205,测试结果处理单元108判断是否生成次应用程序的测试结果,如果生成次应用程序的测试结果,则进行下一步骤,如果没有生成次应用程序的测试结果,则转到步骤207;
在步骤206,测试结果处理单元108对测试结果进行成功与否的判断,如果测试结果为成功,则转到步骤209,否则进入下一步骤;
在步骤207,主应用程序测试检查单元107在规定的超时时间内没有检查到次应用程序测试结果的生成,则测试结果处理单元108输出测试结果为超时,进入步骤210;
在步骤208,主应用程序测试检查单元107检查到次应用程序的测试结果为失败,则测试结果处理单元108输出测试结果为失败,进入步骤210;
在步骤209,测试结果处理单元108通知主应用程序测试单元101继续主应用程序的测试;
在步骤210,主应用程序测试结束,测试结果输出单元109输出相应的测试报告。
图3为根据本发明的次应用测试流程图,下面将参考图3,对本发明的次应用测试流程进行详细描述。
首先,在步骤301,触发监听单元102监听到主应用程序测试过程中触发次应用程序,次应用程序测试控制单元控制次应用程序测试单元启动,次应用程序被注入至TrefoilInstrumentation(增强框架的测试设备方法库),从而实现TrefoilInstrumentation对次应用程序的全程状态跟踪;
在步骤302,启动线程TrefoilTestRunner(增强框架的测试管理器),获取次应用的Activity对象及TrefoilIstrumentation的测试环境,收集次应用的测试结果发送给次应用程序测试检查单元106;
在步骤303,创建TrefoilBaseTestRunner(增强框架的基础测试管理器)对象,运行次应用的测试用例;
在步骤304,在TrefoilTestCase(增强框架的测试用例)中,将次应用的TrefoilIstrumentation测试环境传递至次应用的测试用例;
在步骤305,次应用的测试完成,并记录下次应用的测试结果,继续主应用程序的测试。
采用本发明的Android自动测试跨应用的装置及方法,可以跨多应用测试,即次应用程序可以触发启动下一级应用程序,再通过TrefoilInstrumentation进程来启动下一级应用程序的测试全过程,依次递推。
例如测试场景中需要实现从短信中收到一条电话号码,保存该号码至通讯录,并从通讯录拨打该号码,这个测试场景一共涉及了三个应用:短信、通讯录、电话。
启动电话和通讯录的TrefoilInstrumentation进程,启动之后这两个应用被注入到各自的TrefoilInstrumentation中,由TrefoilInstrumentation监听这两个应用的状态。
启动短信应用的测试程序,在测试过程中触发启动通讯录应用,通讯录的TrefoilInstrumentation进程监听到通讯录应用被触发,立即启动通讯录应用的测试程序,此时短信应用的测试进程进入等待状态,直至通讯录应用的测试进程返回测试结果,或者通讯录应用的测试结果在规定超时时间内未生成,则测试超时失败;同理,通讯录的测试过程中触发启动电话应用,电话应用的TrefoilInstrumentation进程将启动电话应用的测试程序。
当通讯录和电话应用的测试进程生成测试结果,短信应用的测试进程停止等待,测试步骤继续执行,直至全部测试步骤结束。
本领域普通技术人员可以理解:以上所述仅为本发明的优选实施例而已,并不用于限制本发明,尽管参照前述实施例对本发明进行了详细的说明,对于本领域的技术人员来说,其依然可以对前述各实施例记载的技术方案进行修改,或者对其中部分技术特征进行等同替换。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。

Claims (7)

  1. 一种Android自动测试跨应用的装置,包括,主应用程序测试单元、触发监听单元、次应用程序测试控制单元、次应用程序测试单元、次应用程序测试结果记录单元、库文件存储单元、主应用程序测试检查单元、测试结果处理单元,以及测试结果输出单元,其特征在于,
    所述主应用程序测试单元,其用于对主应用程序进行测试、收集主应用程序的测试结果,并在测试过程中触发启动次应用程序;
    所述触发监听单元,其用于监听主应用程序测试进程中次应用程序的触发启动;
    所述次应用程序测试控制单元,其用于控制次应用程序的测试进程;
    所述次应用程序测试单元,用于对次应用程序、下一级应用程序进行测试,并收集应用程序的测试结果;
    所述次应用程序测试结果记录单元,其用于记录保存次应用程序或下一级应用程序的测试结果;
    所述库文件存储单元,其用于存储跨应用的测试管理器增强框架开放创新层的方法库;
    所述主应用程序测试检查单元,其用于检查次应用程序或下一级应用程序记录下的测试结果;
    所述测试结果处理单元,用于对主应用程序的测试结果进行处理;
    所述测试结果输出单元,其用于将所述主应用程序测试单元收集的主应用程序的测试结果形成测试报告进行输出。
  2. 根据权利要求1所述的Android自动测试跨应用的装置,其特征在于,所述次应用程序测试控制单元,当所述触发监听单元监听到在主应用程序测试进程中有次应用程序触发启动时,控制所述次应用程序测试单元对次应用程序进行测试。
  3. 根据权利要求1所述的Android自动测试跨应用的装置,其特征在于,所述跨应用的测试管理器增强框架开放创新层的方法库,对外提供测试管理器增强框架开发创新层的接口,实现触发监听单元、次应用程序测试控制单元、次应用程序测试单元以及次应用程序测试结果记录单元的功能。
  4. 一种实现Android自动测试跨应用的方法,包括以下步骤:
    1)监听主应用程序测试过程中次应用程序的启动;
    2)对次应用程序进行测试,收集次应用程序的测试结果并进行处理;
    3)如果次应用程序的测试成功,继续主应用程序的测试;
    4)重复上述步骤,直至主应用程序测试结束;
    5)如果次应用程序的测试超时或失败,结束主应用程序的测试。
  5. 据权利要求4所述的实现Android自动测试跨应用的方法,其特征在于,所述步骤1)是通过命令行启动测试管理器增强框架开放创新层的进程,监听主应用程序测试过程中次应用程序的启动。
  6. 根据权利要求4所述的实现Android自动测试跨应用的方法,其特征在于,所述步骤2)中对次应用程序进行测试,进一步包括以下步骤:
    次应用程序被注入至测试管理器增强框架开放创新层,实现测试管理器增强框架开放创新层对次应用程序的全程状态跟踪;
    启动线程增强框架测试管理器,获取次应用的Activity对象及测试管理器增强框架开放创新层的测试环境,并收集次应用的测试结果;
    创建增强框架的基础测试管理器对象,运行次应用的测试用例;
    在增强框架测试用例中,将次应用的测试管理器增强框架开放创新层测试环境传递至次应用的测试用例;
    次应用的测试完成,并记录下次应用的测试结果,继续主应用程序的测试。
  7. 根据权利要求4所述的实现Android自动测试跨应用的方法,其特征在于,所述步骤2)中收集次应用程序的测试结果并进行处理,包括以下步骤:
    如果在规定时间内,次应用程序的测试结果未生成,则主应用程序的测试结束,输出测试结果为超时,结束主应用程序的测试;
    如果在规定时间内,次应用程序的测试结果为失败,结束主应用程序的测试。
PCT/CN2012/083954 2012-07-24 2012-11-02 一种Android自动测试跨应用的装置及方法 WO2014015572A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US14/325,101 US9396096B2 (en) 2012-07-24 2014-07-07 Android automated cross-application testing device and method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201210256711.6A CN102855184B (zh) 2012-07-24 2012-07-24 一种Android自动测试跨应用的装置及方法
CN201210256711.6 2012-07-24

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/325,101 Continuation US9396096B2 (en) 2012-07-24 2014-07-07 Android automated cross-application testing device and method

Publications (1)

Publication Number Publication Date
WO2014015572A1 true WO2014015572A1 (zh) 2014-01-30

Family

ID=47401787

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/083954 WO2014015572A1 (zh) 2012-07-24 2012-11-02 一种Android自动测试跨应用的装置及方法

Country Status (3)

Country Link
US (1) US9396096B2 (zh)
CN (1) CN102855184B (zh)
WO (1) WO2014015572A1 (zh)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104156305B (zh) * 2013-05-15 2018-01-09 腾讯科技(深圳)有限公司 一种应用程序测试方法及装置
CN104424098B (zh) * 2013-08-28 2019-01-29 腾讯科技(深圳)有限公司 一种应用测试方法及装置
CN105224457B (zh) * 2015-09-29 2018-04-17 北京奇虎科技有限公司 一种测试框架实现方法和装置
CN108600741A (zh) * 2016-08-09 2018-09-28 青岛海信传媒网络技术有限公司 电视应用程序测试方法
CN107678939A (zh) * 2017-08-29 2018-02-09 苏州惠邦科信息技术有限公司 Android终端仿真测试系统
CN108170494B (zh) * 2017-12-28 2021-12-17 上海传英信息技术有限公司 一种用于智能终端的应用程序启动方法及启动系统
CN108804327A (zh) * 2018-06-12 2018-11-13 北京京东金融科技控股有限公司 一种自动生成测试数据的方法和装置
US20220066917A1 (en) * 2020-08-25 2022-03-03 OpenFin Inc. Candidate program release evaluation
CN112231234B (zh) * 2020-12-10 2021-03-19 北京云测信息技术有限公司 跨平台用户界面自动化测试方法、装置、设备和存储介质
CN112765028B (zh) * 2021-01-22 2023-08-04 济南大学 基于群控机制的Android应用程序测试方法及系统

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101521899A (zh) * 2009-03-31 2009-09-02 大连海事大学 用于移动应用程序的机上测试系统和方法
CN102053911A (zh) * 2010-12-30 2011-05-11 东莞宇龙通信科技有限公司 基于Android的自动化测试方法、系统及移动终端

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100407149C (zh) * 2005-08-26 2008-07-30 国际商业机器公司 父子应用集成的系统及方法
CN101876906B (zh) * 2010-03-31 2013-08-21 北京播思软件技术有限公司 一种利用Linux应用在Android系统中运行的方法及装置

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101521899A (zh) * 2009-03-31 2009-09-02 大连海事大学 用于移动应用程序的机上测试系统和方法
CN102053911A (zh) * 2010-12-30 2011-05-11 东莞宇龙通信科技有限公司 基于Android的自动化测试方法、系统及移动终端

Also Published As

Publication number Publication date
CN102855184B (zh) 2015-06-10
US9396096B2 (en) 2016-07-19
US20140325282A1 (en) 2014-10-30
CN102855184A (zh) 2013-01-02

Similar Documents

Publication Publication Date Title
WO2014015572A1 (zh) 一种Android自动测试跨应用的装置及方法
WO2018014582A1 (zh) 保单数据处理方法、装置、服务器和存储介质
Scott et al. Troubleshooting blackbox SDN control software with minimal causal sequences
WO2017177769A1 (zh) Ogg 版本部署方法、系统、服务器和存储介质
WO2013143392A1 (zh) 测试用例筛选方法和系统
CN100395725C (zh) 日志信息输出系统及输出方法
WO2017101252A1 (zh) 基于 Docker 的容器登录方法、服务器和系统
JP2006259869A (ja) マルチプロセッサシステム
WO2018000675A1 (zh) 一种后台应用管理装置、终端及后台应用管理方法
WO2012173355A2 (ko) 게임 서버의 작업 파일 실행 장치 및 방법
WO2012106931A1 (zh) 一种应用程序的内存错误修复方法
WO2014029111A1 (zh) 一种用户行为处理系统及方法
WO2020143297A1 (zh) 呼叫中心的容灾方法、装置、设备及存储介质
WO2018058835A1 (zh) 一种通话模式监控方法、系统及通信终端
CN112115038A (zh) 一种应用测试方法、装置和存储介质
WO2016023493A1 (zh) 人机交互界面对操作指令响应的控制方法及终端
WO2018018819A1 (zh) 应用程序的管理方法、管理装置及终端
WO2011150829A1 (zh) 一种冗余倒换的处理方法、装置及设备
TW201217966A (en) Method and apparatus for off-line analyzing crashed programs
CN108762886A (zh) 虚拟机的故障检测恢复方法及系统
JP2006164185A (ja) デバッグ装置
WO2017084402A1 (zh) 一种多应用程序的调试系统和方法
CN100576185C (zh) 信息处理装置和信息处理方法
WO2013042972A2 (ko) 바이패스 경로를 이용하여 신뢰성 검증을 할 수 있는 플래시 메모리 저장 장치, 및 이를 이용한 플래시 메모리 저장 장치의 신뢰성 검증 시스템 및 방법
WO2019084881A1 (zh) 机器人系统、驱动器、存储装置及控制模式的切换方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 12881825

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12881825

Country of ref document: EP

Kind code of ref document: A1