WO2019227641A1 - 一种应用程序测试方法、装置、终端设备及介质 - Google Patents
一种应用程序测试方法、装置、终端设备及介质 Download PDFInfo
- Publication number
- WO2019227641A1 WO2019227641A1 PCT/CN2018/097110 CN2018097110W WO2019227641A1 WO 2019227641 A1 WO2019227641 A1 WO 2019227641A1 CN 2018097110 W CN2018097110 W CN 2018097110W WO 2019227641 A1 WO2019227641 A1 WO 2019227641A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- test
- tested
- control
- application
- test case
- 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.)
- Ceased
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3668—Testing of software
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Definitions
- the present application belongs to the technical field of data processing, and particularly relates to an application program testing method, device, terminal device, and medium.
- the control identifier name of the login control can be set to "Login control", that is, for the application in the IOS system, the "Login control” corresponds to the login control.
- a complete application test contains one or more test nodes.
- the application registration test can include a registration node and a login node.
- the controls and calling order are set so that when executing a test case, the corresponding interface control can be called for each test node in turn to complete the operation of the test node.
- control identifier names of the interface controls of the same application in different operating systems are different.
- the control identifier name of a login control can be either "Login control” or "Login control”. Can be "Login Control”.
- automated test tools are used to write corresponding test cases for the operating system of the terminal device where the application is located. That is, in the prior art, each test node is directly set according to the operating system. The identification name of the control to be called and the corresponding calling sequence.
- the embodiments of the present application provide an application test method and a terminal device, so as to solve the problem that in the prior art, it is not possible to use one test case to perform compatibility test of the same application function on terminal devices of different operating systems.
- a first aspect of the embodiments of the present application provides an application test method, including:
- Analyze the test case obtain each test node that constitutes the test process corresponding to the test case, and obtain the interface control called by each test node in the running process and the calling order corresponding to each of the interface controls;
- the interface controls constituting the test node are sequentially called based on the calling order to complete the test case Corresponding test process.
- a second aspect of the embodiments of the present application provides an application test apparatus, including:
- a use case analysis module configured to parse a test case, obtain each test node constituting a test process corresponding to the test case, and obtain interface controls called by each test node during running and corresponding to each of the interface controls Calling sequence
- An identification library filtering module configured to filter the control identification library corresponding to the operating system type of the device under test from multiple control identification libraries associated with the application under test in the device under test;
- a identification name query module configured to find the control identification name of each of the interface controls in the filtered identification library
- the test module is used to sequentially call the interface controls constituting the test node based on the calling order based on the control identification name of each of the interface controls that are found out. Complete the test process corresponding to the test case.
- a third aspect of the embodiments of the present application provides a terminal device including a memory and a processor.
- the memory stores computer-readable instructions executable on the processor, and the processor executes the computer-readable instructions. The following steps are implemented when reading instructions:
- Analyze the test case obtain each test node that constitutes the test process corresponding to the test case, and obtain the interface control called by each test node in the running process and the calling order corresponding to each of the interface controls;
- the interface controls constituting the test node are sequentially called based on the calling order to complete the test case Corresponding test process.
- a fourth aspect of the embodiments of the present application provides a computer-readable storage medium, where the computer-readable storage medium stores computer-readable instructions, and is characterized in that the computer-readable instructions are implemented when executed by at least one processor. The following steps:
- Analyze the test case obtain each test node that constitutes the test process corresponding to the test case, and obtain the interface control called by each test node in the running process and the calling order corresponding to each of the interface controls;
- the interface controls constituting the test node are sequentially called based on the calling order to complete the test case Corresponding test process.
- the control identification name of the interface control to be called in the test case is determined and the named The interface controls make query calls, so that in the embodiment of the present application, only the interface controls to be called need to be set in the test case, and the specific control identification names of the controls in different operating systems need not be set. Therefore, even for different operating systems, the corresponding interface controls to be tested can be determined according to the above operations, and the corresponding tests can be performed, thereby realizing the use of a test case to perform the same application program function on terminal devices of different operating systems. Compatibility test.
- FIG. 1 is a schematic flowchart of an application program testing method provided in Embodiment 1 of the present application; FIG.
- FIG. 2 is a schematic flowchart of an application program testing method provided in Embodiment 2 of the present application;
- FIG. 3 is a schematic flowchart of an application program testing method provided in Embodiment 3 of the present application.
- FIG. 4 is a schematic flowchart of an application program testing method provided in Embodiment 4 of the present application.
- FIG. 5 is a schematic flowchart of an application program testing method provided in Embodiment 5 of the present application.
- FIG. 6 is a schematic flowchart of an application program test method provided in Embodiment 6 of the present application.
- FIG. 7 is a schematic structural diagram of an application testing device provided in Embodiment 7 of the present application.
- FIG. 8 is a schematic diagram of a terminal device provided in Embodiment 8 of the present application.
- FIG. 1 shows an implementation flowchart of an application testing method provided in Embodiment 1 of the present application, which is detailed as follows:
- S101 Analyze the test case, obtain each test node constituting the test process corresponding to the test case, and obtain the interface control called by each test node during the running process and the corresponding calling sequence of each interface control.
- the test case may include the test of one or more functions of the application
- the implementation of each function requires one or more operation steps.
- the test corresponds to each operation step.
- the process needs to include the corresponding test nodes for testing, so each test process corresponds to one or more test nodes required for function implementation.
- the registration function of some applications includes two steps of registration and login. Therefore, when the registration function is tested, the test process includes at least two test nodes, the corresponding registration node and the login node.
- the corresponding interface controls need to be called in turn according to the actual operation steps when testing the nodes.
- the information input controls, login controls, and verification controls need to be called in order. Therefore, in order to ensure the normal and effective testing of the application program, in the embodiments of the present application, a technician needs to set the corresponding test node and the interface control of the application program to be called in each node according to the actual function of the test application program. And the order of the calls.
- each test is not directly recorded as a control identifier as in the prior art.
- the interface controls that the node needs to call but directly records the interface controls that each test node needs to call, so that when the subsequent tests are performed on terminal devices of different operating system types, the corresponding interface controls can be used to respond.
- the call of the interface control of the control identification name to achieve the compatibility test of the terminal devices of different operating systems.
- the example description is as follows: Assume that the login node needs to call the login control.
- the control ID of the login control in the IOS system is "Login control” and the control ID in the Android system is "LOGIN control".
- the existing technology is used in the test case.
- the login node When the login node writes the corresponding interface control, it will be recorded as: “Login control” for the IOS system and as "Login control" for the Android system to ensure that the corresponding control name can be directly called during the test. Interface controls to ensure the normal operation of the test.
- the test case is only recorded as: calling the login control, so that the subsequent steps can determine the corresponding control identification name according to the operating system type of the terminal device, so as to make subsequent interface control calls. And test.
- each operation will be The system sets a corresponding control identification library to record the control identification name of each interface control of the application in the operating system.
- the control identification name of the login control is "Login control”.
- this application implements The regular meeting records the control ID of the login control in the control identification library of the IOS system as "Login control”.
- multiple control identification libraries associated with the application to be tested can be obtained.
- operating system types include, but are not limited to, IOS systems and Android systems.
- control identification name of each interface control of the application has been recorded in the control identification library corresponding to each operating system, after determining the control identification library corresponding to the operating system of the terminal device, it is only necessary to directly refer to the control identification library.
- To find the control identifier name of the interface control as in the above example, after determining the control identifier library corresponding to the IOS system, if it is determined that the login control needs to be called, only the control identifier library corresponding to the IOS system needs to be called at this time. , Find out the control ID "Login Control" corresponding to the login control.
- the names of each interface control have been set in advance, so after determining the control identification name of the interface control to be called, the actual required interface control can be realized according to the control identification name.
- the control ID of the login control in the IOS system is "Login Control”
- the interface control named "Login Control” is the login control. If you need to call the login control, you only need to find the interface control named "Login Control”.
- testing of the application to be tested in the terminal device is started. At this time, you only need to test sequentially according to the test process in the test case. If you need to call the interface control, you only need to call it according to the identified control name.
- the registration function includes two test nodes: a registration node and a login node.
- the login node needs to call the information input control, the login control, and the verification control in order.
- the control identification names of the information input control, login control, and verification control are respectively "Information input control ",” Login control "and” Validate control ", and the operating system of the terminal device is the IOS system.
- the control identification name of the interface control to be called in the test case is determined and then based on the control identification. Name to make a query call to a named interface control, so that the embodiment of the present application only needs to set the required interface control to be called in a test case, without setting its specific control identification name in different operating systems. Therefore, even for different operating systems, the corresponding interface controls to be tested can be determined according to the above operations, and the corresponding tests can be performed, thereby realizing the use of a test case to perform the same application program function on terminal devices of different operating systems. Compatibility test.
- the method when analyzing a test case, the method includes:
- the format types include Excel format, YAML format, and script format.
- S1012 Parse the test cases based on the analysis tool corresponding to the preset format type, determine each test node that constitutes the test process corresponding to the test case, and obtain the interface controls and each interface called by each test node during the running process. The calling order corresponding to the interface control.
- the embodiment of this application adds synchronization support for test cases in various formats. Select the test cases in the corresponding format and write them.
- the parsing of test scripts in different formats belongs to the prior art. Therefore, when presetting parsing tools, it is only necessary to select some corresponding existing parsing tools, which will not be elaborated here.
- the method before parsing the test case, the method further includes: S301, obtaining a test case recording instruction, and determining an interface control included in the application to be tested.
- the test case recording instruction is used to trigger the mobile terminal to start the recording of the script
- the recording stop instruction is used to terminate the mobile terminal's recording of the test case.
- the test case recording instruction and the recording stop instruction can implement the test Use case recording always controls to generate the corresponding test cases required.
- the test case recording instruction and recording stop instruction can be manually input by the user or can be generated by other preset trigger conditions, such as setting a timing mechanism to automatically generate test case recording instructions and recording stop instructions at regular intervals to complete the test. Recording of test cases.
- the mobile terminal starts the test case recording mode.
- all interface controls included in the application will be determined first. For example, when using Uiautomator as a test tool, you can use findObject () according to the text, hint, contentDescription and other attributes of the element. ) Method to find the interface controls included in the application.
- the response data corresponding to the interface control refers to the data generated when the interface control responds to the user's operation behavior, and the corresponding time of the user's operation behavior.
- the user video playback application performs a 1.5 times fast forward operation during video playback.
- the fast forward button control will perform a 1.5 times fast forward operation.
- the corresponding response data of the fast forward button control is 1.5 times the fast forward magnification and the time of the user's fast forward operation.
- the interface controls When the user operates the application, the interface controls will respond to the user's operation behavior, so that the various functions of the application respond to the user's operation. For example, in a video playback application, if the user clicks the play / pause button during recording , The corresponding play / pause button control performs the play / pause function task. Therefore, at this time, the response data of the interface control is recorded to know when the application has performed some functions during the user's operation. Subsequent accurate playback of user operations.
- S303 Obtain a recording stop instruction, and analyze based on the response data corresponding to the recorded interface controls to generate a test case.
- the response data of the interface controls are processed to obtain corresponding test cases, which are used as the basis for subsequent application testing. For example, after the user completes the play / pause / fast forward / stop function operation of the video playback application during recording, after obtaining response data of the corresponding interface control, a test case is generated based on these response data to record the user's operation of the application.
- the embodiments of the present application will use the adb tool and the instruments tool to try to obtain the physical address of the terminal device, because the adb tool can only communicate with the Android system and implement it normally.
- Obtaining a physical address so when the adb tool successfully obtains a physical address, it means that the terminal device connected to the test is an Android system device.
- the instrument successfully obtains the physical address the terminal device connected to the test is a device of the IOS system.
- the adb tool and the instruments tool are both existing testing tools, the relevant description of the two tools will not be repeated here, and interested readers can consult the relevant information by themselves.
- the test of a single terminal device is occasional, and the abnormal test result is obtained in time, it must be the problem of the application to be tested, or it may be the test.
- Terminal equipment or other environmental factors so in order to improve the effectiveness of the test and ensure the accuracy and effectiveness of the obtained test results, in the embodiment of the present application, after completing the test process corresponding to the test case, it also includes:
- test data obtained by the test to determine whether there is an abnormality in the test result of the application to be tested.
- specific criteria for abnormalities can be set by the technicians themselves, including but not limited to, for example, for each parameter in the test data obtained from the test, a normal data range is set in advance, and after the test is completed, Each parameter in the test data is verified separately to determine whether it is within the normal data range. If it is not, it is determined that the test result is abnormal.
- the operating system versions are the same, it means that the software environment in which the applications run is the same, such as all Android 7.0 terminal devices. Therefore, in order to rule out test exceptions caused by accidental factors of a single terminal device, the embodiment of this application will perform all operations. For terminal devices with the same system version, perform the same test again to verify how the final test results are, and provide guarantee for the accuracy and effectiveness of application testing.
- the method further includes: analyzing the obtained test data according to the test indicators set by the user to obtain an index test result corresponding to each test indicator.
- the user can set the required test analysis indicators, such as functional stability, memory occupation rate, and power consumption speed.
- the embodiments of the present application analyze the indicators that the user needs to analyze based on the obtained test data to obtain the corresponding indicator test results, such as the memory usage during the application program running.
- the application can record the memory occupation rate of the terminal device, and organize and generate the memory occupation performance curve.
- FIG. 6 shows an implementation flowchart of an application test method provided in Embodiment 6 of the present application. Since the first embodiment of the present application is directed to the testing of a single terminal device, no matter what the single terminal device is installed All kinds of operating systems can achieve the compatibility of their application functions. However, considering the actual situation, in order to improve the efficiency of terminal device testing, terminal devices are often performed in batches. For compatibility testing of multiple terminal devices that may have different operating systems, an embodiment of the present application proposes a technical solution that can test multiple terminal devices simultaneously, as detailed below:
- S602 From the multiple control identification libraries associated with the application to be tested, screen out N control identification libraries corresponding to the operating system types of the online N devices under test, and install the to-be-tested devices in each of the N devices under test.
- N is a positive integer greater than 1.
- S603 Query the control identification name of the interface control in each device to be tested based on the filtered N control identification libraries.
- the test method for each terminal device is the same as that in the first embodiment of the present application. Therefore, it will not be repeated here.
- the difference from the embodiment of the present application lies in that the sixth embodiment of the present application simultaneously tests For each terminal device online, the control identification library is filtered and the control identification name is searched based on the operating system. Based on the search results, each terminal device is tested for the interface control of the test node.
- the compatibility test of multiple terminal devices that may have different operating systems greatly meets the actual needs of users.
- the second embodiment of the present application to the fourth embodiment of the present application can also be applied to the testing of multiple terminal devices that may have different operating systems.
- the second embodiment of the present application to the fourth embodiment of the present application can also be applied to the testing of multiple terminal devices that may have different operating systems.
- FIG. 7 shows a structural block diagram of an application testing device provided by an embodiment of the present application.
- the application test apparatus illustrated in FIG. 7 may be an execution subject of the application test method provided by the foregoing first embodiment.
- the application test apparatus includes:
- the use case analysis module 71 is configured to analyze a test case, obtain each test node constituting a test process corresponding to the test case, and obtain interface controls called by each of the test nodes during operation and each of the interface controls. The corresponding calling sequence.
- the identification library screening module 72 is configured to filter the control identification library corresponding to the operating system type of the device under test from a plurality of control identification libraries associated with the application under test in the device under test.
- the identification name query module 73 is configured to find the control identification name of each of the interface controls in the filtered identification library.
- the testing module 74 is configured to sequentially call the interface controls constituting the test node based on the calling order based on the control identification name of each of the interface controls found in sequence, To complete the test process corresponding to the test case.
- the use case analysis module 71 includes:
- a format recognition module is configured to identify a format type of the test case, and the format type includes an Excel format, a YAML format, and a script format.
- the format use case analysis module is configured to analyze the test case based on a preset analysis tool corresponding to the format type, determine each of the test nodes constituting a test process corresponding to the test case, and obtain each The interface controls called by the test node during operation and the calling sequence corresponding to each of the interface controls are described.
- the application test device further includes:
- the application test device further includes:
- the operating system type of the device to be tested is an Android system.
- the instrument successfully obtains the physical address, it is determined that the operating system type of the device to be tested is an IOS system.
- the application test device further includes:
- a plurality of devices under test that are the same as the operating system version of the device under test are selected from the online group of devices under test.
- testing the plurality of devices to be tested Based on the test case, testing the plurality of devices to be tested.
- first, second, etc. are used in the text to describe various elements in some embodiments of the present application, these elements should not be limited by these terms. These terms are only used to distinguish one element from another.
- a first contact may be named a second contact, and similarly, a second contact may be named a first contact without departing from the scope of the various described embodiments. Both the first contact and the second contact are contacts, but they are not the same contact.
- FIG. 8 is a schematic diagram of a terminal device according to an embodiment of the present application.
- the terminal device 8 of this embodiment includes a processor 80 and a memory 81.
- the memory 81 stores computer-readable instructions 82 that can run on the processor 80.
- the processor 80 executes the computer-readable instructions 82
- the nodes in the foregoing embodiments of the application test method are implemented, for example, the nodes 101 to 104 shown in FIG. 1.
- the processor 80 executes the computer-readable instructions 82
- the functions of each module / unit in the foregoing device embodiments are implemented, for example, the functions of modules 71 to 74 shown in FIG. 7.
- the terminal device 8 may be a computing device such as a desktop computer, a notebook, a palmtop computer, and a cloud server.
- the terminal device may include, but is not limited to, a processor 80 and a memory 81.
- FIG. 8 is only an example of the terminal device 8 and does not constitute a limitation on the terminal device 8. It may include more or fewer components than shown in the figure, or combine some components or different components.
- the terminal device may further include an input sending device, a network access device, a bus, and the like.
- the processor 80 may be a central processing unit (Central Processing Unit (CPU), or other general-purpose processors, Digital Signal Processors (DSPs), and application-specific integrated circuits (Applications) Specific Integrated Circuit (ASIC), off-the-shelf Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc.
- CPU Central Processing Unit
- DSP Digital Signal Processor
- ASIC Applications
- FPGA off-the-shelf Programmable Gate Array
- a general-purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
- the memory 81 may be an internal storage unit of the terminal device 8, such as a hard disk or a memory of the terminal device 8.
- the memory 81 may also be an external storage device of the terminal device 8, such as a plug-in hard disk, a smart memory card (Smart Media Card (SMC), Secure Digital (Secure Digital (SD) card, Flash card (Flash Card) and so on. Further, the memory 81 may further include both an internal storage unit of the terminal device 8 and an external storage device. The memory 81 is configured to store the computer-readable instructions and other programs and data required by the terminal device. The memory 81 may also be used to temporarily store data that has been sent or will be sent.
- SMC Smart Media Card
- SD Secure Digital
- Flash Card Flash Card
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each of the units may exist separately physically, or two or more units may be integrated into one unit.
- the above integrated unit may be implemented in the form of hardware or in the form of software functional unit.
- the integrated module / unit When the integrated module / unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the method of the above embodiment, and can also be completed by computer-readable instructions to instruct related hardware.
- the computer-readable instructions can be stored in a computer-readable storage medium. In the computer-readable instructions, when executed by a processor, the nodes of the foregoing method embodiments can be implemented.
- the computer-readable instructions include computer-readable instruction codes, and the computer-readable instruction codes may be in a source code form, an object code form, an executable file, or some intermediate form.
- the computer-readable medium may include: any entity or device capable of carrying the computer-readable instruction code, a recording medium, a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (Read-Only Memory, ROM), Random Access Memory Memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media.
- a recording medium a U disk, a mobile hard disk, a magnetic disk, an optical disk, a computer memory, a read-only memory (Read-Only Memory, ROM), Random Access Memory Memory (RAM), electrical carrier signals, telecommunication signals, and software distribution media.
- ROM Read-Only Memory
- RAM Random Access Memory Memory
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
本申请提供了一种应用程序测试方法、装置、终端设备及介质,适用于数据处理技术领域,该方法包括:获取构成测试用例对应的测试过程的各个测试节点,以及所调用的界面控件及调用顺序;从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与操作系统类型对应的控件标识库,查找出每个界面控件的控件标识名;在依次运行各个测试节点的过程中,对构成测试节点的界面控件基于调用顺序依次调用,以完成测试用例对应的测试过程。本申请实施例中,即使是不同的操作系统,也可以根据上述操作来确定出对应的待测试界面控件并进行相应的测试,从而实现了使用一个测试用例对不同操作系统的终端设备进行相同应用程序功能的兼容测试。
Description
本申请要求于2018年06月01日提交中国专利局、申请号为201810554464.5 、发明名称为“一种应用程序测试方法及终端设备”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请属于数据处理技术领域,尤其涉及一种应用程序测试方法、装置、终端设备及介质。
研发人员在对应用程序的界面控件进行命名存储时,需要根据终端设备安装的操作系统的实际研发要求/命名规则来对应用程序的界面控件进行命名,以得到每个界面控件的控件标识名,如IOS系统中的某个应用程序,其登录控件的控件标识名可以设置为“Login控件”,即对于IOS系统的该应用程序而言,“Login控件”对应的就是登录控件,后续在需要调用IOS系统中该应用程序的登录控件时,只需要查找出控件标识名为“Login控件”的界面控件即可。
一个完整的应用程序测试包含着一个或多个测试节点,如应用程序的注册测试,可以包含注册节点以及登录节点,而在编写测试用例时,需要对测试中每一个测试节点所需调用的界面控件以及调用顺序进行设置,以使得在执行测试用例时能够准确为每个测试节点依次调用对应的界面控件,完成该测试节点的操作,如对登录节点时需要调用登录控件完成登录节点的操作,此时就需要在测试用例中设置好登录节点所需调用的界面控件为登录控件。现有技术中,为了保证每一个测试节点对界面控件的正确调用,会在测试用例中直接编写好测试节点所需的界面控件在操作系统中的控件标识名,从而使得在应用程序测试时,直接读取控件标识名对应的界面控件即可。
由于不同的操作系统的实际研发要求/命名规则不同,因此使得同一应用程序的界面控件在不同操作系统中的控件标识名各不相同,如登录控件的控件标识名既可以为“Login控件”也可以为“登录控件”。而现有技术中都是利用自动化测试工具,针对应用程序所处的终端设备的操作系统来编写对应的测试用例,即现有技术都是直接根据操作系统,来为每个测试节点设置对应的待调用控件标识名以及对应的调用顺序,当需要对装有不同操作系统的终端设备进行相同的应用程序测试时,由于不同的操作系统中界面控件的控件标识名各不相同,因此只能针对每个终端设备分别编写对应的不同测试用例,以保证对该终端设备中应用程序功能的正常测试。因此,现有技术无法实现使用一个测试用例对不同操作系统的终端设备进行相同应用程序功能的兼容测试。
有鉴于此,本申请实施例提供了一种应用程序测试方法及终端设备,以解决现有技术中无法实现使用一个测试用例对不同操作系统的终端设备进行相同应用程序功能的兼容测试的问题。
本申请实施例的第一方面提供了一种应用程序测试方法,包括:
解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序;
从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库;
在筛选出的所述控件标识库中查找出每个所述界面控件的控件标识名;
基于查找出的每个所述界面控件的控件标识名,在依次运行各个所述测试节点的过程中,对构成所述测试节点的界面控件基于所述调用顺序依次调用,以完成所述测试用例对应的测试过程。
本申请实施例的第二方面提供了一种应用程序测试装置,包括:
用例解析模块,用于解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序;
标识库筛选模块,用于从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库;
标识名查询模块,用于在筛选出的所述控件标识库中查找出每个所述界面控件的控件标识名;
测试模块,用于基于查找出的每个所述界面控件的控件标识名,在依次运行各个所述测试节点的过程中,对构成所述测试节点的界面控件基于所述调用顺序依次调用,以完成所述测试用例对应的测试过程。
本申请实施例的第三方面提供了一种终端设备,包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:
解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序;
从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库;
在筛选出的所述控件标识库中查找出每个所述界面控件的控件标识名;
基于查找出的每个所述界面控件的控件标识名,在依次运行各个所述测试节点的过程中,对构成所述测试节点的界面控件基于所述调用顺序依次调用,以完成所述测试用例对应的测试过程。
本申请实施例的第四方面提供了一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被至少一个处理器执行时实现如下步骤:
解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序;
从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库;
在筛选出的所述控件标识库中查找出每个所述界面控件的控件标识名;
基于查找出的每个所述界面控件的控件标识名,在依次运行各个所述测试节点的过程中,对构成所述测试节点的界面控件基于所述调用顺序依次调用,以完成所述测试用例对应的测试过程。
通过对终端设备进行操作系统的识别,并根据操作系统的不同查找出对应的控件标识库,以确定并对测试用例中待调用界面控件的控件标识名,再基于控件标识名来对已命名的界面控件进行查询调用,从而使得本申请实施例在测试用例中只需要设置所需调用的界面控件,而无需设置其在不同操作系统中具体的控件标识名。因此,即使是不同的操作系统,也可以根据上述操作来确定出对应的待测试界面控件,并进行相应的测试,从而实现了使用一个测试用例对不同操作系统的终端设备进行相同应用程序功能的兼容测试。
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。
图1是本申请实施例一提供的应用程序测试方法的实现流程示意图;
图2是本申请实施例二提供的应用程序测试方法的实现流程示意图;
图3是本申请实施例三提供的应用程序测试方法的实现流程示意图;
图4是本申请实施例四提供的应用程序测试方法的实现流程示意图;
图5是本申请实施例五提供的应用程序测试方法的实现流程示意图;
图6是本申请实施例六提供的应用程序测试方法的实现流程示意图;
图7是本申请实施例七提供的应用程序测试装置的结构示意图;
图8是本申请实施例八提供的终端设备的示意图。
以下描述中,为了说明而不是为了限定,提出了诸如特定系统结构、技术之类的具体细节,以便透彻理解本申请实施例。然而,本领域的技术人员应当清楚,在没有这些具体细节的其它实施例中也可以实现本申请。在其它情况中,省略对众所周知的系统、装置、电路以及方法的详细说明,以免不必要的细节妨碍本申请的描述。
为了说明本申请所述的技术方案,下面通过具体实施例来进行说明。
图1示出了本申请实施例一提供的应用程序测试方法的实现流程图,详述如下:
S101,解析测试用例,获取构成测试用例对应的测试过程的各个测试节点,以及获取每个测试节点在运行过程中所调用的界面控件及每个界面控件对应的调用顺序。
由于测试用例中可能包含对应用程序一个或多个功能的测试,每个功能的实现都需要一个或多个操作步骤,而在对应用程序的这些功能进行测试时,对应于每个操作步骤测试过程中都需要包含着相应的测试节点进行测试,因此每个测试过程都对应着功能实现所需的一个或多个测试节点。例如一些应用程序的注册功能中包含注册和登陆两个步骤,因此在对注册功能进行测试时测试过程至少包含对应的注册节点和登陆节点两个测试节点。同时,为了完成对每个操作步骤的测试,在测试节点时都需要根据实际的操作步骤来依次调用对应的界面控件,如登陆节点时需要依次调用信息输入控件、登陆控件以及验证控件。因此为了保证对应用程序的正常有效测试,本申请实施例中需要技术人员根据实际所需测试应用程序的功能,设置好对应的测试节点、每个节点中所需调用的应用程序的界面控件,以及调用的顺序。
其中,应当特别说明地,为了保证测试用例对不同操作系统的终端设备的兼容测试,本申请实施例的测试用例中,并未像现有技术中一样直接以控件标识名的方式记录每个测试节点所需调用的界面控件,而是直接对每个测试节点所需调用的界面控件进行了记录,从而使得后续针对不同操作系统类型的终端设备进行测试时,可以根据记录的界面控件来进行对应控件标识名的界面控件的调用,以实现对不同操作系统的终端设备的兼容测试。
实例说明如下:假设登陆节点需要调用登陆控件,在IOS系统中登陆控件的控件标识名为“Login控件”,在安卓系统中的控件标识名为“LOGIN控件”,现有技术在对测试用例中登陆节点编写对应的界面控件时,对于IOS系统会记录为:调用“Login控件”,对于安卓系统会记录为:调用“LOGIN控件”,以保证测试时对能根据记录的控件标识名直接调用对应的界面控件,保证测试的正常运行。而在本申请实施例中,在测试用例中仅会记录为:调用登陆控件,以使得后续步骤能根据终端设备的操作系统类型来确定出对应的控件标识名,以进行后续的界面控件的调用和测试。
S102,从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与待测试设备的操作系统类型对应的控件标识库。
S103,在筛选出的控件标识库中查找出每个界面控件的控件标识名。
由于应用程序的界面控件在不同的操作系统中的控件标识名有所差异,因此,为了保证对每种不同的操作系统中对界面控件的准确调用,本申请实施例中,会针对每种操作系统设置一个对应的控件标识库,以记录该操作系统中应用程序每个界面控件的控件标识名,如假设对于IOS系统,登陆控件的控件标识名为“Login控件”,此时,本申请实施例会在IOS系统的控件标识库中,记录好登陆控件的控件标识名为“Login控件”。在得到每种操作系统分别对应的控件标识库后,即可得到与待测试的应用程序相关联的多个控件标识库。其中,操作系统类型包括但不限于IOS系统以及安卓系统等。
由于每个操作系统对应的控件标识库中,已经记录好了应用程序每个界面控件的控件标识名,因此在确定出终端设备的操作系统对应的控件标识库之后,只需要直接根据控件标识库来查找界面控件的控件标识名即可,如上述的实例中,当确定出IOS系统对应的控件标识库后,如确定出需要调用登陆控件,此时只需要在IOS系统对应的控件标识库中,查找出登陆控件对应的控件标识名“Login控件”即可。
S104,基于查找出的每个界面控件的控件标识名,在依次运行各个测试节点的过程中,对构成测试节点的界面控件基于调用顺序依次调用,以完成测试用例对应的测试过程。
其中,由于在操作系统中,每个界面控件的命名已经预先设定好,因此在确定出所需调用的界面控件的控件标识名之后,根据控件标识名即可实现对实际所需的界面控件的调用,如假设在IOS系统中登陆控件的控件标识名为“Login控件”,即说明在IOS系统中的待测试的应用程序中,名称为“Login控件”的界面控件即为登陆控件,此时若需要调用登陆控件,只需要查找出名称为“Login控件”的界面控件即可。
在确定出每个界面控件在终端设备的操作系统中对应的控件标识名之后,开始对终端设备中的待测试的应用程序进行测试。此时,只需要根据测试用例中的测试过程依次进行测试即可,若需要调用界面控件,只需要根据确定出来的控件标识名进行调用即可。
以一实例进行说明,如当需要测试应用程序的注册功能,假设注册功能包括注册节点以及登陆节点两个测试节点,其中登录节点需要依次调用信息输入控件、登陆控件以及验证控件,同时假设在IOS系统对应的应用程序的控件标识库中,信息输入控件、登陆控件以及验证控件的控件标识名分别为“Information
input控件”、“Login控件”以及“Validate控件”,且终端设备的操作系统即为IOS系统。
在进行应用程序注册功能测试时,依次进行注册节点和登陆节点的测试,判断是否正常,且在进行登陆节点时,首先需要根据IOS系统的控件标识库,确定出所需调用的信息输入控件、登陆控件以及验证控件的控件标识名分别为“Information
input控件”、“Login控件”以及“Validate控件”,再从应用程序的界面控件中,依次查找出名称为“Information input控件”、“Login控件”以及“Validate控件”的界面控件进行调用,从而完成了对注册节点以及登陆节点的测试,以完成对应用程序注册功能的测试。
在本申请实施例中,通过对终端设备进行操作系统的识别并根据操作系统的不同查找出对应的控件标识库,以确定并对测试用例中待调用界面控件的控件标识名,再基于控件标识名来对已命名的界面控件进行查询调用,从而使得本申请实施例在测试用例中只需要设置所需调用的界面控件,而无需设置其在不同操作系统中具体的控件标识名。因此,即使是不同的操作系统,也可以根据上述操作来确定出对应的待测试界面控件,并进行相应的测试,从而实现了使用一个测试用例对不同操作系统的终端设备进行相同应用程序功能的兼容测试。
作为本申请实施例二,如图2所示,在对测试用例进行解析时,包括:
S1011,识别测试用例的格式类型,格式类型包括Excel格式、YAML格式以及脚本格式。
S1012,基于预设的格式类型对应的解析工具对测试用例进行解析,确定出构成测试用例对应的测试过程的各个测试节点,以及获取每个测试节点在运行过程中所调用的界面控件及每个界面控件对应的调用顺序。由于实际应用中负责编写测试用例的用户的习惯、水平等各不相同,而不同格式的测试用例的编写难度和运行速度之间也存在差异,如编写难度YAML格式>Excel格式>脚本格式,且一般编写难度越大,运行速度越高,测试效率也越高,因此为了满足不同用户的实际需求,本申请实施例增加了对各种不同格式的测试用例的同步支持功能,用户只需根据自己的需求选取对应格式的测试用例进行编写即可。其中,由于对不同格式的测试脚本的解析属于现有技术,因此,在进行解析工具预设时,只需要选取一些对应的现有的解析工具即可,此处不予赘述限定。
作为本申请实施例三,如图3所示,考虑到实际情况中,对测试用例的编写往往具有较高的技术门槛,普通用户可能难以实现,因此为了降低对用户测试用例编写的难度,使得不同用户均可根据自己实际需求进行应用程序的测试,本申请实施例中,在解析测试用例之前,还包括:S301,获取测试用例录制指令,并确定出待测试应用程序包含的界面控件。
在本申请实施例中,测试用例录制指令用于触发移动终端对脚本的录制开始,录制停止指令用于终止移动终端对测试用例的录制,通过测试用例录制指令以及录制停止指令,可以实现对测试用例录制始终的控制,以生成对应所需的测试用例。其中,测试用例录制指令以及录制停止指令,既可以由用户手动输入的,也可以是由其他预设的触发条件生成,如设置定时机制,定时自动生成测试用例录制指令以及录制停止指令以完成对测试用例的录制。
移动终端开始进行测试用例录制的模式,此时首先会确定出应用程序中所包含的所有界面控件,如在使用Uiautomator作为测试工具时,可以根据元素的text、hint、contentDescription等属性,利用findObject()方法来查找到应用程序包含的界面控件。
S302,记录待测试应用程序在对用户输入的操作指令响应过程中,界面控件对应的响应数据。其中,界面控件对应响应数据是指界面控件对用户操作行为进行响应时产生的数据,以及对应的用户操作行为的时间,如用户视频播放应用程序在视频播放时进行了1.5倍的快进操作,此时快进按钮控件会响应执行1.5倍的快进操作,此时快进按钮控件对应的响应数据就是1.5倍的快进倍率以及用户快进操作时的时间。
用户在对应用程序进行操作时,界面控件会对用户的操作行为进行响应,从而实现应用程序的各个功能对用户操作的响应,如视频播放应用程序中用户若在录制时点击了播放/暂停按钮,对应的播放/暂停按钮控件执行播放/暂停功能任务,因此,此时对界面控件的响应数据进行记录,即可知道在用户的操作过程中应用程序都在何时执行了一些什么功能,以便后续对用户操作的准确回放。
S303,获取录制停止指令,并基于记录的界面控件对应的响应数据进行分析,生成测试用例。
在用户完成对应用程序的操作行为后,在测试工具中输入相应的录制停止指令,或者由满足触发条件时,自动生成录制停止指令,即可停止对用户操作行为的录制,并会将录制得到的界面控件的响应数据进行处理,得到相应的测试用例,以为后续应用程序测试作为基础。如用户录制期间完成对视频播放应用程序的播放/暂停/快进/停止功能操作后,得到了对应界面控件的响应数据之后,根据这些响应数据生成测试用例,以记录用户对应用程序的操作。
作为本申请实施例四,如图4所示,为了后续对控件标识库的准确选择,需要在解析测试用例之前,识别待测试设备的操作系统,具体包括:
S401,建立与待测试设备的通信,并基于adb工具以及instruments工具,分别获取待测试设备的物理地址。
S402,若adb工具成功获取到物理地址,则判定待测试设备的操作系统类型为安卓系统。
S403,若instruments工具成功获取到物理地址,则判定待测试设备的操作系统类型为IOS系统。
在连接好终端设备之后,为了识别出终端设备的操作系统类型,本申请实施例会利用adb工具以及instruments工具来分别尝试获取终端设备的物理地址,由于adb工具仅能与安卓系统正常进行通信并实现物理地址的获取,因此当adb工具成功获取到物理地址则说明该测连接的终端设备是安卓系统的设备。反之,若instruments工具成功获取到物理地址则说明该测连接的终端设备是IOS系统的设备。其中,由于adb工具和instruments工具均是现有的测试工具,因此,关于两个工具的相关说明,此处不予赘述,感兴趣的读者可自行查阅相关资料。
作为本申请实施例五,如图5所示,考虑到单台终端设备的测试偶然性较大,及时得到了测试异常的结果,也一定就是待测试的应用程序本身的问题,也有可能是待测试的终端设备或者其他环境因素的影响,因此,为了提升对测试的有效性,保证得到的测试结果的准确有效,本申请实施例中,在完成测试用例对应的测试过程之后,还包括:
S501,对测试得到的测试数据进行分析,判断待测试应用程序的测试结果是否存在异常。其中,存在异常的具体标准可由技术人员自行设定,包括但不限于如,对测试得到的测试数据中的每个参数,都预先设置一个正常数据范围,并在测试完成后,对测试得到的测试数据中的每个参数分别进行校验,判断是否处于正常数据范围,若存在不处于的,则判定结测试结果为存在异常。
S502,若判断结果为待测试应用程序的测试结果存在异常,从在线的待测试设备组中筛选出与待测试设备的操作系统版本相同的多个待测试设备。
S503,基于测试用例,对多个待测试设备进行测试。
由于操作系统版本相同,说明应用程序运行的软件环境是相同的,如都是安卓7.0版本的终端设备,因此,为了排除单台终端设备的偶然因素导致的测试异常,本申请实施例会对所有操作系统版本相同的终端设备,再次进行相同的测试,以验证最终的测试结果如何,为应用程序测试的准确有效提供保障。
作为本申请的一个优选实施例,在完成对应用程序的测试后,还包括:根据用户设定的待测试指标,对得到的测试数据进行分析,得到每个待测试指标对应的指标测试结果。
由于不同的用户测试的需求存在差异,如有些是想看看应用程序的某个功能是否正常,有些是想看看应用程序在运行过程中,对终端设备的性能占用情况如何。因此,为了满足用户的实际需求,本申请实施例中,用户可以自行设置所需测试分析的指标,如功能稳定性、内存占有率以及耗电速度等指标。在完成对应用程序的测试后,本申请实施例会根据得到的测试数据,对用户设置所需分析的指标进行分析,以得到对应的指标测试结果,如应用程序运行过程中对内存的占有率,此时可以对测试过程中,应用程序对终端设备内存的占有率进行记录,并整理生成内存占有率性能曲线等。
图6示出了本申请实施例六提供的应用程序测试方法的实现流程图,由于本申请实施例一中针对的都是单台终端设备的测试,实现了无论单台终端设备安装的是何种操作系统,均可实现对其的应用程序功能的兼容想测试,但考虑到实际情况中,为了提高对终端设备测试的效率,经常会批量对终端设备进行,因此,此时为了满足一次性对多台操作系统可能不同的终端设备的兼容性测试,本申请实施例提出了一种可以对多台终端设备同时进行测试的技术方案,详述如下:
S601,解析测试用例,获取构成测试用例对应的测试过程的各个测试节点,以及获取每个测试节点在运行过程中所调用的界面控件及每个界面控件对应的调用顺序。
S602,从与待测试应用程序关联的多个控件标识库中,筛选出与在线的N个待测试设备的操作系统类型分别对应的N个控件标识库,N个待测试设备中均安装有待测试应用程序,其中,N为大于1的正整数。
S603,基于筛选出的N个控件标识库,查询出每个待测试设备中界面控件的控件标识名。
S604,基于查找出的每个界面控件的控件标识名,在每个待测试设备依次运行各个测试节点的过程中,对构成测试节点的界面控件基于调用顺序依次调用,以完成每个待测试设备中测试用例对应的测试过程。
在本申请实施例中,针对每台终端设备的测试方法与本申请实施例一中相同,因此,此处不予赘述,与本申请实施例不同之处在于,本申请实施例六会同时对在线的每台终端设备,分别基于操作系统进行控件标识库的筛选以及控件标识名的查找,并会根据查找结果,分别对每台终端设备分别进行测试节点的界面控件的调用测试,以完成同时对多台操作系统可能不同的终端设备的兼容测试,极大地满足用户的实际需求。
应当说明地,在本申请实施例六的基础上,上述本申请实施例二至本申请实施例四,同样可以适用于多台操作系统可能不同的终端设备的测试,具体可参考上述本申请实施例的相关说明,此处不予赘述。
对应于上文实施例的方法,图7示出了本申请实施例提供的应用程序测试装置的结构框图,为了便于说明,仅示出了与本申请实施例相关的部分。图7示例的应用程序测试装置可以是前述实施例一提供的应用程序测试方法的执行主体。
参照图7,该应用程序测试装置包括:
用例解析模块71,用于解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序。
标识库筛选模块72,用于从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库。
标识名查询模块73,用于在筛选出的所述控件标识库中查找出每个所述界面控件的控件标识名。
测试模块74,用于基于查找出的每个所述界面控件的控件标识名,在依次运行各个所述测试节点的过程中,对构成所述测试节点的界面控件基于所述调用顺序依次调用,以完成所述测试用例对应的测试过程。
进一步地,用例解析模块71,包括:
格式识别模块,用于识别所述测试用例的格式类型,所述格式类型包括Excel格式、YAML格式以及脚本格式。
格式用例解析模块,用于基于预设的所述格式类型对应的解析工具对所述测试用例进行解析,确定出构成所述测试用例对应的测试过程的各个所述测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的所述调用顺序。
进一步地,该应用程序测试装置,还包括:
获取测试用例录制指令,并确定出所述待测试应用程序包含的界面控件。
记录所述待测试应用程序在对用户输入的操作指令响应过程中,所述界面控件对应的响应数据。
获取录制停止指令,并基于记录的所述界面控件对应的响应数据进行分析,生成所述测试用例。
进一步地,该应用程序测试装置,还包括:
建立与所述待测试设备的通信,并基于adb工具以及instruments工具,分别获取所述待测试设备的物理地址。
若所述adb工具成功获取到所述物理地址,则判定所述待测试设备的所述操作系统类型为安卓系统。
若所述instruments工具成功获取到所述物理地址,则判定所述待测试设备的所述操作系统类型为IOS系统。
进一步地,该应用程序测试装置,还包括:
对测试得到的测试数据进行分析,判断所述待测试应用程序的测试结果是否存在异常。
若判断结果为所述待测试应用程序的所述测试结果存在异常,从在线的待测试设备组中筛选出与所述待测试设备的操作系统版本相同的多个待测试设备。
基于所述测试用例,对所述多个待测试设备进行测试。
本申请实施例提供的应用程序测试装置中各模块实现各自功能的过程,具体可参考前述图1所示实施例一的描述,此处不再赘述。
应理解,上述实施例中各节点的序号的大小并不意味着执行顺序的先后,各过程的执行顺序应以其功能和内在逻辑确定,而不应对本申请实施例的实施过程构成任何限定。还应理解的,虽然术语“第一”、“第二”等在文本中在一些本申请实施例中用来描述各种元素,但是这些元素不应该受到这些术语的限制。这些术语只是用来将一个元素与另一元素区分开。例如,第一接触可以被命名为第二接触,并且类似地,第二接触可以被命名为第一接触,而不背离各种所描述的实施例的范围。第一接触和第二接触都是接触,但是它们不是同一接触。
图8是本申请一实施例提供的终端设备的示意图。如图8所示,该实施例的终端设备8包括:处理器80、存储器81,所述存储器81中存储有可在所述处理器80上运行的计算机可读指令82。所述处理器80执行所述计算机可读指令82时实现上述各个应用程序测试方法实施例中的节点,例如图1所示的节点101至104。或者,所述处理器80执行所述计算机可读指令82时实现上述各装置实施例中各模块/单元的功能,例如图7所示模块71至74的功能。所述终端设备8可以是桌上型计算机、笔记本、掌上电脑及云端服务器等计算设备。所述终端设备可包括,但不仅限于,处理器80、存储器81。本领域技术人员可以理解,图8仅仅是终端设备8的示例,并不构成对终端设备8的限定,可以包括比图示更多或更少的部件,或者组合某些部件,或者不同的部件,例如所述终端设备还可以包括输入发送设备、网络接入设备、总线等。
所称处理器80可以是中央处理单元(Central
Processing Unit,CPU),还可以是其他通用处理器、数字信号处理器(Digital Signal Processor,DSP)、专用集成电路(Application
Specific Integrated Circuit,ASIC)、现成可编程门阵列(Field-Programmable Gate Array,FPGA)或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。通用处理器可以是微处理器或者该处理器也可以是任何常规的处理器等。所述存储器81可以是所述终端设备8的内部存储单元,例如终端设备8的硬盘或内存。所述存储器81也可以是所述终端设备8的外部存储设备,例如所述终端设备8上配备的插接式硬盘,智能存储卡(Smart
Media Card,SMC),安全数字(Secure
Digital,SD)卡,闪存卡(Flash
Card)等。进一步地,所述存储器81还可以既包括所述终端设备8的内部存储单元也包括外部存储设备。所述存储器81用于存储所述计算机可读指令以及所述终端设备所需的其他程序和数据。所述存储器81还可以用于暂时地存储已经发送或者将要发送的数据。
另外,在本申请各个实施例中的各功能单元可以集成在一个处理单元中,也可以是各个单元单独物理存在,也可以两个或两个以上单元集成在一个单元中。上述集成的单元既可以采用硬件的形式实现,也可以采用软件功能单元的形式实现。
所述集成的模块/单元如果以软件功能单元的形式实现并作为独立的产品销售或使用时,可以存储在一个计算机可读取存储介质中。基于这样的理解,本申请实现上述实施例方法中的全部或部分流程,也可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一计算机可读存储介质中,该计算机可读指令在被处理器执行时,可实现上述各个方法实施例的节点。其中,所述计算机可读指令包括计算机可读指令代码,所述计算机可读指令代码可以为源代码形式、对象代码形式、可执行文件或某些中间形式等。所述计算机可读介质可以包括:能够携带所述计算机可读指令代码的任何实体或装置、记录介质、U盘、移动硬盘、磁碟、光盘、计算机存储器、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access
Memory,RAM)、电载波信号、电信信号以及软件分发介质等。需要说明的是,所述计算机可读介质包含的内容可以根据司法管辖区内立法和专利实践的要求进行适当的增减,例如在某些司法管辖区,根据立法和专利实践,计算机可读介质不包括电载波信号和电信信号。
以上所述实施例仅用以说明本申请的技术方案,而非对其限制;尽管参照前述实施例对本申请进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使对应技术方案的本质脱离本申请各实施例技术方案的精神和范围,均应包含在本申请的保护范围之内。
Claims (20)
- 一种应用程序测试方法,其特征在于,包括:解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序;从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库;在筛选出的所述控件标识库中查找出每个所述界面控件的控件标识名;基于查找出的每个所述界面控件的控件标识名,在依次运行各个所述测试节点的过程中,对构成所述测试节点的界面控件基于所述调用顺序依次调用,以完成所述测试用例对应的测试过程。
- 如权利要求1所述的应用程序测试方法,其特征在于,所述解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序,包括:识别所述测试用例的格式类型,所述格式类型包括Excel格式、YAML格式以及脚本格式;基于预设的所述格式类型对应的解析工具对所述测试用例进行解析,确定出构成所述测试用例对应的测试过程的各个所述测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的所述调用顺序。
- 如权利要求1或2所述的应用程序测试方法,其特征在于,在所述解析测试用例之前,还包括:获取测试用例录制指令,并确定出所述待测试应用程序包含的界面控件;记录所述待测试应用程序在对用户输入的操作指令响应过程中,所述界面控件对应的响应数据;获取录制停止指令,并基于记录的所述界面控件对应的响应数据进行分析,生成所述测试用例。
- 如权利要求1所述的应用程序测试方法,其特征在于,在所述从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库之前,还包括:建立与所述待测试设备的通信,并基于adb工具以及instruments工具,分别获取所述待测试设备的物理地址;若所述adb工具成功获取到所述物理地址,则判定所述待测试设备的所述操作系统类型为安卓系统;若所述instruments工具成功获取到所述物理地址,则判定所述待测试设备的所述操作系统类型为IOS系统。
- 如权利要求1所述的应用程序测试方法,其特征在于,在所述完成所述测试用例对应的测试过程之后,还包括:解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序;从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库;在筛选出的所述控件标识库中查找出每个所述界面控件的控件标识名;基于查找出的每个所述界面控件的控件标识名,在依次运行各个所述测试节点的过程中,对构成所述测试节点的界面控件基于所述调用顺序依次调用,以完成所述测试用例对应的测试过程。
- 一种应用程序测试装置,其特征在于,包括:用例解析模块,用于解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序;标识库筛选模块,用于从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库;标识名查询模块,用于在筛选出的所述控件标识库中查找出每个所述界面控件的控件标识名;测试模块,用于基于查找出的每个所述界面控件的控件标识名,在依次运行各个所述测试节点的过程中,对构成所述测试节点的界面控件基于所述调用顺序依次调用,以完成所述测试用例对应的测试过程。
- 如权利要求6所述的应用程序测试装置,其特征在于,所述用例解析模块,包括:格式识别模块,用于识别所述测试用例的格式类型,所述格式类型包括Excel格式、YAML格式以及脚本格式;格式用例解析模块,用于基于预设的所述格式类型对应的解析工具对所述测试用例进行解析,确定出构成所述测试用例对应的测试过程的各个所述测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的所述调用顺序。
- 如权利要求6或7所述的应用程序测试装置,其特征在于,还包括:控件确定模块,用于获取测试用例录制指令,并确定出所述待测试应用程序包含的界面控件;数据记录模块,用于记录所述待测试应用程序在对用户输入的操作指令响应过程中,所述界面控件对应的响应数据;用例生成模块,用于获取录制停止指令,并基于记录的所述界面控件对应的响应数据进行分析,生成所述测试用例。
- 如权利要求6所述的应用程序测试装置,其特征在于,还包括:通信建立模块,用于建立与所述待测试设备的通信,并基于adb工具以及instruments工具,分别获取所述待测试设备的物理地址;第一判定模块,用于若所述adb工具成功获取到所述物理地址,则判定所述待测试设备的所述操作系统类型为安卓系统;第二判定模块,用于若所述instruments工具成功获取到所述物理地址,则判定所述待测试设备的所述操作系统类型为IOS系统。
- 如权利要求6所述的应用程序测试装置,其特征在于,还包括:结果监测模块,用于对测试得到的测试数据进行分析,判断所述待测试应用程序的测试结果是否存在异常;设备筛选模块,用于若判断结果为所述待测试应用程序的所述测试结果存在异常,从在线的待测试设备组中筛选出与所述待测试设备的操作系统版本相同的多个待测试设备;多设备测试模块,用于基于所述测试用例,对所述多个待测试设备进行测试。
- 一种终端设备,其特征在于,所述终端设备包括存储器、处理器,所述存储器上存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序;从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库;在筛选出的所述控件标识库中查找出每个所述界面控件的控件标识名;基于查找出的每个所述界面控件的控件标识名,在依次运行各个所述测试节点的过程中,对构成所述测试节点的界面控件基于所述调用顺序依次调用,以完成所述测试用例对应的测试过程。
- 如权利要求11所述的终端设备,其特征在于,所述解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序,包括:识别所述测试用例的格式类型,所述格式类型包括Excel格式、YAML格式以及脚本格式;基于预设的所述格式类型对应的解析工具对所述测试用例进行解析,确定出构成所述测试用例对应的测试过程的各个所述测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的所述调用顺序。
- 如权利要求11或12所述的终端设备,其特征在于,在所述解析测试用例之前,还包括:获取测试用例录制指令,并确定出所述待测试应用程序包含的界面控件;记录所述待测试应用程序在对用户输入的操作指令响应过程中,所述界面控件对应的响应数据;获取录制停止指令,并基于记录的所述界面控件对应的响应数据进行分析,生成所述测试用例。
- 如权利要求11所述的终端设备,其特征在于,在所述从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库之前,还包括:建立与所述待测试设备的通信,并基于adb工具以及instruments工具,分别获取所述待测试设备的物理地址;若所述adb工具成功获取到所述物理地址,则判定所述待测试设备的所述操作系统类型为安卓系统;若所述instruments工具成功获取到所述物理地址,则判定所述待测试设备的所述操作系统类型为IOS系统。
- 如权利要求11所述的终端设备,其特征在于,在所述完成所述测试用例对应的测试过程之后,还包括:对测试得到的测试数据进行分析,判断所述待测试应用程序的测试结果是否存在异常;若判断结果为所述待测试应用程序的所述测试结果存在异常,从在线的待测试设备组中筛选出与所述待测试设备的操作系统版本相同的多个待测试设备;基于所述测试用例,对所述多个待测试设备进行测试。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被至少一个处理器执行时实现如下步骤:解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序;从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库;在筛选出的所述控件标识库中查找出每个所述界面控件的控件标识名;基于查找出的每个所述界面控件的控件标识名,在依次运行各个所述测试节点的过程中,对构成所述测试节点的界面控件基于所述调用顺序依次调用,以完成所述测试用例对应的测试过程。
- 根据权利要求16所述的计算机可读存储介质,其特征在于,所述解析测试用例,获取构成所述测试用例对应的测试过程的各个测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的调用顺序,包括:识别所述测试用例的格式类型,所述格式类型包括Excel格式、YAML格式以及脚本格式;基于预设的所述格式类型对应的解析工具对所述测试用例进行解析,确定出构成所述测试用例对应的测试过程的各个所述测试节点,以及获取每个所述测试节点在运行过程中所调用的界面控件及每个所述界面控件对应的所述调用顺序。
- 根据权利要求16或17所述的计算机可读存储介质,其特征在于,在所述解析测试用例之前,还包括:获取测试用例录制指令,并确定出所述待测试应用程序包含的界面控件;记录所述待测试应用程序在对用户输入的操作指令响应过程中,所述界面控件对应的响应数据;获取录制停止指令,并基于记录的所述界面控件对应的响应数据进行分析,生成所述测试用例。
- 根据权利要求16所述的计算机可读存储介质,其特征在于,在所述从与待测试设备中的待测试应用程序关联的多个控件标识库中,筛选出与所述待测试设备的操作系统类型对应的所述控件标识库之前,还包括:建立与所述待测试设备的通信,并基于adb工具以及instruments工具,分别获取所述待测试设备的物理地址;若所述adb工具成功获取到所述物理地址,则判定所述待测试设备的所述操作系统类型为安卓系统;若所述instruments工具成功获取到所述物理地址,则判定所述待测试设备的所述操作系统类型为IOS系统。
- 根据权利要求16所述的计算机可读存储介质,其特征在于,在所述完成所述测试用例对应的测试过程之后,还包括:对测试得到的测试数据进行分析,判断所述待测试应用程序的测试结果是否存在异常;若判断结果为所述待测试应用程序的所述测试结果存在异常,从在线的待测试设备组中筛选出与所述待测试设备的操作系统版本相同的多个待测试设备;基于所述测试用例,对所述多个待测试设备进行测试。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201810554464.5 | 2018-06-01 | ||
| CN201810554464.5A CN108984389B (zh) | 2018-06-01 | 2018-06-01 | 一种应用程序测试方法及终端设备 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2019227641A1 true WO2019227641A1 (zh) | 2019-12-05 |
Family
ID=64540400
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2018/097110 Ceased WO2019227641A1 (zh) | 2018-06-01 | 2018-07-25 | 一种应用程序测试方法、装置、终端设备及介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN108984389B (zh) |
| WO (1) | WO2019227641A1 (zh) |
Cited By (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113094257A (zh) * | 2021-03-08 | 2021-07-09 | 上海硬通网络科技有限公司 | 应用测试方法、装置及电子设备 |
Families Citing this family (14)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN109783356A (zh) * | 2018-12-14 | 2019-05-21 | 深圳壹账通智能科技有限公司 | 一种自动化测试方法及终端 |
| CN109871326B (zh) * | 2019-02-13 | 2022-03-15 | 北京云测信息技术有限公司 | 一种脚本录制的方法和装置 |
| CN110286958B (zh) * | 2019-06-20 | 2021-10-29 | 腾讯科技(深圳)有限公司 | 节点信息获取方法、装置及存储介质 |
| CN110413518B (zh) * | 2019-07-17 | 2023-11-14 | 深圳证券交易所 | 控件对象库的生成方法及生成装置和计算机可读存储介质 |
| CN112241361B (zh) * | 2019-07-19 | 2025-01-14 | 北京搜狗科技发展有限公司 | 测试用例生成方法及装置、问题场景自动复现方法及装置 |
| CN110716869B (zh) * | 2019-09-18 | 2024-05-14 | 平安科技(深圳)有限公司 | 测试用例生成方法、装置、电子设备及计算机可读存储介质 |
| CN110704148B (zh) * | 2019-09-20 | 2023-09-05 | 广州虎牙科技有限公司 | 设备页面元素的获取方法、装置、服务器及存储介质 |
| CN111694752B (zh) * | 2020-07-28 | 2023-09-05 | 中移(杭州)信息技术有限公司 | 应用测试方法、电子设备及存储介质 |
| CN112650683B (zh) * | 2020-12-28 | 2024-06-14 | 京东科技控股股份有限公司 | 程序测试方法、设备以及存储介质 |
| CN114911688B (zh) * | 2021-02-09 | 2025-01-28 | 广州视源电子科技股份有限公司 | 界面设计自动化测试方法、装置、终端设备和存储介质 |
| CN113014996B (zh) * | 2021-02-18 | 2022-07-22 | 上海哔哩哔哩科技有限公司 | 视频生成方法及装置 |
| CN113010359B (zh) * | 2021-03-26 | 2023-03-17 | 西安航空电子科技有限公司 | 总线测试系统生成方法、系统、设备及存储介质 |
| CN115421819A (zh) * | 2022-09-29 | 2022-12-02 | 中国农业银行股份有限公司 | 用于模拟目标系统的人机交互的实现方法、装置及设备 |
| CN116303009A (zh) * | 2023-03-03 | 2023-06-23 | 网易(杭州)网络有限公司 | 界面测试方法、装置和电子设备 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103309797A (zh) * | 2012-03-09 | 2013-09-18 | 阿里巴巴集团控股有限公司 | 用户界面自动化测试方法及装置 |
| CN104216828A (zh) * | 2013-06-03 | 2014-12-17 | 刘伟 | 一种对被测应用程序进行功能遍历的测试方法 |
| CN104978266A (zh) * | 2014-04-11 | 2015-10-14 | 腾讯科技(深圳)有限公司 | 一种应用测试方法和装置 |
| CN105095062A (zh) * | 2014-05-09 | 2015-11-25 | 腾讯科技(深圳)有限公司 | 应用程序测试方法及系统 |
| US20180129595A1 (en) * | 2016-11-09 | 2018-05-10 | Rsupport Co., Ltd. | Method of automatically testing smart device application program using permission booster |
Family Cites Families (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US9111030B1 (en) * | 2008-10-03 | 2015-08-18 | Federal Home Loan Mortgage Corporation | Systems and methods for testing a software application |
| CN102681841A (zh) * | 2012-02-01 | 2012-09-19 | 中兴通讯(香港)有限公司 | 一种手机应用开发方法和系统 |
| US11003570B2 (en) * | 2014-04-30 | 2021-05-11 | Micro Focus Llc | Performing a mirror test for localization testing |
| US9547514B2 (en) * | 2014-05-23 | 2017-01-17 | Vmware, Inc. | Maintaining virtual hardware device ID in a virtual machine |
| CN104965790B (zh) * | 2015-07-17 | 2018-04-27 | 小米科技有限责任公司 | 基于关键字驱动的软件测试方法及系统 |
| CN105511864A (zh) * | 2015-11-30 | 2016-04-20 | 青岛海信移动通信技术股份有限公司 | 一种资源定位方法及装置 |
| CN107329898A (zh) * | 2017-06-30 | 2017-11-07 | 上海摩软通讯技术有限公司 | 终端界面自动化测试方法及系统 |
-
2018
- 2018-06-01 CN CN201810554464.5A patent/CN108984389B/zh active Active
- 2018-07-25 WO PCT/CN2018/097110 patent/WO2019227641A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103309797A (zh) * | 2012-03-09 | 2013-09-18 | 阿里巴巴集团控股有限公司 | 用户界面自动化测试方法及装置 |
| CN104216828A (zh) * | 2013-06-03 | 2014-12-17 | 刘伟 | 一种对被测应用程序进行功能遍历的测试方法 |
| CN104978266A (zh) * | 2014-04-11 | 2015-10-14 | 腾讯科技(深圳)有限公司 | 一种应用测试方法和装置 |
| CN105095062A (zh) * | 2014-05-09 | 2015-11-25 | 腾讯科技(深圳)有限公司 | 应用程序测试方法及系统 |
| US20180129595A1 (en) * | 2016-11-09 | 2018-05-10 | Rsupport Co., Ltd. | Method of automatically testing smart device application program using permission booster |
Cited By (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN113094257A (zh) * | 2021-03-08 | 2021-07-09 | 上海硬通网络科技有限公司 | 应用测试方法、装置及电子设备 |
| CN113094257B (zh) * | 2021-03-08 | 2024-04-05 | 上海硬通网络科技有限公司 | 应用测试方法、装置及电子设备 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN108984389B (zh) | 2021-04-09 |
| CN108984389A (zh) | 2018-12-11 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| WO2019227641A1 (zh) | 一种应用程序测试方法、装置、终端设备及介质 | |
| CN107665171B (zh) | 自动回归测试方法及装置 | |
| WO2019218458A1 (zh) | 一种应用程序测试方法、装置、移动终端及介质 | |
| CN108170465B (zh) | 一种版本信息管理方法、电子设备及可读存储介质 | |
| WO2019218464A1 (zh) | 一种应用程序测试方法、装置、移动终端及介质 | |
| CN112231232B (zh) | 确定测试数据模型及生成测试数据的方法、装置及设备 | |
| CN109815141B (zh) | 一种测试方法和装置 | |
| CN111274130A (zh) | 一种自动化测试方法、装置、设备及存储介质 | |
| CN114064510A (zh) | 功能测试方法、装置、电子设备和存储介质 | |
| CN110362469A (zh) | 基于模块化测试用例控制方法、装置、终端与存储介质 | |
| CN116204438A (zh) | 测试用例生成方法、自动化测试方法和相关装置 | |
| CN113055760B (zh) | 日志处理方法、装置、设备和存储介质 | |
| CN113886221B (zh) | 测试脚本生成方法、装置、存储介质及电子设备 | |
| CN112241362A (zh) | 一种测试方法、装置、服务器及存储介质 | |
| WO2022083236A1 (zh) | 动画视频备份方法及其装置、管理方法及其装置 | |
| CN113010587B (zh) | 数据源配置方法、装置、终端、服务器及介质 | |
| WO2019218466A1 (zh) | 一种应用程序测试方法、装置、终端设备及介质 | |
| CN108255715B (zh) | 一种测试结果处理方法及终端设备 | |
| CN115622643A (zh) | 无线通信功能测试方法、设备及存储介质 | |
| CN115421749A (zh) | 一种基于Linux系统的硬盘固件刷新方法、系统、装置及介质 | |
| CN108228611B (zh) | 单据信息抄写方法和装置 | |
| CN113760696A (zh) | 一种程序问题定位方法、装置、电子设备和存储介质 | |
| CN109408368B (zh) | 一种测试辅助信息的输出方法、存储介质和服务器 | |
| CN106227502A (zh) | 一种获取硬盘固件版本的方法及装置 | |
| CN117033210A (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: 18921183 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: 18921183 Country of ref document: EP Kind code of ref document: A1 |