WO2019019628A1 - 移动应用的测试方法、装置、测试设备及介质 - Google Patents
移动应用的测试方法、装置、测试设备及介质 Download PDFInfo
- Publication number
- WO2019019628A1 WO2019019628A1 PCT/CN2018/077224 CN2018077224W WO2019019628A1 WO 2019019628 A1 WO2019019628 A1 WO 2019019628A1 CN 2018077224 W CN2018077224 W CN 2018077224W WO 2019019628 A1 WO2019019628 A1 WO 2019019628A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- test
- text box
- jump
- page
- text
- Prior art date
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/362—Software debugging
- G06F11/3644—Software debugging by instrumenting at runtime
Definitions
- the present application belongs to the technical field of testing, and in particular, to a test method, device, test device and medium for a mobile application.
- Functional testing is the most basic part of the testing process. It involves testing each control in the application to determine if the control can execute normally. However, for the control of the text box, multiple text boxes may appear in one page of the mobile application. To test whether each text box can be executed one by one, the tester needs to input a specific one in each text box. After the character, click the corresponding confirmation button, and then observe whether the jump page is normal. After that, return to the initial page and re-do the above. Therefore, the test steps in the prior art are cumbersome, resulting in a relatively low test efficiency of the mobile application.
- the embodiments of the present application provide a test method, an apparatus, a test device, and a medium for a mobile application, so as to solve the problem that the test procedure is cumbersome and the test efficiency is low in the prior art.
- a first aspect of the embodiments of the present application provides a testing method for a mobile application, including:
- test text corresponding to the text box, where the test text includes at least one test character
- a second aspect of an embodiment of the present application provides a testing apparatus for a mobile application, the testing apparatus comprising means for performing the testing method of the mobile application of the first aspect described above.
- a third aspect of an embodiment of the present application provides a test device for a mobile application, comprising a memory and a processor, wherein the memory stores computer readable instructions executable on the processor, the processor executing the The steps of the test method of the mobile application as described in the first aspect are implemented when the computer readable instructions are described.
- a fourth aspect of the embodiments of the present application provides a computer readable storage medium storing computer readable instructions, the computer readable instructions being executed by a processor to implement the first aspect as described in the first aspect The steps of the mobile application's test method.
- the embodiment of the present application can determine, according to the key coordinates of each test character in the test text, each virtual button that needs to perform an analog click from the pre-activated virtual keyboard; and perform analog clicks and jumps in each virtual button in turn.
- the page image is intelligently recognized, and the automatic input of test characters is realized, and the functional test of the text box is quickly completed. Because testers no longer need to manually perform control clicks and return operations, the operational complexity and cumbersomeness of mobile application testing are reduced, and the testing efficiency of mobile applications is improved.
- FIG. 1 is a flowchart of an implementation of a test method for a mobile application according to Embodiment 1 of the present application;
- FIG. 2 is a schematic diagram of screen focus positioning of a test method for a mobile application according to Embodiment 1 of the present application;
- FIG. 3 is a specific implementation flowchart of a testing method S105 of a mobile application according to Embodiment 1 of the present application;
- FIG. 5 is a flowchart of an implementation of a test method for a mobile application provided in Embodiment 4 of the present application;
- FIG. 6 is a flowchart of implementing a testing method of a mobile application provided in Embodiment 5 of the present application;
- FIG. 7 is a structural block diagram of a testing apparatus for a mobile application according to Embodiment 6 of the present application.
- FIG. 8 is a schematic diagram of a test device for a mobile application provided in Embodiment 7 of the present application.
- FIG. 1 shows an implementation flow of a test method for a mobile application provided by an embodiment of the present application, where the method flow includes steps S101 to S105.
- the specific implementation principles of each step are as follows:
- the test page is a page displayed in the application running on the mobile terminal, which contains multiple controls.
- the above controls include, but are not limited to, user interface controls, image processing controls, and document processing controls.
- the user interface controls may be, for example, buttons, text boxes, charts, and drop-down menus.
- the text box in the test page is located according to the central coordinates of each text box pre-stored.
- the step of activating the text box in the test page includes: moving any focus to a page position corresponding to the center coordinate of the text box; performing a selection instruction to complete the pair The activation of this text box.
- the test page in the application is an HTML page.
- the way to locate the text box in the test page includes, but is not limited to, tagName, Xpath, and cssSelector. For example, if the label name of each element in the test page can be detected and the element whose label name is "input" is determined, the element is the text box in the test page.
- test text corresponding to the text box, where the test text includes at least one test character.
- test text corresponding to each text box in the mobile application can be generated in real time or written by the tester in advance. If the test text is generated in real time, after determining the currently activated text box, the test text matching the input rule is generated according to the input rule of the text box. And, for each test text generated, it is stored in the specified directory, so that when the text box of the same input rule is activated again, the test text can be directly retrieved and used.
- the test text contains one or more test characters arranged in sequence, and the test characters include characters such as Chinese, English, numbers, and punctuation.
- Each test text is used to perform a test operation of the text box, that is, after inputting each test character in the test text into the text box, a jump operation will be performed.
- S103 Determine, according to the button coordinates corresponding to each of the test characters, a virtual button that matches each of the button coordinates in the pre-activated virtual keyboard.
- the virtual keyboard represents a keyboard that is simulated by software, and the keyboard is displayed on the display interface of the mobile terminal.
- the virtual keyboard is a soft keyboard that comes with the Android system.
- the virtual keyboard contains virtual keys of various characters, and each virtual key corresponds to a preset key coordinate.
- each test character in the test text is read, and according to the correspondence between the preset character and the key coordinate, the key coordinates of each test character are obtained, and based on the obtained key coordinates, the virtual keyboard is determined.
- the virtual button corresponding to the button coordinates.
- the tester in order to visually verify the test process, it is convenient for the tester to observe the positioning process of the virtual button.
- the terminal device running the mobile application is the terminal device of the Android system
- the Android system is started. After the coordinate positioning function, the position coordinates corresponding to the current focus of the screen will be displayed at the top of the display interface of the mobile terminal.
- the position of the screen focus is indeed the position where the virtual button is located, indicating that the virtual button is positioned accurately.
- S104 Perform an analog click on the virtual button corresponding to each test character in sequence according to the appearance order of the test characters in the test text, to input the test character in the text box.
- Each test character in the test text is sequentially read, and after each test character is read and the virtual key corresponding to the test character is determined, the virtual button is pressed by the preset DOWN_AND_UP method by calling the preset monkeyrunner software. After the simulated action of the bounce, the simulated click on the virtual button is completed.
- each virtual key in the virtual keyboard When it is detected that each virtual key in the virtual keyboard is clicked, the character corresponding to the virtual key is input to the text box activated at the current time.
- the virtual keys corresponding to each test character are simulated. After the click is completed, the test characters in the test text will be displayed in the input box.
- S105 Acquire a jump event corresponding to the text box after the test character input is completed, and perform recognition processing on the jump event to obtain a test result based on the text box.
- each text box in the test page there are controls for jumping to a new page or jumping to other locations on the page, such as determining a button, logging in a button, searching for a button, and the like.
- the text box is associated with its neighboring controls.
- the control in the test page is positioned and activated according to the preset coordinates or the control ID of the control associated with the text box, thereby executing the text box Associated control selection operations.
- the focus shift of the current display interface is completed according to the jump condition corresponding to the control.
- the jump event is identified by a preset algorithm to determine whether the page test result of the text box is normal.
- the preset algorithm may be: obtaining a link address of a control associated with the text box; determining whether the page address corresponding to the jump page is the same as the link address; if the page address corresponding to the jump page is related to the link If the address is the same, it is determined that the test result based on the text box is normal; if the page address corresponding to the jump page is different from the link address, it is determined that the page test result based on the text box is a test abnormality.
- FIG. 3 shows a specific implementation process of the testing method S105 of the mobile application provided in Embodiment 1 of the present application, which is described in detail as follows:
- S1051 Acquire a jump page corresponding to the text box after the test character input is completed.
- the jump event is a page jump event.
- the test characters contained in the text box are encapsulated into the above page request and uploaded to the background server of the mobile application.
- S1052 Perform a screenshot processing on the jump page to obtain a jump page image.
- the screenshot of the current time jump page is completed based on the takeSnapshot method provided by the above monkeyrunner software.
- the image obtained by the screenshot is the jump page image.
- each text box in the test page a jump page image obtained by the text box in a normal jump state is pre-stored, and the jump page image is a reference jump page image.
- each text box in the test page corresponds to a control ID.
- a reference jump page image associated with the control ID is matched from the preset reference jump page image storage directory.
- the size and resolution of the reference jump page image are the same as the display page size and the resolution size of the mobile terminal.
- S1054 Calculate an image similarity between the jump page image and the reference jump page image by using a preset image comparison algorithm.
- Image contrast algorithms include, but are not limited to, Scale Invariant Feature Transform (SIFT), bilinear image similarity matching algorithm based on depth feature analysis, and OpenCV image similarity ORB algorithm.
- SIFT Scale Invariant Feature Transform
- bilinear image similarity matching algorithm based on depth feature analysis
- OpenCV image similarity ORB algorithm OpenCV image similarity ORB algorithm.
- the image comparison algorithm can be used to identify the obtained jump page image and the reference jump page image, and the image similarity between the two can be obtained.
- calculating image similarity between the jump page image and the reference jump page image may specifically include: respectively calculating respective pixels in the jump page image and the reference jump page image a gray value of the point; obtaining a first average gray value of the jump page image and a second average gray value of the reference jump page image; calculating a gray value of each pixel in the jump page image and the first average a first difference value of the gray value and a second difference between the gray value of each pixel in the reference jump page image and the second average gray value; based on the obtained first difference and the second The difference value is calculated as a hash value corresponding to the jump page image and the reference jump page image, and the difference between the two hash values is determined as the image similarity.
- the jump page image and the reference jump page image are the same image, or the jump page image and the reference jump page image may be considered to be the same. image. It can be seen that the jump page returned after the simulation click is completed is the page in the normal response state, so the test result based on the page of the above text box is normal.
- the image similarity is less than the first threshold, it indicates that the jump page image and the reference jump page image are different images.
- the jump page returned after the simulation click is completed is the page in the abnormal response state, so the page test result based on the above text box is a test exception, and the exception type is a response error.
- a jump page image can be obtained, thereby being able to use the image comparison algorithm to calculate the image similarity of the jump page image and the reference jump page image corresponding to the text box. .
- the image similarity is lower than the first threshold, it can be determined that an abnormality occurs in the return page at the current time, thereby realizing automatic recognition of the page test result.
- the type of the abnormality of the page test result is further determined. As shown in FIG. 4, after the above S104, the method further includes:
- the jump page is started to be loaded.
- the mobile terminal will begin to gradually load the various page elements in the jump page.
- the current time point is recorded, and the time point is determined as the second time.
- the difference between the second moment and the first moment includes the webpage request processing time of the remote server and the network transmission time. If the difference is greater than the second threshold, it indicates that the processing time of the webpage request is too long or the network delay is large. Therefore, the test result of the text box based on the text box is determined to be a test exception, and the specific exception type is a response timeout.
- the difference between the third moment and the first moment is the total time required to jump to the page. If the difference reaches the third threshold, the jump page is still not loaded, indicating that the total time taken to jump the page is too long, and the network interrupt may occur or the page cannot be returned normally. Therefore, the text box-based page test is determined. The result is a test exception, and the specific exception type is also recorded as a response timeout.
- the function test accuracy of the page can be further determined by determining whether the jump page response process and the required time consumption of the loading process are greater than a preset threshold.
- the ability to simulate the user's experience when actually using the page can be simulated by calculating the delay.
- the time consumption is greater than the preset threshold, the specific abnormal type corresponding to the test abnormality can be automatically recognized, thereby achieving a more comprehensive automatic test effect.
- the processing method when the page test result is abnormal is further defined.
- the test method of the mobile application further includes:
- test abnormality includes the response error and the response timeout.
- test log storage directory corresponding to the text box is generated in the specified storage path, and the test process related to the text box is recorded.
- the test information obtained in the test includes the test text used in the test process, each time node in the test process, the page test exception type, the jump page image, the reference jump page image, the image similarity, and the cause of the abnormality.
- the test text and the jump page image obtained by the screenshot processing are stored in the specified test log storage directory by calling the writeToFile method preset in the monkeyrunner software.
- the tester can quickly find the text box in which the test exception occurs and its corresponding test information based on the test log storage directory, so that the tester can analyze and summarize the test results. and.
- the tester can manually perform the test character input operation based on the text box again according to the test text, and further determines the accuracy of the automated page test result.
- the processing method when the page test result is abnormal is further defined.
- the test method of the mobile application further includes:
- the input rule indicates the character type of the character that can be entered in the text box and the number of characters.
- Each text box in the test page has its corresponding input rules.
- the Xpath and the variable definition of each control in the mobile application test page can be read. If the control in the test page is an input box, its variable definition contains input rules.
- the Xpath and variable definition for each control in the test page can be obtained from the following file running the mobile terminal: Android-SDK ⁇ tools ⁇ uiautomatorviewer.bat.
- the input rules are identified and processed to obtain mutually exclusive rules for input rules. For example, if the input rule is an English letter, the obtained mutual exclusion rule is a non-English letter.
- the mutual exclusion rule is input into a preset random character generation algorithm to generate a random character, and the total number of characters of the random character is also a random number.
- the key coordinates corresponding to each random character are sequentially acquired, and each key coordinate is determined in the virtual keyboard displayed on the display interface.
- the virtual button represented. After the virtual button is pressed and the two finger touch simulation actions are triggered by calling the DOWN_AND_UP method, the simulated click of the virtual button corresponding to the random character is completed.
- the input box value of the control ID can be monitored in real time by means of jquery or the like in the prior art.
- the value of the input box detected in real time is "null", that is, a null value, it means that the random character generated in the above step S113 that does not match the input rule is not successfully input into the text box, and therefore, the text box can be determined.
- the input restriction conditions take effect and the input function of the text box is tested normally.
- the input box value detected in real time includes a specific character, that is, a non-null value, it indicates that the random character generated in the above step S113 that does not match the input rule has been successfully input into the text box, so the text box can be determined.
- the input constraints are invalid. It can be seen that the user can also input illegal characters into the text box, thereby easily causing data anomalies in the subsequent processing of the mobile application. Therefore, it is determined that the input function of the text box is tested abnormally.
- the illegal character input operation of the user can be simulated; the input box value in the text box is In the case of a null value, the page test result can be automatically recognized as an input abnormality, which improves the test efficiency of the mobile application.
- FIG. 7 is a structural block diagram of the test device of the mobile application provided by the embodiment of the present application. For the convenience of description, only the related to the embodiment of the present application is shown. section.
- the apparatus includes:
- the positioning unit 701 is configured to locate a text box in the test page and activate any of the text boxes that have been located.
- the first obtaining unit 702 is configured to obtain test text corresponding to the text box, where the test text includes at least one test character.
- the first determining unit 703 is configured to determine, according to the button coordinates corresponding to each of the test characters, a virtual button that matches each of the button coordinates in the pre-activated virtual keyboard.
- the input unit 704 is configured to perform an analog click on the virtual button corresponding to each test character in sequence according to the appearance order of the test characters in the test text, to input the test in the text box. character.
- the second obtaining unit 705 is configured to obtain a jump page image obtained after the simulated click is completed, and perform recognition processing on the jump page image to obtain a page test result based on the text box.
- the second obtaining unit 705 includes:
- the first obtaining sub-unit is configured to obtain a jump page obtained after the simulated click is completed.
- the screenshot subunit is configured to perform a screenshot processing on the jump page to obtain a jump page image.
- a second acquiring subunit configured to acquire a reference jump page image corresponding to the text box.
- the calculating subunit is configured to calculate an image similarity between the jump page image and the reference jump page image by using a preset image comparison algorithm.
- Determining a subunit configured to determine, when the image similarity is less than the first threshold, a page test result based on the text box as a response error.
- the device further includes:
- the third obtaining unit is configured to acquire a first moment corresponding to when the simulated click is completed.
- a fourth acquiring unit configured to acquire a second time corresponding to when the jump page starts loading.
- the fifth obtaining unit is configured to acquire a third moment corresponding to when the jump page is loaded.
- a second determining unit configured to determine, if the difference between the second time and the first time is greater than a second threshold, or the difference between the third time and the first time is greater than a third threshold
- the result of the page test is the response timeout.
- the device further includes:
- a establishing unit configured to establish a test log storage directory if the page test result of the current time is detected as a test abnormality, where the test abnormality includes the response error and the response timeout.
- a storage unit configured to store the jump page image and the test text to the test log storage directory.
- the device further includes:
- a sixth obtaining unit configured to acquire an input rule corresponding to the text box.
- An uploading unit configured to generate a random character that does not match the input rule.
- a simulated click unit configured to perform a simulated click on the virtual button corresponding to the random character in the pre-activated virtual keyboard.
- the detecting unit is configured to detect whether the input box value of the text box is a null value.
- a third determining unit configured to determine that the page test result is an input abnormality if the input box value is a non-null value.
- FIG. 8 is a schematic diagram of a test device for a mobile application according to an embodiment of the present application.
- the test device 8 of the mobile application of this embodiment includes a processor 80, a memory 81, and computer readable instructions 82 stored in the memory 81 and executable on the processor 80, such as Test program for mobile apps.
- the processor 80 executes the computer readable instructions 82 to implement the steps in the method of testing the various mobile applications described above, such as steps 101 through 105 shown in FIG.
- the processor 80 when executing the computer readable instructions 82, implements the functions of the various modules/units in the various apparatus embodiments described above, such as the functions of the units 701 through 705 shown in FIG.
- the computer readable instructions 82 may be partitioned into one or more modules/units that are stored in the memory 81 and executed by the processor 80, To complete this application.
- the one or more modules/units may be a series of computer readable instruction segments capable of performing a particular function, the instruction segments being used to describe the execution of the computer readable instructions 82 in the test device 8 of the mobile application. .
- the test device 8 of the mobile application may be a mobile device such as a mobile phone, a notebook, a palmtop computer, and a tablet computer.
- the test device of the mobile application may include, but is not limited to, a processor 80, a memory 81. It will be understood by those skilled in the art that FIG. 8 is merely an example of the test device 8 of the mobile application, does not constitute a limitation of the test device 8 of the mobile application, may include more or less components than the illustration, or combine some
- the components, or different components, such as the test device of the mobile application may also include input and output devices, network access devices, buses, and the like.
- the so-called processor 80 can be a central processing unit (Central Processing Unit, CPU), can also be other general-purpose processors, digital signal processors (DSP), application specific integrated circuits (Application Specific Integrated Circuit (ASIC), Field-Programmable Gate Array (FPGA) or other programmable logic device, discrete gate or transistor logic device, discrete hardware components, etc.
- the general purpose processor may be a microprocessor or the processor or any conventional processor or the like.
- the memory 81 may be an internal storage unit of the test device 8 of the mobile application, such as a hard disk or memory of the test device 8 of the mobile application.
- the memory 81 may also be an external storage device of the test device 8 of the mobile application, such as a plug-in hard disk equipped with a test device 8 of the mobile application, a smart memory card (SMC), and a secure digital device. (Secure Digital, SD) card, flash card (Flash Card) and so on.
- the memory 81 may also include both an internal storage unit of the test device 8 of the mobile application and an external storage device.
- the memory 81 is configured to store the computer readable instructions and other programs and data required by the test device of the mobile application.
- the memory 81 can also be used to temporarily store data that has been output or is about to be output.
- each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.
- the above integrated unit can be implemented in the form of hardware or in the form of a software functional unit.
- the integrated unit if implemented in the form of a software functional unit and sold or used as a standalone product, may be stored in a computer readable storage medium.
- a computer readable storage medium A number of instructions are included to cause a computer device (which may be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods described in various embodiments of the present application.
- the foregoing storage medium includes: a U disk, a mobile hard disk, a read-only memory (ROM), and a random access memory (RAM, Random Access).
- ROM read-only memory
- RAM Random Access
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
Description
Claims (20)
- 一种移动应用的测试方法,其特征在于,包括:对测试页面中的文本框进行定位和激活;获取所述文本框对应的测试文本,所述测试文本中包含有至少一个测试字符;根据各个所述测试字符对应的按键坐标,在预先启动的虚拟键盘中,分别确定与每一所述按键坐标匹配的虚拟按键;基于所述测试字符在所述测试文本中的出现顺序,依次在各个所述测试字符对应的所述虚拟按键上进行模拟点击,以在所述文本框中输入所述测试字符;获取所述文本框在所述测试字符输入完成后对应的跳转事件,并对所述跳转事件进行识别处理,以得到基于所述文本框的测试结果。
- 如权利要求1所述的测试方法,其特征在于,所述跳转事件为页面跳转事件,所述获取所述文本框在所述测试字符输入完成后对应的跳转事件,并对所述跳转事件进行识别处理,以得到基于所述文本框的测试结果,包括:获取所述文本框在所述测试字符输入完成后对应得到的跳转页面;对所述跳转页面进行截图处理,得到跳转页面图像;获取所述文本框对应的参考跳转页面图像;通过预设的图像对比算法,计算所述跳转页面图像与所述参考跳转页面图像的图像相似度;当所述图像相似度小于第一阈值时,确定基于所述文本框的测试结果为响应错误。
- 如权利要求2所述的测试方法,其特征在于,还包括:获取触发页面跳转事件时所对应的第一时刻;获取所述跳转页面开始加载时所对应的第二时刻;获取所述跳转页面加载完成时所对应的第三时刻;若所述第二时刻与所述第一时刻的差值大于第二阈值,或者所述第三时刻与所述第一时刻的差值大于第三阈值,则确定基于所述文本框的测试结果为响应超时。
- 如权利要求2或3所述的测试方法,其特征在于,还包括:若检测到当前时刻基于所述文本框的测试结果为测试异常,则建立测试日志存储目录,所述测试异常包括所述响应错误以及所述响应超时;将所述跳转页面图像以及所述测试文本存储至所述测试日志存储目录。
- 如权利要求1所述的测试方法,其特征在于,在所述对测试页面中的文本框进行定位和激活之后,还包括:获取所述文本框对应的输入规则;生成与所述输入规则不匹配的随机字符;在所述预先启动的虚拟键盘中,对所述随机字符对应的虚拟按键进行模拟点击;检测所述文本框的输入框值是否为空值;若所述输入框值为非空值,则确定基于所述文本框的测试结果为输入异常。
- 一种移动应用的测试装置,其特征在于,包括:定位单元,用于对测试页面中的文本框进行定位,并激活已定位的任一所述文本框;第一获取单元,用于获取所述文本框对应的测试文本,所述测试文本中包含有至少一个测试字符;第一确定单元,用于根据各个所述测试字符对应的按键坐标,在预先启动的虚拟键盘中,分别确定与每一所述按键坐标匹配的虚拟按键;输入单元,用于基于所述测试字符在所述测试文本中的出现顺序,依次在各个所述测试字符对应的所述虚拟按键上进行模拟点击,以在所述文本框中输入所述测试字符;第二获取单元,用于获取模拟点击完成后所得到的跳转页面图像,并对所述跳转页面图像进行识别处理,以得到基于所述文本框的页面测试结果。
- 根据权利要求6所述的测试装置,其特征在于,所述第二获取单元包括:第一获取子单元,用于获取模拟点击完成后所得到的跳转页面;截图子单元,用于对所述跳转页面进行截图处理,得到跳转页面图像;第二获取子单元,用于获取所述文本框对应的参考跳转页面图像;计算子单元,用于通过预设的图像对比算法,计算所述跳转页面图像与所述参考跳转页面图像的图像相似度;确定子单元,用于当所述图像相似度小于第一阈值时,确定基于所述文本框的页面测试结果为响应错误。
- 根据权利要求7所述的测试装置,其特征在于,还包括:第三获取单元,用于获取模拟点击完成时所对应的第一时刻;第四获取单元,用于获取所述跳转页面开始加载时所对应的第二时刻;第五获取单元,用于获取所述跳转页面加载完成时所对应的第三时刻;第二确定单元,用于若所述第二时刻与所述第一时刻的差值大于第二阈值,或者所述第三时刻与所述第一时刻的差值大于第三阈值,则确定所述页面测试结果为响应超时。
- 根据权利要求7或8所述的测试装置,其特征在于,还包括:建立单元,用于若检测到当前时刻的所述页面测试结果为测试异常,则建立测试日志存储目录,所述测试异常包括所述响应错误以及所述响应超时;存储单元,用于将所述跳转页面图像以及所述测试文本存储至所述测试日志存储目录。
- 根据权利要求6所述的测试装置,其特征在于,还包括:第六获取单元,用于获取所述文本框对应的输入规则;上传单元,用于生成与所述输入规则不匹配的随机字符;模拟点击单元,用于在所述预先启动的虚拟键盘中,对所述随机字符对应的虚拟按键进行模拟点击;检测单元,用于检测所述文本框的输入框值是否为空值;第三确定单元,用于若所述输入框值为非空值,则确定所述页面测试结果为输入异常。
- 一种移动应用的测试设备,其特征在于,包括存储器以及处理器,所述存储器中存储有可在所述处理器上运行的计算机可读指令,所述处理器执行所述计算机可读指令时实现如下步骤:对测试页面中的文本框进行定位和激活;获取所述文本框对应的测试文本,所述测试文本中包含有至少一个测试字符;根据各个所述测试字符对应的按键坐标,在预先启动的虚拟键盘中,分别确定与每一所述按键坐标匹配的虚拟按键;基于所述测试字符在所述测试文本中的出现顺序,依次在各个所述测试字符对应的所述虚拟按键上进行模拟点击,以在所述文本框中输入所述测试字符;获取所述文本框在所述测试字符输入完成后对应的跳转事件,并对所述跳转事件进行识别处理,以得到基于所述文本框的测试结果。
- 根据权利要求11所述的测试设备,其特征在于,所述跳转事件为页面跳转事件,所述获取所述文本框在所述测试字符输入完成后对应的跳转事件,并对所述跳转事件进行识别处理,以得到基于所述文本框的测试结果,包括:获取所述文本框在所述测试字符输入完成后对应得到的跳转页面;对所述跳转页面进行截图处理,得到跳转页面图像;获取所述文本框对应的参考跳转页面图像;通过预设的图像对比算法,计算所述跳转页面图像与所述参考跳转页面图像的图像相似度;当所述图像相似度小于第一阈值时,确定基于所述文本框的测试结果为响应错误。
- 根据权利要求12所述的测试设备,其特征在于,所述处理器执行所述计算机可读指令时,还实现如下步骤:获取触发页面跳转事件时所对应的第一时刻;获取所述跳转页面开始加载时所对应的第二时刻;获取所述跳转页面加载完成时所对应的第三时刻;若所述第二时刻与所述第一时刻的差值大于第二阈值,或者所述第三时刻与所述第一时刻的差值大于第三阈值,则确定基于所述文本框的测试结果为响应超时。
- 根据权利要求12或13所述的测试设备,其特征在于,所述处理器执行所述计算机可读指令时,还实现如下步骤:若检测到当前时刻基于所述文本框的测试结果为测试异常,则建立测试日志存储目录,所述测试异常包括所述响应错误以及所述响应超时;将所述跳转页面图像以及所述测试文本存储至所述测试日志存储目录。
- 根据权利要求11所述的测试设备,其特征在于,所述处理器执行所述计算机可读指令时,还实现如下步骤:获取所述文本框对应的输入规则;生成与所述输入规则不匹配的随机字符;在所述预先启动的虚拟键盘中,对所述随机字符对应的虚拟按键进行模拟点击;检测所述文本框的输入框值是否为空值;若所述输入框值为非空值,则确定基于所述文本框的测试结果为输入异常。
- 一种计算机可读存储介质,所述计算机可读存储介质存储有计算机可读指令,其特征在于,所述计算机可读指令被至少一个处理器执行时实现如下步骤:对测试页面中的文本框进行定位和激活;获取所述文本框对应的测试文本,所述测试文本中包含有至少一个测试字符;根据各个所述测试字符对应的按键坐标,在预先启动的虚拟键盘中,分别确定与每一所述按键坐标匹配的虚拟按键;基于所述测试字符在所述测试文本中的出现顺序,依次在各个所述测试字符对应的所述虚拟按键上进行模拟点击,以在所述文本框中输入所述测试字符;获取所述文本框在所述测试字符输入完成后对应的跳转事件,并对所述跳转事件进行识别处理,以得到基于所述文本框的测试结果。
- 根据权利要求16所述的计算机可读存储介质,其特征在于,所述跳转事件为页面跳转事件,所述获取所述文本框在所述测试字符输入完成后对应的跳转事件,并对所述跳转事件进行识别处理,以得到基于所述文本框的测试结果,包括:获取所述文本框在所述测试字符输入完成后对应得到的跳转页面;对所述跳转页面进行截图处理,得到跳转页面图像;获取所述文本框对应的参考跳转页面图像;通过预设的图像对比算法,计算所述跳转页面图像与所述参考跳转页面图像的图像相似度;当所述图像相似度小于第一阈值时,确定基于所述文本框的测试结果为响应错误。
- 根据权利要求17所述的计算机可读存储介质,其特征在于,所述计算机可读指令被至少一个处理器执行时,还实现如下步骤:获取触发页面跳转事件时所对应的第一时刻;获取所述跳转页面开始加载时所对应的第二时刻;获取所述跳转页面加载完成时所对应的第三时刻;若所述第二时刻与所述第一时刻的差值大于第二阈值,或者所述第三时刻与所述第一时刻的差值大于第三阈值,则确定基于所述文本框的测试结果为响应超时。
- 根据权利要求17或18所述的计算机可读存储介质,其特征在于,所述计算机可读指令被至少一个处理器执行时,还实现如下步骤:若检测到当前时刻基于所述文本框的测试结果为测试异常,则建立测试日志存储目录,所述测试异常包括所述响应错误以及所述响应超时;将所述跳转页面图像以及所述测试文本存储至所述测试日志存储目录。
- 根据权利要求16所述的计算机可读存储介质,其特征在于,所述计算机可读指令被至少一个处理器执行时,还实现如下步骤:获取所述文本框对应的输入规则;生成与所述输入规则不匹配的随机字符;在所述预先启动的虚拟键盘中,对所述随机字符对应的虚拟按键进行模拟点击;检测所述文本框的输入框值是否为空值;若所述输入框值为非空值,则确定基于所述文本框的测试结果为输入异常。
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710605533.6 | 2017-07-24 | ||
CN201710605533.6A CN107783898B (zh) | 2017-07-24 | 2017-07-24 | 移动应用的测试方法及测试设备 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2019019628A1 true WO2019019628A1 (zh) | 2019-01-31 |
Family
ID=61437480
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2018/077224 WO2019019628A1 (zh) | 2017-07-24 | 2018-02-26 | 移动应用的测试方法、装置、测试设备及介质 |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN107783898B (zh) |
WO (1) | WO2019019628A1 (zh) |
Families Citing this family (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109033772B (zh) * | 2018-08-09 | 2020-04-21 | 北京云测信息技术有限公司 | 一种验证信息的输入方法及装置 |
CN109784369A (zh) * | 2018-12-14 | 2019-05-21 | 深圳壹账通智能科技有限公司 | H5页面测试方法与装置、电子设备、存储介质 |
CN109905390B (zh) * | 2019-02-26 | 2021-09-28 | 北京智游网安科技有限公司 | App劫持检测方法、api包及存储介质 |
CN111949510B (zh) * | 2019-05-17 | 2024-05-14 | 百度在线网络技术(北京)有限公司 | 测试处理方法、装置、电子设备及可读存储介质 |
CN112702597A (zh) * | 2019-10-22 | 2021-04-23 | 北京奇艺世纪科技有限公司 | 一种测试方法、测试装置、电视终端及测试系统 |
CN111104308A (zh) * | 2019-11-12 | 2020-05-05 | 贝壳技术有限公司 | 显示页面的测试方法和装置、存储介质、电子设备 |
CN110888812B (zh) * | 2019-11-26 | 2023-11-07 | 国核自仪系统工程有限公司 | 终端页面的响应时间的测试系统及测试方法 |
CN111078533A (zh) * | 2019-11-26 | 2020-04-28 | 智器云南京信息科技有限公司 | 自动化测试方法及装置、计算机设备和存储介质 |
CN112000576A (zh) * | 2020-08-25 | 2020-11-27 | 北京三快在线科技有限公司 | 代码数据的检测方法、装置、设备及存储介质 |
CN112363919B (zh) * | 2020-11-02 | 2024-02-13 | 北京云测信息技术有限公司 | 用户界面ai自动化测试方法、装置、设备和存储介质 |
CN112416777B (zh) * | 2020-11-23 | 2022-11-18 | 珠海格力电器股份有限公司 | 文本显示测试方法、装置、计算机设备和存储介质 |
CN112905451B (zh) * | 2021-02-02 | 2023-08-25 | 北京罗克维尔斯科技有限公司 | 应用程序的自动化测试方法及装置 |
CN113360398B (zh) * | 2021-06-29 | 2023-09-01 | 西安天下帮扶信息科技有限公司 | 混合应用程序测试方法、装置、设备及介质 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1641592A (zh) * | 2004-01-07 | 2005-07-20 | 北京北阳电子技术有限公司 | 一种对带键盘电子产品的功能测试方法及测试系统 |
CN102567191A (zh) * | 2010-12-15 | 2012-07-11 | 上海杉达学院 | Jsp页面测试方法及测试装置 |
CN103901307A (zh) * | 2014-04-22 | 2014-07-02 | 上海扬梓投资管理有限公司 | 一种用于车载多媒体装置的测试系统及方法 |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105653056B (zh) * | 2015-12-17 | 2019-05-28 | 北京奇虎科技有限公司 | 输入法的测试方法及装置 |
CN105740148B (zh) * | 2016-01-29 | 2018-03-06 | 博雅网信(北京)科技有限公司 | 一种移动终端自动化测试的脚本引擎系统及测试方法 |
-
2017
- 2017-07-24 CN CN201710605533.6A patent/CN107783898B/zh active Active
-
2018
- 2018-02-26 WO PCT/CN2018/077224 patent/WO2019019628A1/zh active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1641592A (zh) * | 2004-01-07 | 2005-07-20 | 北京北阳电子技术有限公司 | 一种对带键盘电子产品的功能测试方法及测试系统 |
CN102567191A (zh) * | 2010-12-15 | 2012-07-11 | 上海杉达学院 | Jsp页面测试方法及测试装置 |
CN103901307A (zh) * | 2014-04-22 | 2014-07-02 | 上海扬梓投资管理有限公司 | 一种用于车载多媒体装置的测试系统及方法 |
Also Published As
Publication number | Publication date |
---|---|
CN107783898B (zh) | 2020-03-27 |
CN107783898A (zh) | 2018-03-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
WO2019019628A1 (zh) | 移动应用的测试方法、装置、测试设备及介质 | |
US8549478B2 (en) | Graphical user interface input element identification | |
US9519401B2 (en) | Providing context menu based on predicted commands | |
KR102047568B1 (ko) | 웹페이지 렌더링 시간 측정 기법 | |
US20150378876A1 (en) | Visual graphical user interface verification | |
JP6036100B2 (ja) | ウェブ・ブラウザー画面の段階的な視覚的比較 | |
CN108664364B (zh) | 一种终端测试方法及装置 | |
CN108228861B (zh) | 用于执行机器学习的特征工程的方法及系统 | |
US9881209B2 (en) | Methods and systems for detecting tampering in a document image | |
WO2020029466A1 (zh) | 图像处理方法和装置 | |
CN107545181A (zh) | 程序运行方法、终端及计算机可读存储介质 | |
WO2020164274A1 (zh) | 网络验证数据的发送方法、装置、存储介质和服务器 | |
CN110955590A (zh) | 界面检测方法、图像处理方法、装置、电子设备及存储介质 | |
CN111641588A (zh) | 网页模拟输入检测方法、装置、计算机设备及存储介质 | |
US20150143342A1 (en) | Functional validation of software | |
CN111324352A (zh) | 一种应用页面的代码生成方法及相关设备 | |
CN113609028A (zh) | 一种页面测试方法、计算设备及可读存储介质 | |
CN107515821B (zh) | 控件测试方法和装置 | |
CN110851349B (zh) | 页面异常显示的检测方法、终端设备及存储介质 | |
CN113901996A (zh) | 设备屏幕透图检测模型训练方法及设备屏幕透图检测方法 | |
CN113111713B (zh) | 一种图像检测方法、装置、电子设备及存储介质 | |
US20190042841A1 (en) | Content verification apparatus, method for verifying content, and non-transitory computer-readable storage medium | |
CN111949510B (zh) | 测试处理方法、装置、电子设备及可读存储介质 | |
Chu et al. | Automated GUI testing for android news applications | |
US20210248206A1 (en) | Systems and methods for generating data retrieval steps |
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: 18839074 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: 18839074 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 03.08.2020) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 18839074 Country of ref document: EP Kind code of ref document: A1 |