CN110955601A - Android platform stability-based automatic testing method and device and electronic equipment - Google Patents

Android platform stability-based automatic testing method and device and electronic equipment Download PDF

Info

Publication number
CN110955601A
CN110955601A CN201911195796.XA CN201911195796A CN110955601A CN 110955601 A CN110955601 A CN 110955601A CN 201911195796 A CN201911195796 A CN 201911195796A CN 110955601 A CN110955601 A CN 110955601A
Authority
CN
China
Prior art keywords
test
script
automated
android platform
loading
Prior art date
Legal status (The legal status 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 status listed.)
Pending
Application number
CN201911195796.XA
Other languages
Chinese (zh)
Inventor
周得水
王磊
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Wentai Information Technology Co Ltd
Original Assignee
Shanghai Wentai Information Technology Co Ltd
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 Shanghai Wentai Information Technology Co Ltd filed Critical Shanghai Wentai Information Technology Co Ltd
Priority to CN201911195796.XA priority Critical patent/CN110955601A/en
Publication of CN110955601A publication Critical patent/CN110955601A/en
Pending legal-status Critical Current

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/3684Test management for test design, e.g. generating new test cases

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)

Abstract

The invention discloses an android platform stability-based automatic testing method, which comprises the following steps: receiving a test script input by a user to define the automatic test service function; the test script is compiled by a user according to a set rule, and the test script comprises a plurality of test commands; installing a test system and loading the test script; starting an automatic test service, and analyzing a test command by using a test system; packaging the test frame, and enabling the packaged test frame to execute a test command; collecting abnormal information in the test process, and displaying the test state in the test process; and outputting the test information corresponding to each test command. The invention gets rid of the limitation of a PC end and improves the automatic testing efficiency; the operation threshold is low, and the commonality is strong.

Description

Android platform stability-based automatic testing method and device and electronic equipment
Technical Field
The invention relates to the technical field of android testing, in particular to an automatic stability testing method and device based on an android platform.
Background
With the increasing market share of the android system, more and more devices carrying the android system are mounted on the market, so that the requirement for android system development is increased, and meanwhile, the requirement for the automatic test of the stability of the android system is increased.
Prior to android system version 4.3, google provided a testing framework based on Instrumentation of Junit (Java unit testing framework) to track the life cycle of applications. After version 4.3 of the android system, google provides an Instrumentation-based Uiautomator framework for UI (User Interface) automation test, the Uiautomator framework needs to be programmed to inherit a Uiautorator TestCase class and call the Uiautomator Interface to write codes according to test cases, then the written codes are compiled into jar packets, connected with a PC (personal computer), and pushed to the android device by using adb commands, and then the adb commands are called to execute the jar packets to complete the test.
The above method has the following defects:
1. the PC end needs to be connected, the code is compiled at the PC end according to the test case every time, and then the compiled code is pushed through an adb command, so that the operation is complex and the efficiency is low;
2. the test case compiling needs to know the Uiautomator framework API and the Java basic knowledge, and has higher threshold and inconvenient use;
3. the single test action is successfully or unsuccessfully executed without UI interface display, and the record needs to be checked after the test is finished;
4. the test process cannot be controlled, and can only be executed from the beginning to the end, and cannot be suspended in the middle.
Disclosure of Invention
In order to overcome the defects of the prior art, the invention aims to provide an android platform-based stability automatic testing method, which can solve the problems that a PC (personal computer) end needs to be connected to write codes and the operation threshold is high in the prior art.
The invention also aims to provide an android platform-based automatic stability testing device, which can solve the problems that in the prior art, a PC (personal computer) end needs to be connected to compile codes, and the operation threshold is high.
The invention also aims to provide electronic equipment which can solve the problems that in the prior art, a PC terminal is required to be connected for coding, and the operation threshold is high.
One of the purposes of the invention is realized by adopting the following technical scheme:
an automatic stability testing method based on an android platform comprises the following steps:
receiving a test script input by a user to define the automatic test service function; the test script is compiled by a user according to a set rule, and the test script comprises a plurality of test commands;
installing a test system and loading the test script;
starting an automatic test service, and analyzing a test command by using a test system;
packaging the Uiautomator test frame, and enabling the packaged Uiautomator test frame to execute a test command;
collecting abnormal information in the test process, and displaying the test state in the test process;
and outputting the test information corresponding to each test command.
Preferably, the set rule is a self-defined rule for the test case.
Preferably, the path of loading the test script includes loading from an internal store, loading from an external store, and loading from a network store.
Preferably, the automated test service includes a control test script running service and an accessibility manager service and Uiautormator test framework connection service.
Preferably, the test information includes a test start time, an end time and a test result.
The third purpose of the invention is realized by adopting the following technical scheme:
based on automatic testing arrangement of tall and erect platform stability of ann, include following unit:
a receiving unit: configured to receive a test script input by a user to customize an automated test service function; the test script is compiled by a user according to a set rule, and the test script comprises a plurality of test commands;
an installation unit: configured to install a test system and load the test script;
a starting unit: configured to initiate automated testing services and parse test commands using a test system;
packaging the unit: is configured to package the Uiautomator test frame and make the packaged Uiautomator test frame execute the test command;
a collection unit: configured to collect abnormal information during the test, and to display a test status during the test;
an output unit: and is configured to output test information corresponding to each test command.
Preferably, the set rule is a self-defined rule for the test case.
Preferably, the path of loading the test script includes loading from an internal store, loading from an external store, and loading from a network store.
Preferably, the test information includes a test start time, an end time and a test result.
The third purpose of the invention is realized by adopting the following technical scheme:
an electronic device having a memory, a processor, and a computer readable program stored in the memory and executable by the processor, wherein the computer readable program when executed by the processor implements an android platform based stability automated testing method as one of the objects of the present invention.
Compared with the prior art, the invention has the beneficial effects that:
the automatic testing method provided by the invention gets rid of the limitation of a PC (personal computer) end, when a plurality of android devices to be tested exist, a plurality of corresponding USB (universal serial bus) data lines are not needed to be connected with the PC end, and only an android testing system is needed to be connected with the android devices, so that the automatic testing efficiency is improved; and the test code is not required to be edited, only the test case is required to be compiled according to the script rule, the programming language basis is not required, the operation threshold is low, and the universality is high.
Drawings
Fig. 1 is a flowchart of an automated android platform stability-based testing method of the present invention.
Detailed Description
The invention will be further described with reference to the accompanying drawings and the detailed description below:
the invention provides an automatic testing method based on android platform stability, wherein the foundation of the current android automatic test is Instrumentation, and the invention packages part of services provided by an installed Uiautomator testing framework through Access manager service into Uiautomator services for use in the automatic test. The Uiautomator can be used for unit testing, performance testing, pressure testing, ROM level testing and the like, and is classified into uiautomation support (UI test information extension class), uiautomation test case (UI test base class), UICollection (UI test control set) and the like. Access is an android Accessibility related api. According to the invention, the Android is used for providing the kernel service UiAutomation for the automatic test for reconstruction, the usable AccessinityService service of the three-party application is used for self-defining the automatic test service to realize the original UiAutomation service function, then the Uiautomator frame is reconstructed in the system, and the self-defined automatic test service is used. And then, packaging the reconstructed Uiautormator frame command to generate a self-defined script rule.
As shown in fig. 1, the application of the present invention to a terminal device equipped with an android system includes the following steps:
s1: receiving a test script input by a user to define the automatic test service function; the test script is compiled by a user according to a set rule, and the test script comprises a plurality of test commands;
in this step, the set rule is a self-defined rule for the test case. And writing a test script on the terminal equipment by a user according to the test case by using the self-defined rule.
S2: installing a test system and loading the test script;
the test system is installed on the terminal equipment with the android system, and then the test script is loaded. The load path of the test script includes loads from internal storage, loads from external storage, and loads from network storage. The external storage includes but is not limited to an SD card, and the network storage is used for acquiring the script from a network server.
S3: starting an automatic test service, and analyzing a test command by using a test system; the automatic test service comprises a control test script operation service and a control access availability manager service and Uiautormator test framework connection service. The control test script runs the start, pause and stop function of the service control automation test process, another kind of service control and accessiblityinteractionclient connect and interact, realize the auxiliary function.
S4: packaging the Uiautomator test frame, and enabling the packaged Uiautomator test frame to execute a test command; in the invention, the self-defined test command comprises the command package of the original Uiautomator test framework and the other Uiautomator in the android support test package, and also comprises the command packages of some single test functions. In this step, the test command is executed using the encapsulated Uiautomator test framework, which includes an encapsulation for the original Uiautomator test framework and an encapsulation for another Uiautomator version within the android support test package.
The two steps of analyzing the test command and executing the test command are executed circularly under the condition of multiple commands, and are executed until the script is run completely if no manual intervention exists, otherwise, the running is stopped if the script is paused under manual operation.
S5: collecting abnormal information in the test process, and displaying the test state in the test process; in the testing process, a testing state is displayed on a top window of the system, and the testing state mainly refers to information such as a current test case command, a testing state (number of commands already run/total number of commands), a test case running state (number of test cases already run/total number of test cases), a running result of a single command and the like displayed on a top window of an android device interface. The display mode is vertical display or horizontal display, and other display modes are also possible. The abnormal information of the mobile phone installation system mainly comprises the following aspects: ANR abnormity, Crash abnormity, Tombstone abnormity, Native Crash abnormity, information such as CPU, memory, power consumption and the like in the execution process of a single test case.
S6: and outputting the test information corresponding to each test command. The test information comprises test starting time, test ending time and test results.
The invention also provides an automatic testing device based on the stability of the android platform, which comprises the following units:
a receiving unit: configured to receive a test script input by a user to customize an automated test service function; the test script is compiled by a user according to a set rule, and the test script comprises a plurality of test commands;
an installation unit: configured to install a test system and load the test script; the path for loading the test script includes loading from an internal store, loading from an external store, and loading from a network store.
A starting unit: configured to initiate automated testing services and parse test commands using a test system;
packaging the unit: is configured to package the Uiautomator test frame and make the packaged Uiautomator test frame execute the test command;
a collection unit: configured to collect abnormal information during the test, and to display a test status during the test;
an output unit: and is configured to output test information corresponding to each test command. The test information comprises test starting time, test ending time and test results.
Further preferably, the set rule is a self-defined rule for the test case.
The principle and the technical means of the device provided by the embodiment are substantially the same as those of the android platform stability-based automatic testing method provided by the invention, and are not described herein again.
In addition, the invention also provides an electronic device, which is provided with a memory, a processor and a computer readable program stored in the memory and executable by the processor, wherein when the computer readable program is executed by the processor, the automatic testing method based on the android platform stability is realized.
Various other modifications and changes may be made by those skilled in the art based on the above-described technical solutions and concepts, and all such modifications and changes should fall within the scope of the claims of the present invention.

Claims (10)

1. An automatic stability testing method based on an android platform is characterized by comprising the following steps:
receiving a test script input by a user to define the automatic test service function; the test script is compiled by a user according to a set rule, and the test script comprises a plurality of test commands;
installing a test system and loading the test script;
starting an automatic test service, and analyzing a test command by using a test system;
packaging the Uiautomator test frame, and enabling the packaged Uiautomator test frame to execute a test command;
collecting abnormal information in the test process, and displaying the test state in the test process;
and outputting the test information corresponding to each test command.
2. The automated android platform-based stability testing method of claim 1, in which the set rules use custom rules for test cases.
3. The android platform-based stability automated testing method of claim 1, wherein a path to load the test script comprises loading from an internal store, loading from an external store, and loading from a network store.
4. The automated android platform-based stability testing method of claim 1, in which the automated testing services include a control test script running service and a control accessibility manager service and Uiautormator test framework connection service.
5. The automated android platform-based stability testing method of claim 1, in which the testing information comprises a test start time, an end time, and a test result.
6. Based on automatic testing arrangement of tall and erect platform stability of ann, its characterized in that includes following unit:
a receiving unit: configured to receive a test script input by a user to customize an automated test service function; the test script is compiled by a user according to a set rule, and the test script comprises a plurality of test commands;
an installation unit: configured to install a test system and load the test script;
a starting unit: configured to initiate automated testing services and parse test commands using a test system;
packaging the unit: is configured to package the Uiautomator test frame and make the packaged Uiautomator test frame execute the test command;
a collection unit: configured to collect abnormal information during the test, and to display a test status during the test;
an output unit: and is configured to output test information corresponding to each test command.
7. The automated android platform-based stability testing apparatus of claim 6, in which the set rules use custom rules for test cases.
8. The android platform-based stability automated testing apparatus of claim 6, wherein a path to load the test script comprises loading from an internal store, loading from an external store, and loading from a network store.
9. The android platform-based stability automated testing apparatus of claim 6, in which the test information comprises a test start time, an end time, and a test result.
10. An electronic device having a memory, a processor, and a computer readable program stored in the memory and executable by the processor, wherein the computer readable program, when executed by the processor, implements the automated android platform stability testing method of any of claims 1-5.
CN201911195796.XA 2019-11-29 2019-11-29 Android platform stability-based automatic testing method and device and electronic equipment Pending CN110955601A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911195796.XA CN110955601A (en) 2019-11-29 2019-11-29 Android platform stability-based automatic testing method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911195796.XA CN110955601A (en) 2019-11-29 2019-11-29 Android platform stability-based automatic testing method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN110955601A true CN110955601A (en) 2020-04-03

Family

ID=69978867

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911195796.XA Pending CN110955601A (en) 2019-11-29 2019-11-29 Android platform stability-based automatic testing method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN110955601A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111581096A (en) * 2020-05-09 2020-08-25 上海锐伟电子科技有限公司 Automatic testing method for android system terminal equipment
CN115002090A (en) * 2022-06-01 2022-09-02 北京触点互动信息技术有限公司 Android-based video quality automatic testing method

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111581096A (en) * 2020-05-09 2020-08-25 上海锐伟电子科技有限公司 Automatic testing method for android system terminal equipment
CN115002090A (en) * 2022-06-01 2022-09-02 北京触点互动信息技术有限公司 Android-based video quality automatic testing method
CN115002090B (en) * 2022-06-01 2023-12-15 北京触点互动信息技术有限公司 Video quality automatic test method based on android

Similar Documents

Publication Publication Date Title
CN109302522B (en) Test method, test device, computer system, and computer medium
CN110046479B (en) Link library file anti-debugging method and device based on android operating system
CN110013672B (en) Method, device, apparatus and computer-readable storage medium for automated testing of machine-run games
CN106126423A (en) The method of testing of game application, Apparatus and system
CN110955601A (en) Android platform stability-based automatic testing method and device and electronic equipment
CN111258913A (en) Automatic algorithm testing method and device, computer system and readable storage medium
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN103186463B (en) Determine the method and system of the test specification of software
CN115080398A (en) Automatic interface test system and method
CN105404574B (en) Smart card and mobile terminal consistency test method and device
CN102375103B (en) Electronic product test device and method
CN103699485B (en) Application program adjustment method and device
US20120110383A1 (en) Method and apparatus for off-line analyzing crashed programs
CN113127329B (en) Script debugging method and device and computer storage medium
CN112181388A (en) SDK component initialization method, device, storage medium and control terminal
CN112084108A (en) Test script generation method and device and related components
CN116662161A (en) Function debugging method, device, equipment and storage medium
CN112463574A (en) Software testing method, device, system, equipment and storage medium
CN115934503A (en) Program testing method, device, equipment and storage medium
CN109901831A (en) The multi-platform compatibility operation method and compatibility operation device of software
CN115454785A (en) VScode-based graphical real-time monitoring and management method for host performance
CN114385493A (en) Performance test method and device, electronic equipment and storage medium
CN115509913A (en) Software automation test method, device, machine readable medium and equipment
CN111414270B (en) Exception handling method and device
CN114297085A (en) Full-automatic pressure measurement system, electronic equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination