WO2019019955A1 - 手势测试方法、装置、计算机设备和存储介质 - Google Patents

手势测试方法、装置、计算机设备和存储介质 Download PDF

Info

Publication number
WO2019019955A1
WO2019019955A1 PCT/CN2018/096373 CN2018096373W WO2019019955A1 WO 2019019955 A1 WO2019019955 A1 WO 2019019955A1 CN 2018096373 W CN2018096373 W CN 2018096373W WO 2019019955 A1 WO2019019955 A1 WO 2019019955A1
Authority
WO
WIPO (PCT)
Prior art keywords
gesture
test
test script
script
gesture test
Prior art date
Application number
PCT/CN2018/096373
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 WO2019019955A1 publication Critical patent/WO2019019955A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/017Gesture based interaction, e.g. based on a set of recognized hand gestures

Definitions

  • the present application relates to the field of testing, and in particular to gesture testing methods, apparatus, computer equipment, and storage media.
  • test the application Before the application is put into use, it is usually necessary to test the performance of the software through testing. For example, test the application to output a preset result by long pressing the controls on the user interface. With the rapid iteration of demand, it has become an inevitable requirement to translate human-driven test behavior into automated testing of machine execution.
  • the technician when conducting automated testing, the technician first needs to write a test script according to the test requirements, and then use the automated test tool to execute the test script for testing.
  • the prior art has the following problems: the current automation framework does not have a test method specifically for gesture passwords, so each time the gesture test, the technician The need to manually write a large amount of code, the workload is large, which reduces the efficiency of the test.
  • a gesture testing method In accordance with various embodiments disclosed herein, a gesture testing method, apparatus, computer device, and storage medium are provided.
  • a gesture testing method includes: receiving a gesture test request, the gesture test request carrying a gesture identifier; acquiring a gesture test script according to the gesture identifier, wherein the gesture test script is based on the control information of the input gesture
  • the sequence and the gesture test script generate template generation; perform a gesture test on the tested application according to the gesture test script, where the gesture test script includes an action instruction sequence for simulating the input gesture, and the action instruction sequence sequentially includes a a start instruction of the input gesture invokes a test instruction that operates by clicking a click event function, and a test instruction that sequentially invokes a sliding event function between adjacent controls of the input gesture; and acquires a gesture corresponding to the gesture test script Test Results.
  • a gesture testing device includes: a test request receiving unit, configured to receive a gesture test request, the gesture test request carrying a gesture identifier, and a script obtaining unit, configured to acquire a gesture test script according to the gesture identifier,
  • the gesture test script generates a template according to the control information sequence of the input gesture and the gesture test script
  • the gesture test unit is configured to perform a gesture test on the tested application according to the gesture test script
  • the gesture test script includes Simulating a sequence of action instructions of the input gesture, the sequence of action instructions sequentially including a test command for invoking a click event function of a start control of the input gesture and sequentially calling a slide between adjacent controls of the input gesture
  • the test function is operated by the event function; and the test result obtaining unit is configured to obtain the gesture test result corresponding to the gesture test script.
  • a computer apparatus comprising a memory and one or more processors having stored therein computer readable instructions that, when executed by a processor, implement the steps of the gesture testing method provided in any one of the embodiments of the present application. .
  • One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to be implemented in any one embodiment of the present application The steps provided by the gesture test method.
  • FIG. 1 is an implementation environment diagram of a gesture testing method provided in accordance with one or more embodiments
  • FIG. 2 is a block diagram showing the internal structure of a computer device in accordance with one or more embodiments
  • FIG. 3 is a flow chart of a gesture testing method in accordance with one or more embodiments.
  • FIG. 4 is a flow chart of performing a gesture test on a test application according to a gesture test script according to one or more embodiments
  • FIG. 5 is a flowchart of obtaining a gesture test result corresponding to a gesture test script according to one or more embodiments
  • Figure 6 is a flow chart of a gesture test method in an embodiment of another embodiment
  • Figure 7 is a schematic illustration of an input gesture in accordance with one or more embodiments.
  • FIG. 8 is a structural block diagram of a gesture testing apparatus according to one or more embodiments.
  • Figure 9 is a block diagram showing the structure of a gesture test unit in accordance with one or more embodiments.
  • Figure 10 is a block diagram showing the structure of a test result acquisition unit in accordance with one or more embodiments.
  • FIG. 11 is a structural block diagram of a gesture testing apparatus in an embodiment of another embodiment.
  • first may be referred to as a second gesture test script without departing from the scope of the present application, and similarly, the second gesture test script may be referred to as a second gesture test. script.
  • FIG. 1 is an application environment diagram of a gesture testing method provided in an embodiment, as shown in FIG. 1 , in which the computer device 110 and the terminal 120 are included.
  • the computer device 110 is a test device, such as a computer device such as a computer used by a tester.
  • the computer device 110 is equipped with an automated test tool, such as Appium.
  • a test application that needs to perform a gesture test is installed on the terminal 120.
  • the tester can issue a gesture test request to the computer device 110.
  • the gesture test request carries a gesture identifier, and the computer device 110 receives the gesture test request.
  • a gesture test script corresponding to the gesture identifier in the computer device 110 is obtained according to the gesture identifier. Then, the gesture test script is executed by using an automated test tool, and the tested application on the terminal 120 is tested, and the gesture test result corresponding to the gesture test script is obtained.
  • the terminal 120 and the computer device 110 may be a smart phone, a tablet computer, a notebook computer, a desktop computer, etc., but are not limited thereto.
  • the computer device 110 and the terminal 120 can be connected through a Bluetooth, a USB (Universal Serial Bus) or other communication connection.
  • the application is not limited herein.
  • a computer device which may be a server or a terminal, which is connected to a processor, a non-volatile storage medium, an internal memory, and a network interface through a system connection bus.
  • the non-volatile storage medium can be a non-transitory computer readable storage medium.
  • the non-volatile storage medium of the computer device can store an operating system and computer readable instructions that, when executed, cause the processor to perform a gesture testing method.
  • the processor of the computer device is used to provide computing and control capabilities to support the operation of the entire computer device.
  • the internal memory can store computer readable instructions that, when executed by the processor, cause the processor to perform a gesture test method.
  • the network interface of the computer device is used for network communication, such as receiving a gesture test request.
  • a gesture test method is provided, which may be applied to the computer device 110, and may specifically include the following steps:
  • Step 302 Receive a gesture test request, where the gesture test request carries a gesture identifier
  • the gesture identifier is used to identify the gesture, and may be composed of characters such as characters and numbers, or may be other identifiers that can identify the gesture.
  • the gesture identifiers can be one or multiple.
  • the execution order of the gesture test script corresponding to the gesture identifier may also be acquired while acquiring the gesture identifier. For example, when the tester inputs the first gesture identifier and the second gesture identifier, the tester can input the execution order of their corresponding gesture test scripts.
  • the computer device 110 acquires the execution order of the first gesture identification, the second gesture identification, and their corresponding gesture test scripts.
  • Step 304 Acquire a gesture test script according to the gesture identifier, where the gesture test script is generated according to the control information sequence of the input gesture and the gesture test script generation template.
  • the gesture test script corresponding to the input gesture may be generated and stored in advance.
  • the corresponding gesture test script is directly obtained according to the gesture identifier.
  • the corresponding control information sequence is obtained according to the gesture identifier, and the gesture test script is generated according to the control information sequence and the gesture test script generation template.
  • the gesture test can be broken down into the following test steps: the first test step for clicking on the initial control, and one or more test steps that, in turn, start between each adjacent control, starting from the initial control. Therefore, in the gesture test, the actions and sequences performed in the test step are fixed, but the controls through which the gesture passes are different. Therefore, the gesture test script generation template can be generated according to the decomposed gesture test step.
  • the control information sequence of the gesture is obtained, input into the gesture test script generation template, and the gesture test script can be generated.
  • the control information is the identifier of the control through which the gesture is marked, and the corresponding control can be found according to the control information, and the control information can be, for example, the Xpath path of the control.
  • the control information sequence is generated according to the input gesture, and the user can input the gesture to be tested on the device having the touch screen, and the computer device 110 generates the control information sequence by acquiring the control information of the input gesture and the order of the passed controls. For example, group all the control information for the input gesture into an array.
  • the gesture test script generation template may be a code template that has been compiled with a scripting language, in which a variable to be filled is set, and the variable is control information of the gesture.
  • the gesture test script generation template can also be a format template of other pre-formatted formats, such as a tabular template, in which the first test step is set to click, the second test step is swipe, and the tabular template is also set. There is a fill position for each step corresponding to the control information.
  • the gesture test script can be generated by using the script language according to the preset compilation procedure.
  • the user interface of an exemplary tabular template can be as shown in Table 1.
  • the control information column is the filling position of the control information. When the control information sequence is obtained, the control information is sequentially filled.
  • Control type Way of finding Control information Action type 1 Native Xpath Click 2 Native Xpath Move 3 Native Xpath Move 4 Native Xpath Move
  • the step of acquiring the gesture test script according to the gesture identifier specifically includes: acquiring according to the first gesture identifier a first gesture test script, and acquiring a second gesture test script according to the second gesture identifier;
  • the second gesture test script may be acquired according to the second gesture identifier while acquiring the first gesture test script according to the first gesture identifier.
  • the second gesture test script can also be obtained first to obtain the first gesture test script.
  • the embodiment of the present application does not limit the order in which the second gesture test script and the first gesture test script are acquired.
  • Step 306 Perform a gesture test on the tested application according to the gesture test script.
  • the motion instruction sequence of the gesture test script is parsed into an action instruction, and the action instruction is sent to the tested application to perform a gesture test, so that the tested application performs a corresponding operation according to the action instruction, and simulates the operation. Enter the trajectory of the gesture.
  • the gesture test script includes a sequence of action instructions to simulate a movement trajectory of the input gesture on the tested application when the gesture test script is executed, and the action instruction sequence includes a test for invoking a click event function on the start control of the gesture.
  • the instruction, and the test instruction that in turn calls the sliding event function between adjacent controls of the gesture.
  • the control identifier may be used to represent the control, and the control identifier may be the control information, or may be other identifiers used to identify the control information, as long as the control information can be obtained according to the control identifier.
  • the start control of the gesture is A
  • the intermediate control is B and C
  • the end control is D
  • the control position information sequence is the control information of the controls A, B, C, and D, and the order of the controls according to the gestures.
  • the test instruction and its execution order are in turn for the start control A to call the click event function, from the control A to the control B to call the sliding event function to operate, from the control B to the control C to call the sliding event function to operate, from the control C to Control D calls the sliding event function to operate.
  • Step 308 Acquire a gesture test result corresponding to the gesture test script.
  • the gesture test result corresponding to the gesture test script is obtained to analyze or evaluate the test result of the tested application.
  • the gesture test method obtains a gesture test script according to the gesture identifier when receiving the gesture test request carrying the gesture identifier, and then performs a gesture test on the tested application according to the gesture test script, and obtains a gesture test result corresponding to the gesture test script.
  • the gesture test script is generated according to the control position information path sequence corresponding to the input gesture and the gesture test script generation template, and the gesture test script includes an action instruction sequence for simulating the input gesture, and sequentially includes the input input in the action instruction sequence.
  • the start control of the gesture invokes a test action instruction that operates by clicking the event function and a test instruction that invokes a sliding event function between adjacent controls of the input gesture.
  • the gesture test script generated according to the control gesture sequence of the input gesture and the preset gesture test script generation template may be acquired according to the gesture identifier, and the gesture is generated by using the gesture identifier.
  • the test script tests the tested application to obtain the gesture test result, which reduces the workload of the test and improves the efficiency of the test.
  • Step S306 is an implementation flowchart of the step of performing a gesture test on the tested application according to the gesture test script, which may specifically include the following steps:
  • the first gesture test script invoked may be one of randomly selected ones of the plurality of gesture test scripts.
  • the gesture test script whose execution order is the first is invoked as the first gesture test script.
  • the initialization command refers to an instruction that can restore the application under test to a state in which the gesture test can be re-executed. For example, when testing the unlock gesture password of WeChat, an initialization command is sent to enable WeChat to restart, and enter the state of inputting the unlock gesture password.
  • the second gesture test script is invoked to perform a gesture test on the tested application.
  • Waiting for initialization time is the period of time since the initialization command was sent. For a preset period of time.
  • the waiting initialization time of the tested application may be different, and may be set according to the startup time of the tested application.
  • the gesture test task further includes the third gesture test script
  • the initialization instruction may be sent to the tested application, and the third gesture is invoked when the initialization time is reached. Test the script for testing. If the fourth gesture test script and the fifth gesture test script are further included, the step of sending the initialization instruction after the current test script test is completed may be repeated, and the next gesture test script is called to perform the gesture test when the initialization time arrives.
  • FIG. 5 is a flowchart of an implementation of the step of acquiring the gesture test result corresponding to the gesture test script in step S308, which may specifically include the following steps:
  • homepage keywords can be preset in accordance with the characteristics of the home page of the application under test.
  • the detection time can be set according to actual needs. When the detection result is that the homepage keyword appears, it indicates that the tested application enters the startup page, and the gesture corresponding to the current gesture test script is consistent with the preset gesture unlock password, and the execution result is that the gesture is successfully unlocked; otherwise, the execution result is a gesture. Unlock failed.
  • the detection can be done in a polling manner.
  • the polling can be started after the preset time after the start of the gesture test to reduce the number of polling.
  • the preset time can be set according to the actual setting.
  • the computer device After determining the gesture test result, acquires the gesture test result to analyze or evaluate the gesture test result.
  • FIG. 6 is a flowchart of an implementation of a gesture testing method in an embodiment, which may specifically include the following steps:
  • the user can input an input gesture to be tested on the touch terminal having the touch screen.
  • the touch terminal can be a computer device 110 or other touch terminals.
  • the gesture is entered on the application under test.
  • the computer performs a communication connection with the touch terminal to acquire control information of the input gesture.
  • the control information is the identifier of the control through which the gesture is marked. According to the control information, the corresponding control can be found, for example, the Xpath path of the control.
  • the control information sequence is generated according to the input gesture passing through the control.
  • the gesture of the user on the mobile phone is from the control of the upper left corner to the control of the right small corner.
  • the seven control information are Xpath1, Xpath2, Xpath3, Xpath4, Xpath5, Xpath6, Xpath7, you can combine these seven control information into an array, in order, XPath1, Xpath2, Xpath3, Xpath4, Xpath5, Xpath6, Xpath7.
  • the control information sequence is input into a preset gesture test script generation template to generate a gesture test script.
  • the gesture test script includes a sequence of motion instructions to simulate a movement trajectory of the input gesture on the application under test when the gesture test script is executed.
  • the sequence of action instructions includes, in order, test instructions that operate on the click control event function of the start control of the gesture, and test commands that sequentially invoke the slide event function between adjacent controls of the gesture.
  • you can use the control's Xpath path to represent the control of course, you can also use the other control information to identify the control, as long as the corresponding control can be obtained according to the control information.
  • the gesture test can therefore be broken down into the following test steps: the first test step for clicking on the initial control, and one or more test steps that slide sequentially between each adjacent control starting from the initial control. Therefore, in the gesture test, the actions and sequences performed in the test step are fixed, but the controls through which the gesture passes are different. Therefore, the gesture test script generation template can be generated according to the decomposed gesture test step. When the control information sequence of the gesture is obtained, input into the gesture test script generation template, and the gesture test script can be generated.
  • the gesture test script generation template may be a code template that has been compiled using a script language, in which a variable to be filled is set, and the variable is control information of the gesture.
  • the gesture test script generation template may also be a format template of other pre-formatted formats, such as a tabular template, in which the first test step is set to click, the second test step is sliding, and each is set. The step corresponds to the filling position of the control information.
  • the gesture test script can be generated by using the script language according to the preset compilation procedure.
  • the sequence of motion instructions in the test script sequentially includes an operation of calling a click event function for the control of the upper left corner, and a sliding event between the control of the upper left corner and the second control.
  • the function operates, calling the sliding event function between the second control and the third control, calling the sliding event function between the third control and the fourth control, and operating the fourth control to the fifth Calling a sliding event function between controls, calling a sliding event function between the fifth control and the sixth control, and calling between the sixth control and the seventh control (ie, the control in the lower right corner)
  • the sliding event function operates.
  • Step 608 Receive a gesture test request, where the gesture test request carries a gesture identifier with an input gesture;
  • the gesture identifier is used to identify the gesture, and may be composed of characters such as characters and numbers, or may be other identifiers that can identify the gesture.
  • Step 610 Acquire a gesture test script for inputting a gesture according to the gesture identifier
  • Step 612 Perform a gesture test on the tested application according to the gesture test script.
  • the test step in the gesture test script is parsed, and the test step is sent to the tested application for gesture test.
  • control is identified by the control information in the test script, and is identified by the coordinate point in the tested application, so when the test step is sent to the tested application for testing, the control is also needed.
  • the information is parsed into coordinate points in the application under test. For example, the Xpath path is resolved to a specific coordinate point.
  • Step 614 Acquire a gesture test result corresponding to the gesture test script.
  • the gesture test result corresponding to the gesture test script is obtained, and the test result of the tested application is analyzed or evaluated.
  • a gesture testing device is provided, which may be integrated into the computer device 110 described above, and may specifically include a test request receiving unit 802, a script obtaining unit 804, and a gesture test. Unit 806 and test result acquisition unit 808.
  • the test request receiving unit 802 is configured to receive a gesture test request, where the gesture test request carries a gesture identifier
  • the script obtaining unit 804 is configured to acquire a gesture test script according to the gesture identifier
  • a gesture testing unit 806, configured to perform a gesture test on the tested application according to the gesture test script
  • the test result obtaining unit 808 is configured to obtain a gesture test result corresponding to the gesture test script.
  • the gesture identifier includes a first gesture identifier and a second gesture identifier
  • the script obtaining unit 804 is specifically configured to acquire the first gesture test script according to the first gesture identifier, and acquire the second identifier according to the second gesture identifier.
  • Gesture test script ;
  • the gesture test unit 806 when the gesture test script includes a first gesture test script and a second gesture test script, the gesture test unit 806 includes a first script calling module 806A, an initialization instruction sending module 806B, and a second The script calls module 806C.
  • the first script calling module 806A is configured to invoke the first gesture test script to perform a gesture test on the tested application
  • the initialization instruction sending module 806B sends an initialization instruction to the tested application after the first gesture test script test is completed, so that the tested application is initialized;
  • the second script invokes the module 806C, and when the waiting initialization time of the tested application arrives, the second gesture test script is invoked to perform a gesture test on the tested application.
  • the test result obtaining unit 808 includes a keyword detecting module 808A and a test result obtaining module 808B.
  • the keyword detecting module 808A is configured to detect whether a preset homepage keyword appears in the tested application, and if yes, determine that the gesture test result is that the gesture unlocking succeeds, and if not, determine that the gesture test result is that the gesture unlocking fails;
  • homepage keywords can be preset in accordance with the characteristics of the home page of the application under test.
  • the detection time can be set according to actual needs. When the detection result is that the homepage keyword appears, it indicates that the tested application enters the startup page, and the gesture corresponding to the current gesture test script is consistent with the preset gesture unlock password, and the execution result is that the gesture is successfully unlocked; otherwise, the execution result is a gesture. Unlock failed.
  • the detection can be done in a polling manner.
  • the polling can be started after the preset time after the start of the gesture test to reduce the number of polling.
  • the preset time can be set according to actual needs.
  • the test result obtaining module 808B is configured to obtain a gesture test result corresponding to the gesture test script.
  • the computer device After determining the gesture test result, acquires the gesture test result to analyze or evaluate the gesture test result.
  • the gesture testing apparatus may further include a control information acquiring unit 1102, a control information sequence generating unit 1104, and a test script generating unit 1106.
  • the control information acquiring unit 1102 is configured to acquire control information of the input gesture
  • the control information sequence generating unit 1104 is configured to generate a control information sequence according to the control information of the input gesture and the order in which the input gesture passes through the control;
  • the test script generating unit 1106 is configured to generate a gesture test script according to the control information sequence and the gesture test script generation template.
  • gesture test device For specific definitions of the gesture test device, reference may be made to the above description of the gesture test method, and details are not described herein again.
  • Each of the above-described gesture testing devices can be implemented in whole or in part by software, hardware, and combinations thereof.
  • Each of the above modules may be embedded in or independent of the processor in the computer device, or may be stored in a memory in the computer device in a software form, so that the processor invokes the operations corresponding to the above modules.
  • a computer device comprising a memory and one or more processors, the memory storing computer readable instructions, the computer readable instructions being executed by the processor, causing the one or more processors to perform the steps of: receiving a gesture test request,
  • the gesture test request carries a gesture identifier;
  • the gesture test script is acquired according to the gesture identifier, wherein the gesture test script generates a template according to the control information sequence of the input gesture and the gesture test script; and the gesture test is performed on the tested application according to the gesture test script, and the gesture test is performed.
  • the script includes a sequence of action instructions for simulating an input gesture, and the sequence of action instructions includes a test command for invoking a click event function on a start control of the input gesture, and sequentially calling a slide event function between adjacent controls of the input gesture. Test command; obtain the gesture test result corresponding to the gesture test script.
  • the processor executes the computer readable instructions to: obtain control information of the input gesture; generate control information sequence according to the control information of the input gesture and the input gesture through the control; according to the control information sequence and the gesture
  • the test script generates a template to generate a gesture test script.
  • the gesture identifier includes a first gesture identifier and a second gesture identifier
  • the step of acquiring, by the processor, the gesture test script according to the gesture identifier comprises: acquiring the first gesture test script according to the first gesture identifier, and Obtaining a second gesture test script according to the second gesture identifier
  • the step of performing a gesture test on the tested application according to the gesture test script performed by the processor includes: calling the first gesture test script to perform a gesture test on the tested application; After the test of the gesture test script is completed, an initialization command is sent to the tested application to initialize the tested application; when the waiting initialization time of the tested application arrives, the second gesture test script is invoked to perform a gesture test on the tested application.
  • the step of acquiring the gesture test result corresponding to the gesture test script executed by the processor includes: detecting whether a preset homepage keyword appears in the tested application, and if yes, determining that the gesture test result is that the gesture is successfully unlocked, if No, the gesture test result is determined to be that the gesture unlocking fails; and the gesture test result corresponding to the gesture test script is obtained.
  • One or more non-transitory computer readable storage mediums storing computer readable instructions, when executed by one or more processors, cause one or more processors to perform the steps of: receiving a gesture test request
  • the gesture test request carries a gesture identifier; the gesture test script is acquired according to the gesture identifier, wherein the gesture test script generates a template according to the control information sequence of the input gesture and the gesture test script; and the gesture test is performed on the tested application according to the gesture test script.
  • the test script includes a sequence of action instructions for simulating an input gesture, the sequence of action instructions sequentially including a test command for invoking a click event function of a start control of the input gesture, and sequentially calling a sliding event function between adjacent controls of the input gesture.
  • the test command of the operation; the gesture test result corresponding to the gesture test script is obtained.
  • the processor executes the computer readable instructions to: obtain control information of the input gesture; generate control information sequence according to the control information of the input gesture and the input gesture through the control; according to the control information sequence and the gesture
  • the test script generates a template to generate a gesture test script.
  • the gesture identifier includes a first gesture identifier and a second gesture identifier
  • the step of acquiring, by the processor, the gesture test script according to the gesture identifier comprises: acquiring the first gesture test script according to the first gesture identifier, and Obtaining a second gesture test script according to the second gesture identifier
  • the step of performing a gesture test on the tested application according to the gesture test script performed by the processor includes: calling the first gesture test script to perform a gesture test on the tested application; After the test of the gesture test script is completed, an initialization command is sent to the tested application to initialize the tested application; when the waiting initialization time of the tested application arrives, the second gesture test script is invoked to perform a gesture test on the tested application.
  • the step of acquiring the gesture test result corresponding to the gesture test script executed by the processor includes: detecting whether a preset homepage keyword appears in the tested application, and if yes, determining that the gesture test result is that the gesture is successfully unlocked, if No, the gesture test result is determined to be that the gesture unlocking fails; and the gesture test result corresponding to the gesture test script is obtained.
  • Non-volatile memory can include read only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory.
  • Volatile memory can include random access memory (RAM) or external cache memory.
  • RAM is available in a variety of formats, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronization chain.
  • SRAM static RAM
  • DRAM dynamic RAM
  • SDRAM synchronous DRAM
  • DDRSDRAM double data rate SDRAM
  • ESDRAM enhanced SDRAM
  • Synchlink DRAM SLDRAM
  • Memory Bus Radbus
  • RDRAM Direct RAM
  • DRAM Direct Memory Bus Dynamic RAM
  • RDRAM Memory Bus Dynamic RAM

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种手势测试方法,包括:接收手势测试请求,所述手势测试请求携带有手势标识;根据所述手势标识获取手势测试脚本,其中,所述手势测试脚本根据输入手势的控件信息序列以及手势测试脚本生成模板生成;根据所述手势测试脚本对被测应用进行手势测试,所述手势测试脚本包括用于模拟所述输入手势的动作指令序列,所述动作指令序列依次包括对所述输入手势的起始控件调用点击事件函数进行操作的测试指令以及在所述输入手势的相邻控件之间依次调用滑动事件函数进行操作的测试指令;获取所述手势测试脚本对应的手势测试结果。

Description

手势测试方法、装置、计算机设备和存储介质
相关申请的交叉引用
本申请要求于2017年07月25日提交中国专利局,申请号为2017106144217,申请名称为“手势测试方法、装置、计算机设备和存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本申请涉及测试领域,特别是涉及手势测试方法、装置、计算机设备和存储介质。
背景技术
应用程序在投入使用前通常需要通过测试对软件的性能进行判断。比如,通过长按用户界面上的控件,测试应用程序是否输出预设的结果。随着需求的快速迭代,把以人为驱动的测试行为转化为机器执行的自动化测试成为必然的要求。
目前,在进行进行自动化测试时,首先需要技术人员根据测试需求编写测试脚本,然后利用自动化测试工具执行该测试脚本进行测试。然而,在对现有技术的研究与实践中,本申请的发明人发现,现有技术存在以下问题:目前的自动化框架都没有专门针对手势密码的测试方法,因此每次手势测试时,技术人员需要人工编写大量的代码,工作量大,从而降低了测试的效率。
发明内容
根据本申请公开的各种实施例,提供一种手势测试方法、装置、计算机设备和存储介质。
一种手势测试方法,所述测试方法包括:接收手势测试请求,所述手势测试请求携带有手势标识;根据所述手势标识获取手势测试脚本,其中,所述手势测试脚本根据输入手势的控件信息序列以及手势测试脚本生成模板生成;根据所述手势测试脚本对被测应用进行手势测试,所述手势测试脚本包括用于模拟所述输入手势的动作指令序列,所述动作指令序列依次包括对所述输入手势的起始控件调用点击事件函数进行操作的测试指令以及在所述输入手势的相邻控件之间依次调用滑动事件函数进行操作的测试指令;及,获取所述手势测试脚本对应的手势测试结果。
一种手势测试装置,所述测试装置包括:测试请求接收单元,用于接收手势测试请求,所述手势测试请求携带有手势标识;脚本获取单元,用于根据所述手势标识获取手势测试脚本,其中,所述手势测试脚本根据输入手势的控件信息序列以及手势测试脚本生成模板生成;手势测试单元,用于根据所述手势测试脚本对被测应用进行手势测试,所述手势测试脚本包括用于模拟所述输入手势的动作指令序列,所述动作指令序列依次包括对所述输入手势的起始控件调用点击事件函数进行操作的测试指令以及在所述输入手势的相邻控件之间依次调用 滑动事件函数进行操作的测试指令;及,测试结果获取单元,用于获取所述手势测试脚本对应的手势测试结果。
一种计算机设备,包括存储器和一个或多个处理器,存储器中存储有计算机可读指令,计算机可读指令被处理器执行时实现本申请任意一个实施例中提供的手势测试方法的步骤。。
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器实现本申请任意一个实施例中提供的手势测试方法的步骤。
本申请的一个或多个实施例的细节在下面的附图和描述中提出。本申请的其它特征和优点将从说明书、附图以及权利要求书变得明显。
附图说明
为了更清楚地说明本申请实施例中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其它的附图。
图1为根据一个或多个实施例中提供的手势测试方法的实施环境图;
图2根据一个或多个实施例中计算机设备的内部结构框图;
图3根据一个或多个实施例中手势测试方法的流程图;
图4根据一个或多个实施例中根据手势测试脚本对被测应用进行手势测试的流程图;
图5根据一个或多个实施例中获取手势测试脚本对应的手势测试结果的流程图;
图6另一个实施例中实施例中手势测试方法的流程图;
图7根据一个或多个实施例中输入手势的示意图;
图8根据一个或多个实施例中手势测试装置的结构框图;
图9根据一个或多个实施例中手势测试单元的结构框图;
图10根据一个或多个实施例中测试结果获取单元的结构框图;
图11为另一个实施例中实施例中手势测试装置的结构框图。
具体实施方式
为了使本申请的目的、技术方案及优点更加清楚明白,以下结合附图及实施例,对本申请进行进一步详细说明。应当理解,此处所描述的具体实施例仅仅用以解释本申请,并不用于限定本申请。
可以理解,本申请所使用的术语“第一”、“第二”等可在本文中用于描述各种元件,但这些元件不受这些术语限制。这些术语仅用于将第一个元件与另一个元件区分。举例来说,在不脱离本申请的范围的情况下,可以将第一手势测试脚本称为第二手势测试脚本,且类似地,可将第二手势测试脚本称为第二手势测试脚本。
图1为一个实施例中提供的手势测试方法的应用环境图,如图1所示,在该实施环境中,包括计算机设备110以及终端120。
计算机设备110为测试设备,例如为测试人员使用的电脑等计算机设备,计算机设备110上安装有自动化测试工具,例如可以为Appium。终端120上安装有需要进行手势测试的被测应用,当需要测试时,测试人员可以在计算机设备110发出手势测试请求,该手势测试请求中携带有手势标识,计算机设备110接收该手势测试请求,根据手势标识获取计算机设备110中与手势标识对应的手势测试脚本。然后利用自动化测试工具执行该手势测试脚本,对终端120上的被测应用进行测试,并获取手势测试脚本对应的手势测试结果。
需要说明的是,终端120以及计算机设备110可为智能手机、平板电脑、笔记本电脑、台式计算机等,但并不局限于此。计算机设备110以及终端120可以通过蓝牙、USB(Universal Serial Bus,通用串行总线)或者其他通讯连接方式进行连接,本申请在此不做限制。
图2为一个实施例中计算机设备的内部结构示意图。提供了一种计算机设备,该计算机设备可以是服务器也可以是终端,该计算机设备通过系统连接总线连接处理器、非易失性存储介质、内存储器和网络接口。非易失性存储介质可以是非易失性计算机可读存储介质。该计算机设备的非易失性存储介质可存储操作系统和计算机可读指令,该计算机可读指令被执行时,可使得处理器执行一种手势测试方法。该计算机设备的处理器用于提供计算和控制能力,支撑整个计算机设备的运行。该内存储器中可储存有计算机可读指令,该计算机可读指令被处理器执行时,可使得处理器执行一种手势测试方法。计算机设备的网络接口用于进行网络通信,如接收手势测试请求等。
如图3所示,在一些实施例中,提出了一种手势测试方法,该手势测试方法可以应用于上述的计算机设备110中,具体可以包括以下步骤:
步骤302,接收手势测试请求,手势测试请求携带有手势标识;
在本实施例中,手势标识用于标识手势,可以是由文字,数字等字符组成,也可以是其他可以标识手势的标识。
在一些实施例中,手势标识可以为一个或者为多个。当手势标识为多个时,在获取手势标识的同时,也可以获取手势标识对应的手势测试脚本的执行顺序。例如,测试人员在输入第一手势标识以及第二手势标识时,可以输入它们对应的手势测试脚本的执行顺序。计算机设备110获取第一手势标识、第二手势标识以及它们对应的手势测试脚本的执行顺序。
步骤304,根据手势标识获取手势测试脚本,手势测试脚本是根据输入手势的控件信息序列以及手势测试脚本生成模板生成的;
在本申请实施例中,可以提前生成输入手势对应的手势测试脚本并存储,当获取到手势标识时,根据手势标识直接获取对应的手势测试脚本。也可以在获取到手势标识时,根据手势标识获取对应的控件信息序列,再根据控件信息序列以及手势测试脚本生成模板生成手势测试脚本。
手势测试脚本生成模板是根据手势测试时执行的测试步骤预先编写的,将手势的路径分解为依次连接的多个控件(初始控件、N个中间控件(N=0,1,2…)以及终止控件)和相邻控件之间的连线。因此手势测试可分解为以下测试步骤:针对初始控件进行点击的第一个测试步骤,以及从该初始控件开始,依次在每个相邻控件之间进行滑动的一个或多个测试步骤。 故手势测试中,测试步骤中所执行的动作及顺序是固定的,只是手势经过的控件不同。因此,可以根据分解的手势测试步骤生成手势测试脚本生成模板。当获取到手势的控件信息序列时,输入到该手势测试脚本生成模板中,便可以生成手势测试脚本。
控件信息为标记手势所经过的控件的标识,根据控件信息可以找到对应的控件,控件信息例如可为控件的Xpath路径。控件信息序列是根据输入手势生成的,用户可以在拥有触摸屏的设备上输入想要测试的手势,计算机设备110通过获取输入手势经过的控件获取控件信息以及经过的控件的顺序,生成控件信息序列。例如,将输入手势的所有控件信息组成一个数组。
在一些实施例中,手势测试脚本生成模板可以是已经利用脚本语言编译好的代码模板,在该代码模板中设置有需要填充的变量,变量为手势的控件信息。当然,手势测试脚本生成模板也可以是其他预制格式的格式模板,例如表格化模板,在该表格化模板设置了第一个测试步骤为点击,第二个测试步骤为滑动,表格化模板还设置有每个步骤对应控件信息的填充位置。当获取到输入手势的控件信息序列时,输入到该手势测试脚本生成模板中,就可以根据预设好的编译规程利用脚本语言生成手势测试脚本。一个示例性的表格化模板的用户界面可以如表1所示,其中的控件信息列即为控件信息的填充位置,当获取到控件信息序列时,将控件信息按顺序填充。
表1:
步骤 控件类型 查找方式 控件信息 动作类型
1 Native Xpath   Click
2 Native Xpath   Move
3 Native Xpath   Move
4 Native Xpath   Move
在一些实施例中,当手势标识为多个时,以手势标识包括第一手势标识以及第二手势标识为例,则根据手势标识获取手势测试脚本的步骤具体包括:根据第一手势标识获取第一手势测试脚本,以及,根据第二手势标识获取第二手势测试脚本;
例如,可以在根据第一手势标识获取第一手势测试脚本的同时,根据第二手势标识获取第二手势测试脚本。当然也可以先获取第二手势测试脚本再获取第一手势测试脚本。本申请实施例对第二手势测试脚本以及第一手势测试脚本的获取顺序不做限制。
步骤306,根据手势测试脚本对被测应用进行手势测试;
当获取到手势测试脚本后,根据手势测试脚本的动作指令序列解析成动作指令,将动作指令发送到被测应用中,进行手势测试,以使被测应用根据动作指令执行相应的操作,模拟该输入手势的轨迹。
手势测试脚本中包括动作指令序列,以在执行该手势测试脚本时,可以在被测应用上模拟输入手势的移动轨迹,动作指令序列依次包括对手势的起始控件调用点击事件函数进行操作的测试指令,以及在手势的相邻控件之间依次调用滑动事件函数进行操作的测试指令。在测试指令中,可以用控件标识表示控件,控件标识可为控件信息,当然也可以为用于标识控 件信息的其他标识,只要根据该控件标识能够获取到控件信息即可。
例如,手势的起始控件为A、中间控件依次为B、C,终点控件为D,则控件位置信息序列为控件A、B、C以及D的控件信息以及根据手势经过这几个控件的顺序进行排序组成的序列。测试指令以及其执行顺序依次为针对起始控件A调用点击事件函数进行操作、从控件A到控件B调用滑动事件函数进行操作、从控件B到控件C调用滑动事件函数进行操作、从控件C到控件D调用滑动事件函数进行操作。
步骤308,获取手势测试脚本对应的手势测试结果。
当手势测试完成后,获取该手势测试脚本对应的手势测试结果,以对被测应用的测试结果进行分析或者评估等。
上述手势测试方法通过在接收携带有手势标识的手势测试请求时,根据手势标识获取手势测试脚本,然后根据手势测试脚本对被测应用进行手势测试,并获取该手势测试脚本对应的手势测试结果。其中,该手势测试脚本是根据输入手势对应的控件位置信息路径序列以及手势测试脚本生成模板生成的,手势测试脚本包括用于模拟输入手势的动作指令序列,在动作指令序列中,依次包括对输入手势的起始控件调用点击事件函数进行操作的测试动作指令以及在输入手势的相邻控件之间调用滑动事件函数进行操作的测试指令。因此,当需要进行手势测试时,只要根据需要选择对应的手势标识,便可以根据手势标识获取根据输入手势的控件信息序列以及预设的手势测试脚本生成模板生成的手势测试脚本,并利用该手势测试脚本对被测应用进行测试,获取手势测试结果,减少了测试的工作量,提高了测试的效率。
图4示出了在一些实施例中,当手势测试脚本包括第一手势测试脚本以及第二手势测试脚本,将第一手势测试脚本以及第二手势测试脚本在一个测试任务中执行时,步骤S306即根据手势测试脚本对被测应用进行手势测试的步骤的实现流程图,具体可以包括以下步骤:
S402,调用第一手势测试脚本对被测应用进行手势测试;
调用的第一手势测试脚本可以是多个手势测试脚本中随机选取的一个。在一些实施例中,当用户输入了手势测试脚本的执行顺序时,调用执行顺序为第一的手势测试脚本作为第一手势测试脚本。
S404,当第一手势测试脚本测试完成后,向被测应用发送初始化指令,以使被测应用进行初始化;
初始化指令指可以将被测应用还原到可以重新进行手势测试状态的指令。例如,对微信的解锁手势密码进行测试时,发送初始化命令,使微信重新进行启动,进入输入解锁手势密码的状态。
S406,当被测应用的等待初始化时间到达时,调用第二手势测试脚本对被测应用进行手势测试。
等待初始化时间是指自发送初始化指令起算的一段时间。为预设的一段时间。当被测应用不同时,被测应用的等待初始化时间可以不同,具体可以根据被测应用的启动时间进行设定。
可以理解,若手势测试任务中还包括第三手势测试脚本时,当第二手势测试脚本测试完 成后,可以再向被测应用发送初始化指令,并在等待初始化时间到达时,调用第三手势测试脚本进行测试。若还包括第四手势测试脚本、第五手势测试脚本,则可以继续重复当前测试脚本测试完成后,发送初始化指令,等待初始化时间到达时调用下一手势测试脚本进行手势测试的步骤。
图5示出了一个实施例中,步骤S308即获取手势测试脚本对应的手势测试结果的步骤的实现流程图,具体可以包括以下步骤:
S502,检测被测应用中是否出现预设的首页关键词,若是,确定手势测试结果为手势解锁成功,若否,确定手势测试结果为手势解锁失败;
可以查询被测应用中是否出现与首页有关的首页关键词,例如“首页”一词。当然,也可以根据被测应用首页的特点预先设置其他首页关键词。检测时间可以根据实际需要设定。当检测结果为出现了首页关键词时,则表示被测应用进入了启动页面,当前手势测试脚本对应的手势与预设的手势解锁密码一致,执行结果为手势解锁成功;否则,执行结果为手势解锁失败。
在一些实施例中,可以以轮询的方式进行检测。优选地,可以在手势测试开始后的预设时间后再开始进行轮询,以减少轮询的次数。该预设时间可以根据实际设定。
S504,获取手势测试脚本对应的手势测试结果。
当确定手势测试结果后,计算机设备获取该手势测试结果,以对手势测试结果进行分析或者评价。
图6示出了一个实施例中手势测试方法的实现流程图,具体可以包括以下步骤:
S602,获取输入手势的控件信息;
在本申请实施例中,用户可以在具有触摸屏的触摸终端上输入想要测试的输入手势。该触摸终端可以为计算机设备110,也可以为其他触摸终端。优选地,手势是在被测应用上输入的。当在其他触摸终端中输入时,计算机与触摸终端进行通信连接,获取输入手势的控件信息。控件信息为标记手势所经过的控件的标识,根据控件信息可以找到其对应的控件,例如可为控件的Xpath路径。
S604,根据控件信息以及输入手势经过控件的顺序生成控件信息序列;
在本申请实施例中,获取到输入手势经过的每个控件的控件信息后,根据输入手势经过控件的顺序生成控件信息序列。
以图7为例,用户在手机上的手势为从左上角的控件滑动到右小角的控件,经过七个控件,假设这七个控件信息依次为Xpath1、Xpath2、Xpath3、Xpath4、Xpath5、Xpath6、Xpath7,则可以将这七个控件信息组成一个数组,顺序依次为Xpath1、Xpath2、Xpath3、Xpath4、Xpath5、Xpath6、Xpath7。
S606,根据控件信息序列以及手势测试脚本生成模板生成手势测试脚本。
在本申请实施例中,将控件信息序列输入到预设的手势测试脚本生成模板中,生成手势 测试脚本。手势测试脚本中包括动作指令序列,以在执行该手势测试脚本时,可以在被测应用上模拟输入手势的移动轨迹。动作指令序列依次包括对手势的起始控件调用点击事件函数进行操作的测试指令,以及在手势的相邻控件之间依次调用滑动事件函数进行操作的测试指令。在测试指令中,可以用控件的Xpath路径表示控件,当然也可以为用于标识控件的其他控件信息,只要根据该控件信息能够获取到对应的控件即可。
手势测试脚本生成模板是根据手势测试时执行的测试步骤预先编写的,将手势分解为依次连接的多个控件(初始控件、N个中间控件(N=0,1,2…)、终止控件)和相邻控件之间的连线。因此可以将手势测试分解为以下测试步骤:针对初始控件进行点击的第一个测试步骤,以及从该初始控件开始,在每个相邻控件之间依次进行滑动的一个或多个测试步骤。故手势测试中,测试步骤中的所执行的动作及顺序是固定的,只是手势经过的控件不同。因此,可以根据分解的手势测试步骤生成手势测试脚本生成模板。当获取到手势的控件信息序列时,输入到该手势测试脚本生成模板中,便可以生成手势测试脚本。
在一些实施例中,手势测试脚本生成模板可以是已经利用脚本语言编译好的代码模板,在该代码模板中设置有需要填充的变量,变量即为手势的控件信息。当然,手势测试脚本生成模板也可以是其他预制格式的格式模板,例如表格化模板,在该表格化模板设置了第一个测试步骤为点击,第二个测试步骤为滑动,还设置有每个步骤对应控件信息的填充位置。当获取到输入手势的控件信息序列时,输入到该手势测试脚本生成模板中,就可以根据预设好的编译规程利用脚本语言生成手势测试脚本。
例如,再以输入手势为图7的手势为例,测试脚本中的动作指令序列依次包括针对左上角的控件调用点击事件函数进行操作、在左上角的控件到第二个控件之间调用滑动事件函数进行操作、在第二个控件到第三个控件之间调用滑动事件函数进行操作、在第三个控件到第四个控件之间调用滑动事件函数进行操作、在第四个控件到第五个控件之间调用滑动事件函数进行操作、在第五个控件到第六个控件之间调用滑动事件函数进行操作、在第六个控件到第七个控件(即右下角的控件)之间调用滑动事件函数进行操作。
步骤608,接收手势测试请求,手势测试请求携带有输入手势的手势标识;
在本实施例中,手势标识用于标识手势,可以是由文字,数字等字符组成,也可以是其他可以标识手势的标识。
步骤610,根据手势标识获取输入手势的手势测试脚本;
步骤612,根据手势测试脚本对被测应用进行手势测试;
当获取到手势测试脚本后,解析手势测试脚本中的测试步骤,将该测试步骤发送到被测应用中进行手势测试。
在一些实施例中,控件在测试脚本中是控件信息进行标识的,而在被测应用中是以坐标点进行标识的,因此在将测试步骤发送给被测应用进行测试时,还需要将控件信息解析为被测应用中的坐标点。例如,将Xpath路径解析为具体的坐标点。
步骤614,获取手势测试脚本对应的手势测试结果。
当手势测试完成后,获取该手势测试脚本对应的手势测试结果,以对被测应用的测试结 果进行分析或者评估等。
应该理解的是,虽然上述的流程图中的各个步骤按照箭头的指示依次显示,但是这些步骤并不是必然按照箭头指示的顺序依次执行。除非本文中有明确的说明,这些步骤的执行并没有严格的顺序限制,这些步骤可以以其它的顺序执行。而且,上述流程图的至少一部分步骤可以包括多个子步骤或者多个阶段,这些子步骤或者阶段并不必然是在同一时刻执行完成,而是可以在不同的时刻执行,这些子步骤或者阶段的执行顺序也不必然是依次进行,而是可以与其它步骤或者其它步骤的子步骤或者阶段的至少一部分轮流或者交替地执行。
如图8所示,在一些实施例中,提供了一种手势测试装置,该手势测试装置可以集成于上述的计算机设备110中,具体可以包括测试请求接收单元802、脚本获取单元804、手势测试单元806以及测试结果获取单元808。
测试请求接收单元802,用于接收手势测试请求,该手势测试请求携带有手势标识;
脚本获取单元804,用于根据手势标识获取手势测试脚本;
手势测试单元806,用于根据手势测试脚本对被测应用进行手势测试;
测试结果获取单元808,用于获取手势测试脚本对应的手势测试结果。
在一些实施例中,手势标识包括第一手势标识以及第二手势标识,脚本获取单元804具体用于根据第一手势标识获取第一手势测试脚本,以及,根据第二手势标识获取第二手势测试脚本;
如图9所示,在一些实施例中,当手势测试脚本包括第一手势测试脚本以及第二手势测试脚本,手势测试单元806包括第一脚本调用模块806A、初始化指令发送模块806B以及第二脚本调用模块806C。
第一脚本调用模块806A,用于调用第一手势测试脚本对被测应用进行手势测试;
初始化指令发送模块806B,当第一手势测试脚本测试完成后,向被测应用发送初始化指令,以使被测应用进行初始化;
第二脚本调用模块806C,当被测应用的等待初始化时间到达时,调用第二手势测试脚本对被测应用进行手势测试。
如图10所示,在一些实施例中,测试结果获取单元808包括关键词检测模块808A以及测试结果获取模块808B。
关键词检测模块808A,用于检测被测应用中是否出现预设的首页关键词,若是,确定手势测试结果为手势解锁成功,若否,确定手势测试结果为手势解锁失败;
可以查询被测应用中是否出现与首页有关的首页关键词,例如“首页”一词。当然,也可以根据被测应用首页的特点预先设置其他首页关键词。检测时间可以根据实际需要设定。当检测结果为出现了首页关键词时,则表示被测应用进入了启动页面,当前手势测试脚本对应的手势与预设的手势解锁密码一致,执行结果为手势解锁成功;否则,执行结果为手势解锁失败。
在一些实施例中,可以以轮询的方式进行检测。优选地,可以在手势测试开始后的预设时间后再开始进行轮询,以减少轮询的次数。该预设时间可以根据实际需要设定。
测试结果获取模块808B,用于获取手势测试脚本对应的手势测试结果。
当确定手势测试结果后,计算机设备获取该手势测试结果,以对手势测试结果进行分析或者评价。
如图11所示,手势测试装置还可以包括控件信息获取单元1102、控件信息序列生成单元1104以及测试脚本生成单元1106。
控件信息获取单元1102,用于获取输入手势的控件信息;
控件信息序列生成单元1104,用于根据输入手势的控件信息以及输入手势经过控件的顺序生成控件信息序列;
测试脚本生成单元1106,用于根据控件信息序列以及手势测试脚本生成模板生成手势测试脚本。
关于手势测试装置的具体限定可以参见上文中对于手势测试方法的限定,在此不再赘述。上述手势测试装置中的各个模块可全部或部分通过软件、硬件及其组合来实现。上述各模块可以硬件形式内嵌于或独立于计算机设备中的处理器中,也可以以软件形式存储于计算机设备中的存储器中,以便于处理器调用执行以上各个模块对应的操作。
一种计算机设备,包括存储器和一个或多个处理器,存储器中储存有计算机可读指令,计算机可读指令被处理器执行时,使得一个或多个处理器执行以下步骤:接收手势测试请求,手势测试请求携带有手势标识;根据手势标识获取手势测试脚本,其中,手势测试脚本根据输入手势的控件信息序列以及手势测试脚本生成模板生成;根据手势测试脚本对被测应用进行手势测试,手势测试脚本包括用于模拟输入手势的动作指令序列,动作指令序列依次包括对输入手势的起始控件调用点击事件函数进行操作的测试指令以及在输入手势的相邻控件之间依次调用滑动事件函数进行操作的测试指令;获取手势测试脚本对应的手势测试结果。
在一些实施例中,处理器执行计算机可读指令时还执行以下步骤:获取输入手势的控件信息;根据输入手势的控件信息以及输入手势经过控件的顺序生成控件信息序列;根据控件信息序列以及手势测试脚本生成模板生成手势测试脚本。
在一些实施例中,手势标识包括第一手势标识以及第二手势标识,处理器所执行的根据手势标识获取手势测试脚本的步骤包括:根据第一手势标识获取第一手势测试脚本,以及,根据第二手势标识获取第二手势测试脚本;处理器所执行的根据手势测试脚本对被测应用进行手势测试的步骤包括:调用第一手势测试脚本对被测应用进行手势测试;当第一手势测试脚本测试完成后,向被测应用发送初始化指令,以使被测应用进行初始化;当被测应用的等待初始化时间到达时,调用第二手势测试脚本对被测应用进行手势测试。
在一些实施例中,处理器所执行的获取手势测试脚本对应的手势测试结果的步骤包括:检测被测应用中是否出现预设的首页关键词,若是,确定手势测试结果为手势解锁成功,若否,确定手势测试结果为手势解锁失败;获取手势测试脚本对应的手势测试结果。
一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,计算机可读指令被一个或多个处理器执行时,使得一个或多个处理器执行以下步骤:接收手势测试请求,手势测试请求携带有手势标识;根据手势标识获取手势测试脚本,其中,手势测试脚本根据输入 手势的控件信息序列以及手势测试脚本生成模板生成;根据手势测试脚本对被测应用进行手势测试,手势测试脚本包括用于模拟输入手势的动作指令序列,动作指令序列依次包括对输入手势的起始控件调用点击事件函数进行操作的测试指令以及在输入手势的相邻控件之间依次调用滑动事件函数进行操作的测试指令;获取手势测试脚本对应的手势测试结果。
在一些实施例中,处理器执行计算机可读指令时还执行以下步骤:获取输入手势的控件信息;根据输入手势的控件信息以及输入手势经过控件的顺序生成控件信息序列;根据控件信息序列以及手势测试脚本生成模板生成手势测试脚本。
在一些实施例中,手势标识包括第一手势标识以及第二手势标识,处理器所执行的根据手势标识获取手势测试脚本的步骤包括:根据第一手势标识获取第一手势测试脚本,以及,根据第二手势标识获取第二手势测试脚本;处理器所执行的根据手势测试脚本对被测应用进行手势测试的步骤包括:调用第一手势测试脚本对被测应用进行手势测试;当第一手势测试脚本测试完成后,向被测应用发送初始化指令,以使被测应用进行初始化;当被测应用的等待初始化时间到达时,调用第二手势测试脚本对被测应用进行手势测试。
在一些实施例中,处理器所执行的获取手势测试脚本对应的手势测试结果的步骤包括:检测被测应用中是否出现预设的首页关键词,若是,确定手势测试结果为手势解锁成功,若否,确定手势测试结果为手势解锁失败;获取手势测试脚本对应的手势测试结果。
本领域普通技术人员可以理解实现上述实施例方法中的全部或部分流程,是可以通过计算机可读指令来指令相关的硬件来完成,所述的计算机可读指令可存储于一非易失性计算机可读取存储介质中,该计算机可读指令在执行时,可包括如上述各方法的实施例的流程。其中,本申请所提供的各实施例中所使用的对存储器、存储、数据库或其它介质的任何引用,均可包括非易失性和/或易失性存储器。非易失性存储器可包括只读存储器(ROM)、可编程ROM(PROM)、电可编程ROM(EPROM)、电可擦除可编程ROM(EEPROM)或闪存。易失性存储器可包括随机存取存储器(RAM)或者外部高速缓冲存储器。作为说明而非局限,RAM以多种形式可得,诸如静态RAM(SRAM)、动态RAM(DRAM)、同步DRAM(SDRAM)、双数据率SDRAM(DDRSDRAM)、增强型SDRAM(ESDRAM)、同步链路(Synchlink)DRAM(SLDRAM)、存储器总线(Rambus)直接RAM(RDRAM)、直接存储器总线动态RAM(DRDRAM)、以及存储器总线动态RAM(RDRAM)等。
以上所述实施例的各技术特征可以进行任意的组合,为使描述简洁,未对上述实施例中的各个技术特征所有可能的组合都进行描述,然而,只要这些技术特征的组合不存在矛盾,都应当认为是本说明书记载的范围。
以上所述实施例仅表达了本申请的几种实施方式,其描述较为具体和详细,但并不能因此而理解为对本申请专利范围的限制。应当指出的是,对于本领域的普通技术人员来说,在不脱离本申请构思的前提下,还可以做出若干变形和改进,这些都属于本申请的保护范围。因此,本申请专利的保护范围应以所附权利要求为准。

Claims (20)

  1. 一种手势测试方法,包括:
    接收手势测试请求,所述手势测试请求携带有手势标识;
    根据所述手势标识获取手势测试脚本,其中,所述手势测试脚本根据输入手势的控件信息序列以及手势测试脚本生成模板生成;
    根据所述手势测试脚本对被测应用进行手势测试,所述手势测试脚本包括用于模拟所述输入手势的动作指令序列,所述动作指令序列依次包括对所述输入手势的起始控件调用点击事件函数进行操作的测试指令以及在所述输入手势的相邻控件之间依次调用滑动事件函数进行操作的测试指令;及
    获取所述手势测试脚本对应的手势测试结果。
  2. 如权利要求1所述的手势测试方法,其特征在于,还包括:
    获取所述输入手势的控件信息;
    根据所述控件信息以及所述输入手势经过控件的顺序生成控件信息序列;及
    根据所述控件信息序列以及所述手势测试脚本生成模板生成所述手势测试脚本。
  3. 如权利要求1或2所述的手势测试方法,其特征在于,所述手势标识包括第一手势标识以及第二手势标识,所述根据所述手势标识获取手势测试脚本包括:
    根据所述第一手势标识获取第一手势测试脚本,以及,根据所述第二手势标识获取第二手势测试脚本;
    所述根据所述手势测试脚本对被测应用进行手势测试的步骤包括:
    调用所述第一手势测试脚本对所述被测应用进行手势测试;
    当所述第一手势测试脚本测试完成后,向所述被测应用发送初始化指令,以使所述被测应用进行初始化;及
    当所述被测应用的等待初始化时间到达时,调用所述第二手势测试脚本对所述被测应用进行手势测试。
  4. 如权利要求1或2所述的手势测试方法,其特征在于,所述获取所述手势测试脚本对应的手势测试结果包括:
    检测所述被测应用中是否出现预设的首页关键词,若是,确定所述手势测试结果为手势解锁成功,若否,确定所述手势测试结果为手势解锁失败;及
    获取所述手势测试脚本对应的手势测试结果。
  5. 如权利要求2所述的手势测试方法,其特征在于,所述手势测试脚本生成模板为利用脚本语言编译的代码模板,所述手势测试脚本生成模板设置有待填充变量,所述待填充变量为手势对应的控件信息。
  6. 一种手势测试装置,包括:
    测试请求接收单元,用于接收手势测试请求,所述手势测试请求携带有手势标识;
    脚本获取单元,用于根据所述手势标识获取手势测试脚本,其中,所述手势测试脚本根据输入手势的控件信息序列以及手势测试脚本生成模板生成;
    手势测试单元,用于根据所述手势测试脚本对被测应用进行手势测试,所述手势测试脚本包括用于模拟所述输入手势的动作指令序列,所述动作指令序列依次包括对所述输入手势的起始控件调用点击事件函数进行操作的测试指令以及在所述输入手势的相邻控件之间依次调用滑动事件函数进行操作的测试指令;及
    测试结果获取单元,用于获取所述手势测试脚本对应的手势测试结果。
  7. 如权利要求6所述的手势测试装置,其特征在于,所述装置还包括:
    控件信息获取单元,用于获取所述输入手势的控件信息;
    控件信息序列生成单元,用于根据所述控件信息以及所述输入手势经过控件的顺序生成控件信息序列;及
    测试脚本生成单元,用于根据所述控件信息序列以及所述手势测试脚本生成模板生成所述手势测试脚本。
  8. 如权利要求6或7所述的手势测试装置,其特征在于,所述手势标识包括第一手势标识以及第二手势标识,所述脚本获取单元用于:
    根据所述第一手势标识获取第一手势测试脚本,以及,根据所述第二手势标识获取第二手势测试脚本;
    所述手势测试单元包括:
    第一脚本调用模块,用于调用所述第一手势测试脚本对所述被测应用进行手势测试;
    初始化指令发送模块,用于当所述第一手势测试脚本测试完成后,向所述被测应用发送初始化指令,以使所述被测应用进行初始化;及
    第二脚本调用模块,用于当所述被测应用的等待初始化时间到达时,调用所述第二手势测试脚本对所述被测应用进行手势测试。
  9. 如权利要求6或7所述的手势测试装置,其特征在于,所述测试结果获取单元包括:
    关键词检测模块,用于检测所述被测应用中是否出现预设的首页关键词,若是,确定所述手势测试结果为手势解锁成功,若否,确定所述手势测试结果为手势解锁失败;及
    测试结果获取模块,用于获取所述手势测试脚本对应的手势测试结果。
  10. 如权利要求7所述的手势测试装置,其特征在于,所述手势测试脚本生成模板为利用脚本语言编译的代码模板,所述手势测试脚本生成模板设置有待填充变量,所述待填充变量为手势对应的控件信息。
  11. 一种计算机设备,包括存储器及一个或多个处理器,所述存储器中储存有计算机可读指令,所述计算机可读指令被所述一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    接收手势测试请求,所述手势测试请求携带有手势标识;
    根据所述手势标识获取手势测试脚本,其中,所述手势测试脚本根据输入手势的控件信息序列以及手势测试脚本生成模板生成;
    根据所述手势测试脚本对被测应用进行手势测试,所述手势测试脚本包括用于模拟所述输入手势的动作指令序列,所述动作指令序列依次包括对所述输入手势的起始控件调用点击 事件函数进行操作的测试指令以及在所述输入手势的相邻控件之间依次调用滑动事件函数进行操作的测试指令;及
    获取所述手势测试脚本对应的手势测试结果。
  12. 如权利要求11所述的计算机设备,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    获取所述输入手势的控件信息;
    根据所述控件信息以及所述输入手势经过控件的顺序生成控件信息序列;及
    根据所述控件信息序列以及所述手势测试脚本生成模板生成所述手势测试脚本。
  13. 如权利要求11或12所述的计算机设备,其特征在于,所述手势标识包括第一手势标识以及第二手势标识,所述处理器所执行的所述根据所述手势标识获取手势测试脚本包括:
    根据所述第一手势标识获取第一手势测试脚本,以及,根据所述第二手势标识获取第二手势测试脚本;
    所述根据所述手势测试脚本对被测应用进行手势测试的步骤包括:
    调用所述第一手势测试脚本对所述被测应用进行手势测试;
    当所述第一手势测试脚本测试完成后,向所述被测应用发送初始化指令,以使所述被测应用进行初始化;及
    当所述被测应用的等待初始化时间到达时,调用所述第二手势测试脚本对所述被测应用进行手势测试。
  14. 如权利要求11或12所述的计算机设备,其特征在于,所述处理器所执行的所述获取所述手势测试脚本对应的手势测试结果包括:
    检测所述被测应用中是否出现预设的首页关键词,若是,确定所述手势测试结果为手势解锁成功,若否,确定所述手势测试结果为手势解锁失败;及
    获取所述手势测试脚本对应的手势测试结果。
  15. 如权利要求12所述的计算机设备,其特征在于,所述手势测试脚本生成模板为利用脚本语言编译的代码模板,所述手势测试脚本生成模板设置有待填充变量,所述待填充变量为手势对应的控件信息。
  16. 一个或多个存储有计算机可读指令的非易失性计算机可读存储介质,所述计算机可读指令被一个或多个处理器执行时,使得所述一个或多个处理器执行以下步骤:
    接收手势测试请求,所述手势测试请求携带有手势标识;
    根据所述手势标识获取手势测试脚本,其中,所述手势测试脚本根据输入手势的控件信息序列以及手势测试脚本生成模板生成;
    根据所述手势测试脚本对被测应用进行手势测试,所述手势测试脚本包括用于模拟所述输入手势的动作指令序列,所述动作指令序列依次包括对所述输入手势的起始控件调用点击事件函数进行操作的测试指令以及在所述输入手势的相邻控件之间依次调用滑动事件函数进行操作的测试指令;及
    获取所述手势测试脚本对应的手势测试结果。
  17. 如权利要求16所述的存储介质,其特征在于,所述处理器执行所述计算机可读指令时还执行以下步骤:
    获取所述输入手势的控件信息;
    根据所述控件信息以及所述输入手势经过控件的顺序生成控件信息序列;及
    根据所述控件信息序列以及所述手势测试脚本生成模板生成所述手势测试脚本。
  18. 如权利要求16或17所述的存储介质,其特征在于,所述手势标识包括第一手势标识以及第二手势标识,所述处理器所执行的所述根据所述手势标识获取手势测试脚本包括:
    根据所述第一手势标识获取第一手势测试脚本,以及,根据所述第二手势标识获取第二手势测试脚本;
    所述根据所述手势测试脚本对被测应用进行手势测试的步骤包括:
    调用所述第一手势测试脚本对所述被测应用进行手势测试;
    当所述第一手势测试脚本测试完成后,向所述被测应用发送初始化指令,以使所述被测应用进行初始化;及
    当所述被测应用的等待初始化时间到达时,调用所述第二手势测试脚本对所述被测应用进行手势测试。
  19. 如权利要求16或17所述的存储介质,其特征在于,所述处理器所执行的所述获取所述手势测试脚本对应的手势测试结果包括:
    检测所述被测应用中是否出现预设的首页关键词,若是,确定所述手势测试结果为手势解锁成功,若否,确定所述手势测试结果为手势解锁失败;及
    获取所述手势测试脚本对应的手势测试结果。
  20. 如权利要求17所述的存储介质,其特征在于,所述手势测试脚本生成模板为利用脚本语言编译的代码模板,所述手势测试脚本生成模板设置有待填充变量,所述待填充变量为手势对应的控件信息。
PCT/CN2018/096373 2017-07-25 2018-07-20 手势测试方法、装置、计算机设备和存储介质 WO2019019955A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201710614421.7 2017-07-25
CN201710614421.7A CN107783867B (zh) 2017-07-25 2017-07-25 手势测试方法、装置、计算机设备和存储介质

Publications (1)

Publication Number Publication Date
WO2019019955A1 true WO2019019955A1 (zh) 2019-01-31

Family

ID=61437801

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2018/096373 WO2019019955A1 (zh) 2017-07-25 2018-07-20 手势测试方法、装置、计算机设备和存储介质

Country Status (2)

Country Link
CN (1) CN107783867B (zh)
WO (1) WO2019019955A1 (zh)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107783867B (zh) * 2017-07-25 2020-02-14 深圳壹账通智能科技有限公司 手势测试方法、装置、计算机设备和存储介质
CN109885444B (zh) * 2019-01-16 2022-03-15 深圳壹账通智能科技有限公司 基于手势识别的测试方法、装置、存储介质及终端设备
CN115145464B (zh) * 2022-07-28 2023-07-18 重庆长安汽车股份有限公司 一种页面测试方法、装置、电子设备及存储介质

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9154611B1 (en) * 2006-08-14 2015-10-06 Soasta, Inc. Functional test automation for gesture-based mobile applications
CN104991687A (zh) * 2015-06-09 2015-10-21 惠州Tcl移动通信有限公司 一种获取触屏设备曲线操作轨迹的方法及系统
CN105335283A (zh) * 2014-08-01 2016-02-17 阿里巴巴集团控股有限公司 终端设备中的应用测试方法及装置
CN105653438A (zh) * 2014-11-12 2016-06-08 成都鼎桥通信技术有限公司 安卓设备的跨进程自动化测试方法和装置
CN107783867A (zh) * 2017-07-25 2018-03-09 上海壹账通金融科技有限公司 手势测试方法、装置、计算机设备和存储介质

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309797B (zh) * 2012-03-09 2016-05-04 阿里巴巴集团控股有限公司 用户界面自动化测试方法及装置
TW201541242A (zh) * 2014-04-29 2015-11-01 Hon Hai Prec Ind Co Ltd 實體機檢測系統及方法
CN105320595A (zh) * 2014-07-31 2016-02-10 腾讯科技(深圳)有限公司 一种应用测试方法和装置
CN105095078A (zh) * 2015-07-22 2015-11-25 厦门美图移动科技有限公司 一种系统自动化测试设备、方法和计算设备
CN105824755B (zh) * 2016-03-17 2019-03-15 厦门美图移动科技有限公司 一种自动化测试方法、装置及移动终端
CN106126424B (zh) * 2016-06-29 2018-09-14 厦门美图移动科技有限公司 一种脚本可视化的自动化测试方法、装置和移动终端
CN106874190B (zh) * 2016-12-30 2018-03-16 上海壹账通金融科技有限公司 用户界面的测试方法及服务器

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9154611B1 (en) * 2006-08-14 2015-10-06 Soasta, Inc. Functional test automation for gesture-based mobile applications
CN105335283A (zh) * 2014-08-01 2016-02-17 阿里巴巴集团控股有限公司 终端设备中的应用测试方法及装置
CN105653438A (zh) * 2014-11-12 2016-06-08 成都鼎桥通信技术有限公司 安卓设备的跨进程自动化测试方法和装置
CN104991687A (zh) * 2015-06-09 2015-10-21 惠州Tcl移动通信有限公司 一种获取触屏设备曲线操作轨迹的方法及系统
CN107783867A (zh) * 2017-07-25 2018-03-09 上海壹账通金融科技有限公司 手势测试方法、装置、计算机设备和存储介质

Also Published As

Publication number Publication date
CN107783867B (zh) 2020-02-14
CN107783867A (zh) 2018-03-09

Similar Documents

Publication Publication Date Title
WO2020186783A1 (zh) 数据导入方法、装置、计算机设备和存储介质
CN110209652B (zh) 数据表迁移方法、装置、计算机设备和存储介质
US9152542B2 (en) Automatic generation of test scripts
CN111061526B (zh) 自动化测试方法、装置、计算机设备及存储介质
WO2020253061A1 (zh) 页面生成方法、装置、计算机设备和存储介质
WO2019161619A1 (zh) 接口自动化测试方法、装置、设备及计算机可读存储介质
CN110162453B (zh) 测试方法、装置、计算机可读存储介质和计算机设备
WO2019019955A1 (zh) 手势测试方法、装置、计算机设备和存储介质
WO2019227708A1 (zh) 测试案例的在线调试装置、方法及计算机可读存储介质
US8904352B2 (en) Systems and methods for processing source code during debugging operations
CN109726134B (zh) 接口测试方法和系统
CN110781070A (zh) 大数据测试验证方法、装置、计算机设备及存储介质
CN110321284B (zh) 测试数据录入方法、装置、计算机设备和存储介质
CN108923997B (zh) 一种基于python的云服务节点自动测试方法及装置
CN106126424A (zh) 一种脚本可视化的自动化测试方法、装置和移动终端
WO2018177205A1 (zh) 回归测试方法、装置、计算机设备和存储介质
CN109144799A (zh) 一体化测试方法、装置、计算机设备和存储介质
CN110888709A (zh) 监控屏的智能操作方法、装置、计算机设备和存储介质
CN109408372A (zh) 公共组件测试方法、装置、计算机设备和存储介质
CN111797026A (zh) 测试用例生成方法、装置、计算机设备及存储介质
US20230035104A1 (en) Verification method, apparatus and device, and storage medium
CN116302743A (zh) 一种usb接口测试方法、系统、计算机设备和存储介质
CN111414309B (zh) 应用程序的自动化测试方法、计算机设备和存储介质
CN109815126A (zh) 软件测试方法、装置、计算机设备和存储介质
CN112685311A (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: 18838324

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: 18838324

Country of ref document: EP

Kind code of ref document: A1

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 28.05.2020)

122 Ep: pct application non-entry in european phase

Ref document number: 18838324

Country of ref document: EP

Kind code of ref document: A1