CN113849416A - Test method, test device, storage medium and electronic equipment - Google Patents

Test method, test device, storage medium and electronic equipment Download PDF

Info

Publication number
CN113849416A
CN113849416A CN202111275484.7A CN202111275484A CN113849416A CN 113849416 A CN113849416 A CN 113849416A CN 202111275484 A CN202111275484 A CN 202111275484A CN 113849416 A CN113849416 A CN 113849416A
Authority
CN
China
Prior art keywords
page
description
test operation
test
text description
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111275484.7A
Other languages
Chinese (zh)
Inventor
王荣荣
余劲达
龚振杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN202111275484.7A priority Critical patent/CN113849416A/en
Publication of CN113849416A publication Critical patent/CN113849416A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3696Methods or tools to render software testable

Landscapes

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

Abstract

The disclosure relates to a test method, a test device, a storage medium and an electronic device, which are used for generating a text description corresponding to a test operation in real time in a test process, so that when a program error occurs, the problem can be quickly and accurately located based on the text description, and the problem locating efficiency and the program error repairing efficiency are improved. The method comprises the following steps: displaying a page to be tested of the application program; responding to the test operation of the page to be tested, and controlling the page to be tested to update page content based on the test operation; in the updating process of the page content, generating a text description corresponding to the test operation based on a preset operation description template and the page element associated with the test operation; and if a program error occurs in the updating process of the page content, sending the text description to a background system, wherein the background system is used for carrying out error positioning according to the text description.

Description

Test method, test device, storage medium and electronic equipment
Technical Field
The present disclosure relates to the field of testing technologies, and in particular, to a testing method, an apparatus, a storage medium, and an electronic device.
Background
In the testing process of the application program, when a tester finds a bug (program error) and communicates with a corresponding developer, the tester often suffers from accurately describing specific information of the bug. In the related art, it is a common way to add a recurring step to reproduce the bug, thereby achieving problem location. However, in this way, the duplicate setting needs to be manually performed, which is complicated, and it cannot be guaranteed that the duplicate information can sufficiently describe the specific information of the bug, thereby affecting the efficiency of problem location and the efficiency of bug repair.
Disclosure of Invention
This summary is provided to introduce a selection of concepts in a simplified form that are further described below in the detailed description. This summary is not intended to identify key features or essential features of the claimed subject matter, nor is it intended to be used to limit the scope of the claimed subject matter.
In a first aspect, the present disclosure provides a method of testing, the method comprising:
displaying a page to be tested of the application program;
responding to the test operation of the page to be tested, and controlling the page to be tested to update page content based on the test operation;
in the updating process of the page content, generating a text description corresponding to the test operation based on a preset operation description template and the page element associated with the test operation;
and if a program error occurs in the updating process of the page content, sending the text description to a background system, wherein the background system is used for carrying out error positioning according to the text description.
In a second aspect, the present disclosure provides a method of testing, the method comprising:
receiving a text description corresponding to a test operation sent by a test terminal, wherein the text description is sent when a program error occurs in an updating process after the test terminal responds to the test operation on a page to be tested and controls the page to be tested to update page content based on the test operation, and in the updating process of the page content, a preset operation description template and page elements related to the test operation are generated;
and performing error positioning based on the text description.
In a third aspect, the present disclosure provides a test apparatus, the apparatus comprising:
the first display module is used for displaying a page to be tested of the application program;
the control module is used for responding to the test operation of the page to be tested and controlling the page to be tested to update page content based on the test operation;
a first generation module, configured to generate, based on a preset operation description template and a page element associated with the test operation, a text description corresponding to the test operation in an update process of the page content;
and the first sending module is used for sending the text description to a background system when a program error occurs in the updating process of the page content, and the background system is used for positioning the error according to the text description.
In a fourth aspect, the present disclosure provides a test apparatus, the apparatus comprising:
the first receiving module is used for receiving a text description corresponding to a test operation sent by a test terminal, wherein the text description is sent when a program error occurs in an updating process after the test terminal responds to the test operation on a page to be tested, controls the page to be tested to update page content based on the test operation, and generates a preset operation description template and page elements related to the test operation in the updating process of the page content;
and the positioning module is used for carrying out error positioning based on the text description.
In a fifth aspect, the present disclosure provides a non-transitory computer readable storage medium having stored thereon a computer program that, when executed by a processing device, implements the steps of the method of the first or second aspect.
In a sixth aspect, the present disclosure provides an electronic device comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to carry out the steps of the method of the first or second aspect.
By the technical scheme, the text description corresponding to the test operation can be generated in real time in the test process based on the preset operation description template and the page elements associated with the test operation. Therefore, if a program error occurs in the testing process, the text description can be sent to the background system, so that the background system can perform quick and accurate problem positioning according to the text description, and the problem positioning efficiency and the program error repairing efficiency are improved.
Additional features and advantages of the disclosure will be set forth in the detailed description which follows.
Drawings
The above and other features, advantages and aspects of various embodiments of the present disclosure will become more apparent by referring to the following detailed description when taken in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numbers refer to the same or similar elements. It should be understood that the drawings are schematic and that elements and features are not necessarily drawn to scale. In the drawings:
FIG. 1 is a flow chart illustrating a testing method according to an exemplary embodiment of the present disclosure;
FIG. 2 is a process diagram in a testing method according to an exemplary embodiment of the present disclosure;
FIG. 3 is a schematic diagram illustrating a cut-out operation screenshot in a method of testing according to an exemplary embodiment of the present disclosure;
FIG. 4 is a schematic diagram illustrating an error description page in a method of testing according to an exemplary embodiment of the present disclosure;
FIG. 5 is a flow chart illustrating a testing method according to another exemplary embodiment of the present disclosure;
FIG. 6 is a block diagram illustrating a test apparatus according to an exemplary embodiment of the present disclosure;
FIG. 7 is a block diagram illustrating a testing device according to another exemplary embodiment of the present disclosure;
fig. 8 is a block diagram illustrating an electronic device according to an exemplary embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure are shown in the drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but rather are provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the disclosure are for illustration purposes only and are not intended to limit the scope of the disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order, and/or performed in parallel. Moreover, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "include" and variations thereof as used herein are open-ended, i.e., "including but not limited to". The term "based on" is "based, at least in part, on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". Relevant definitions for other terms will be given in the following description.
It should be noted that the terms "first", "second", and the like in the present disclosure are only used for distinguishing different devices, modules or units, and are not used for limiting the order or interdependence relationship of the functions performed by the devices, modules or units. It is further noted that references to "a", "an", and "the" modifications in the present disclosure are intended to be illustrative rather than limiting, and that those skilled in the art will recognize that "one or more" may be used unless the context clearly dictates otherwise.
The names of messages or information exchanged between devices in the embodiments of the present disclosure are for illustrative purposes only, and are not intended to limit the scope of the messages or information.
FIG. 1 is a flow chart illustrating a testing method according to an exemplary embodiment of the present disclosure. Referring to fig. 1, the test method may be applied to a test terminal, including:
step 101, displaying a page to be tested of an application program.
And 102, responding to the test operation of the page to be tested, and controlling the page to be tested to update the page content based on the test operation.
And 103, generating a text description corresponding to the test operation based on a preset operation description template and the page element associated with the test operation in the updating process of the page content.
And 104, if a program error occurs in the updating process of the page content, sending the text description to a background system, wherein the background system is used for carrying out error positioning according to the text description.
By the method, the text description corresponding to the test operation can be generated in real time in the test process based on the preset operation description template and the page elements associated with the test operation. Therefore, if a program error occurs in the testing process, the text description can be sent to the background system, so that the background system can perform quick and accurate problem positioning according to the text description, and the problem positioning efficiency and the program error repairing efficiency are improved.
The following is a detailed illustration of the various steps described above in order to provide a better understanding of the testing methods provided by the present disclosure to those skilled in the art.
For example, the test operation on the page to be tested may include a click operation or a slide operation on the page to be tested, which is not limited in this disclosure. In the embodiment of the present disclosure, in response to the test operation on the page to be tested, the page to be tested may be controlled to update the page content based on the test operation, that is, the page to be tested is subjected to the corresponding function test. For example, in response to a click operation on a button control used for jumping to another page in the page to be tested, the page to be tested is controlled to jump to another page.
In the updating process of the page content, the text description corresponding to the test operation can be generated based on the preset operation description template and the page element associated with the test operation. In consideration of the variety of types of test operations, a plurality of operation description templates respectively corresponding to the types of test operations may be preset, for example, a first operation description template corresponding to a click test operation is set, a second operation description template corresponding to a slide test operation is set, and the like.
In a possible manner, based on a preset operation description template and a page element associated with a test operation, a text description corresponding to the test operation is generated, which may be: and acquiring a corresponding target description template from preset operation description templates based on the type of the test operation, wherein each preset operation description template has identification information for representing the type of the test operation. And then, generating a text description corresponding to the test operation based on the target description template and the page element associated with the test operation.
By the method, the operation description template matched with the test operation can be determined according to the type of the test operation, so that more accurate text description is obtained, and possible problem positioning and problem repairing (namely bug repairing) in the subsequent process are facilitated.
In a possible manner, each preset operation description template may include preset information items to be filled, the content of each information item to be filled being empty, and each information item to be filled has identification information for characterizing the content to be filled. Correspondingly, based on the preset operation description template and the page element associated with the test operation, a text description corresponding to the test operation is generated, which may be: determining description information of a code element corresponding to a page element associated with a test operation in a source code of a page to be tested, wherein the description information comprises at least one of a class name, object information, selector information, unit information and view information corresponding to the code element. And then, based on the description information and the identification information of the information items to be filled in the operation description template, filling the description information into the information items corresponding to the operation description template to obtain the text description corresponding to the test operation.
That is, the preset operation description template presets a plurality of information items to be filled, the content of which is empty, and the plurality of information items to be filled can be filled to obtain corresponding text descriptions after obtaining the description content corresponding to the test operation. In practical application, the operation description template may be a function that performs content filling through incoming parameters, where each incoming parameter corresponds to one information item to be filled in the operation description template, and thus, a corresponding text description may be output through the function.
In the embodiment of the present disclosure, the text description may be used to perform problem location and bug repair, so that after a program error occurs, description information of a code element corresponding to a page element associated with a test operation in a source code of a page to be tested may be determined first. For example, the test operation is a sliding operation, the associated page element is a whole page element corresponding to the page to be tested, a code element corresponding to the whole page element may be determined in the source code of the page to be tested, for example, the code element corresponding to the whole page element is determined to be scrollView in the source code of the page to be tested. Then, description information of the code element may be further determined.
Illustratively, the description information may include at least one of class name information, object information, selector information, cell information, and view information corresponding to the code element. For example, referring to the above example, the code element is a scrollView, and the description information of the code element may be determined to include a scrollView class name, a proxy class name corresponding to the scrollView, and the like.
For example, for a click operation, the corresponding description information may be acquired with reference to the contents of table 1.
TABLE 1
Figure BDA0003329896650000071
Referring to table 1, if the UIControl event is triggered by a click operation, the description information may include a UIControl class name, target information, and selector information. Or the control corresponding to the click operation has text information and/or picture information, and the description information may further include the text information and/or the picture information of the control correspondingly. If the uigesturrecognizer event is triggered, the description information may include a uigesturrecognizer class name, view information of where, target information, and selector information. If the UITableViewCell event is triggered, the description information may include a UITableViewCell class name, section (cell) information and row (row) information, tableview (table view) information. If the UICollectionViewCell event is triggered, the description information may include a UICollectionViewCell class name, section (cell) information and row (line) information where the UICollectionView is located, and UICollectionView (view) information.
For example, in practical application, the code for acquiring the description information of the corresponding code element of the page element in the source code may be written in the source code in a traceless and buried manner, so as to reduce the coupling of the code.
After the description information of the corresponding code element in the source code is obtained, the description information may be filled in the information item corresponding to the operation description template based on the description information and the identification information of the information item to be filled in the operation description template, so as to obtain the text description corresponding to the test operation. For example, the operation description template corresponding to UIControl is: UIControl: "the < class name information > is clicked, target is < object information >, and selector is < selector information >. Based on this, the generated textual description may be: UIControl: "SSButton clicked, target is SSViewController, and selector is onButtonClick". Or, the operation description template corresponding to the page jump is as follows: the < class name information B > is jumped to from < class name information a >. Based on this, a textual description may be generated as: jump from AController to BController.
After the textual description is generated, the textual description may be sent to a background system in response to a commit operation on the textual description. That is to say, in the embodiment of the present disclosure, a tester may submit a text description to the bug background system, and a corresponding developer may open the bug background system to find the description information of the corresponding bug, and go offline for positioning. And the description information can comprise the text description corresponding to the test operation, so that a developer can quickly and accurately position the problem based on the text description in the error description page, and the problem positioning efficiency and bug repairing efficiency are improved.
In a possible mode, operation screenshots and log information corresponding to the test operations can be generated, and then when a program error occurs in the updating process of the page content, the operation screenshots and the log information are sent to the background system, and the background system can be used for positioning the error according to at least one of the text description, the operation screenshots and the log information.
That is, in addition to the textual description, embodiments of the present disclosure provide information in two dimensions, an operation screenshot and log information, to assist in problem location. The text description can accurately describe the page elements related to the test operation when the program error occurs, the operation screenshot can visually display the page element condition when the program error occurs, the corresponding page elements can be highlighted, and the log information can globally display the running condition of the application program when the program error occurs. Therefore, the program error can be more comprehensively described by combining the character description, the operation screenshot and the log information, so that the problem positioning is more accurately carried out.
For example, referring to FIG. 2, during testing of a mobile device, textual descriptions, operational screenshots, and log information may be generated to assist in problem location. The text description may include at least one of a click operation description, a slide operation description, and a page jump description according to an actual test situation.
For example, the log information may be generated in real time during the updating process of the page content, and the operation screenshot may be obtained by screenshot of the current page content in response to the updating process of the page content. Or, the operation screenshot may be obtained by recording the whole updating process of the page content and then screening the corresponding video frame in the recorded video. Specifically, the updating process of the page content may be recorded first to obtain a test operation video, then a target video frame corresponding to the cutting operation is obtained in response to the cutting operation on the test operation video, and the target video frame is used as an operation screenshot of the test operation.
It should be understood that, in general, a bug will only occur for a short time, and therefore, the embodiments of the present disclosure may cut out the interval in which the bug occurs in all the recorded operation contents. For example, referring to fig. 3, if the user finds that bug occurs in the 3 rd frame video and the 4 th frame video by viewing the recorded test operation video, the user may perform a clipping operation on the 3 rd frame video and the 2 nd frame video, and perform a clipping operation on the 4 th frame video and the 5 th frame video, so as to obtain the 3 rd frame video and the 4 th frame video as final operation screenshots.
After the text description, the operation screenshot and the log information corresponding to the test operation are obtained, the corresponding text description, the operation screenshot and the log information can be sent to a background system when a program error occurs. After receiving the corresponding text description, operation screenshot and log information, the background system can perform problem positioning by combining with multi-dimensional problem description information.
For example, the backend system may display an error description page that includes textual description, operational screenshot, and log information. For example, the error description page shown in FIG. 4 may be generated. Referring to fig. 4, the error description page displays three display areas side by side, where a first display area is used to display text descriptions corresponding to the program errors, a second display area is used to display operation screenshots corresponding to the program errors, and a third display area is used to display log information corresponding to the program errors.
Of course, the error description page may also display other information related to the program error, for example, the error description page may display information such as identification information of the application program and a test case name.
In a possible mode, the background system can also respond to the selection operation of the target text description corresponding to the target test operation in the error description page, highlight the target text description, determine a target operation screenshot corresponding to the target test operation, and highlight the target operation screenshot.
For example, referring to fig. 4, in response to a selection operation of a first textual description in the error description page, the first textual description is highlighted (fig. 4 is illustrated as being highlighted in grayscale with the first textual description displayed). Accordingly, a target operation screenshot corresponding to the first text description can be determined in the operation screenshots (fig. 4 illustrates by a page B), and the target operation screenshot is highlighted (fig. 4 illustrates by highlighting by displaying the page B as gray scale). Therefore, when the text description is checked, the corresponding operation screenshot can be synchronously checked, and problem positioning and bug repairing are facilitated.
It should be understood that, in a specific implementation of the present disclosure, highlighting the target operation screenshot may also be highlighting a page element associated with the test operation in the target operation screenshot, which is not limited in this disclosure.
Based on the same concept, the embodiment of the disclosure also provides a test method applied to a background system. Referring to fig. 5, the method includes:
step 501, receiving a text description corresponding to a test operation sent by a test terminal. The text description is sent when a program error occurs in the updating process after the testing terminal responds to the testing operation of the page to be tested, controls the page to be tested to update the page content based on the testing operation, and generates page elements related to the testing operation based on a preset operation description template in the updating process of the page content.
Step 502, error location is performed based on the text description.
In a possible mode, the background system can also receive an operation screenshot and log information corresponding to the test operation sent by the test terminal, and then display an error description page comprising the text description, the operation screenshot and the log information. Accordingly, step 502 may be: and responding to the selection operation of the target character description corresponding to the target test operation in the error description page, highlighting the target character description, determining a target operation screenshot corresponding to the target test operation, and highlighting the target operation screenshot.
It should be understood that, the related execution process of the background system may refer to the related content in the test terminal embodiment, and is not described herein again.
By the scheme, the test terminal can generate the text description corresponding to the test operation in real time based on the preset operation description template and the page element associated with the test operation in the test process, and if a program error occurs in the test process, the test terminal can send the text description to the background system. The background system can perform quick and accurate problem positioning according to the text description, and improve the efficiency of problem positioning and the efficiency of repairing program errors. Besides, the test terminal can send operation screenshots and log information besides the character description, and the background system can perform problem positioning based on the character description, the operation screenshots and the log information and in combination with the problem description information of multiple dimensions, so that the accuracy of problem positioning is improved.
Based on the same concept, the present disclosure also provides a testing device, which can be part or all of an electronic device through software, hardware or a combination of both. Referring to fig. 6, the test apparatus 600 includes:
the first display module 601 is used for displaying a page to be tested of an application program;
the control module 602 is configured to, in response to a test operation on the page to be tested, control the page to be tested to update page content based on the test operation;
a first generating module 603, configured to generate, based on a preset operation description template and a page element associated with the test operation, a text description corresponding to the test operation in an updating process of the page content;
a first sending module 604, configured to send the text description to a background system when a program error occurs in an update process of the page content, where the background system is configured to perform error location according to the text description.
Optionally, the first generating module 603 is configured to:
acquiring a corresponding target description template from preset operation description templates based on the type of the test operation, wherein each preset operation description template has identification information for representing the type of the test operation;
and generating the text description corresponding to the test operation based on the target description template and the page element associated with the test operation.
Optionally, each preset operation description template includes preset information items to be filled, where the content of each preset information item to be filled is empty, each preset information item to be filled has identification information for characterizing the content to be filled, and the first generating module 603 is configured to:
determining description information of a code element corresponding to a page element associated with the test operation in a source code of the page to be tested, wherein the description information comprises at least one of class name information, object information, selector information, unit information and view information corresponding to the code element;
and filling the description information into the information item corresponding to the operation description template based on the description information and the identification information of the information item to be filled in the operation description template to obtain the text description corresponding to the test operation.
Optionally, the apparatus 600 further comprises:
the second generation module is used for generating an operation screenshot and log information corresponding to the test operation;
and the second sending module is used for sending the operation screenshot and the log information to the background system when a program error occurs in the updating process of the page content, and the background system is used for positioning the error according to at least one of the text description, the operation screenshot and the log information.
Optionally, the second generating module is configured to:
recording the updating process of the page content to obtain a test operation video;
and responding to the cutting operation of the test operation video, acquiring a target video frame corresponding to the cutting operation, and taking the target video frame as an operation screenshot of the test operation.
Optionally, the first sending module 604 is configured to:
and responding to the submission operation of the text description, and sending the text description to a background system.
Based on the same concept, the present disclosure also provides a testing device, which can be part or all of an electronic device through software, hardware or a combination of both. Referring to fig. 7, the test apparatus 700 includes:
a first receiving module 701, configured to receive a text description corresponding to a test operation sent by a test terminal, where the text description is sent when a program error occurs in an update process after the test terminal responds to the test operation on a page to be tested, controls the page to be tested to update page content based on the test operation, and generates a page element associated with the test operation based on a preset operation description template in the update process of the page content;
a positioning module 702, configured to perform error positioning based on the text description.
Optionally, the apparatus 700 further comprises:
the second receiving module is used for receiving the operation screenshot and the log information which are sent by the test terminal and correspond to the test operation;
the second display module is used for displaying an error description page comprising the text description, the operation screenshot and the log information;
the positioning module 702 is configured to:
and responding to the selection operation of the target text description corresponding to the target test operation in the error description page, highlighting the target text description, determining a target operation screenshot corresponding to the target test operation, and highlighting the target operation screenshot.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Based on the same inventive concept, the disclosed embodiments also provide a non-transitory computer-readable storage medium, on which a computer program is stored, which when executed by a processor implements the steps of any of the above-described test methods.
Based on the same inventive concept, an embodiment of the present disclosure further provides an electronic device, including:
a memory having a computer program stored thereon;
a processor for executing the computer program in the memory to implement the steps of any of the above-described test methods.
Referring now to FIG. 8, shown is a schematic diagram of an electronic device 800 suitable for use in implementing embodiments of the present disclosure. The terminal device in the embodiments of the present disclosure may include, but is not limited to, a mobile terminal such as a mobile phone, a notebook computer, a digital broadcast receiver, a PDA (personal digital assistant), a PAD (tablet computer), a PMP (portable multimedia player), a vehicle terminal (e.g., a car navigation terminal), and the like, and a stationary terminal such as a digital TV, a desktop computer, and the like. The electronic device shown in fig. 8 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present disclosure.
As shown in fig. 8, an electronic device 800 may include a processing means (e.g., central processing unit, graphics processor, etc.) 801 that may perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)802 or a program loaded from a storage means 808 into a Random Access Memory (RAM) 803. In the RAM 803, various programs and data necessary for the operation of the electronic apparatus 800 are also stored. The processing apparatus 801, the ROM 802, and the RAM 803 are connected to each other by a bus 804. An input/output (I/O) interface 805 is also connected to bus 804.
Generally, the following devices may be connected to the I/O interface 805: input devices 806 including, for example, a touch screen, touch pad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; output devices 807 including, for example, a Liquid Crystal Display (LCD), speakers, vibrators, and the like; storage 808 including, for example, magnetic tape, hard disk, etc.; and a communication device 809. The communication means 809 may allow the electronic device 800 to communicate wirelessly or by wire with other devices to exchange data. While fig. 8 illustrates an electronic device 800 having various means, it is to be understood that not all illustrated means are required to be implemented or provided. More or fewer devices may alternatively be implemented or provided.
In particular, according to an embodiment of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program carried on a non-transitory computer readable medium, the computer program containing program code for performing the method illustrated by the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication means 809, or installed from the storage means 808, or installed from the ROM 802. The computer program, when executed by the processing apparatus 801, performs the above-described functions defined in the methods of the embodiments of the present disclosure.
It should be noted that the computer readable medium in the present disclosure can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In contrast, in the present disclosure, a computer readable signal medium may comprise a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, optical cables, RF (radio frequency), etc., or any suitable combination of the foregoing.
In some embodiments, the communication may be performed using any currently known or future developed network Protocol, such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the Internet (e.g., the Internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed network.
The computer readable medium may be embodied in the electronic device; or may exist separately without being assembled into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: displaying a page to be tested of the application program; responding to the test operation of the page to be tested, and controlling the page to be tested to update page content based on the test operation; in the updating process of the page content, generating a text description corresponding to the test operation based on a preset operation description template and the page element associated with the test operation; and if a program error occurs in the updating process of the page content, sending the text description to a background system, wherein the background system is used for carrying out error positioning according to the text description.
Alternatively, the computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: receiving a text description sent by a test terminal, wherein the text description is sent when the test terminal responds to a test operation on a page to be tested, controls the page to be tested to update page content based on the test operation, and sends the text description when a program error occurs in an updating process after a preset operation description template and a page element associated with the test operation are generated in the updating process of the page content; and performing error positioning based on the text description.
Computer program code for carrying out operations for the present disclosure may be written in any combination of one or more programming languages, including but not limited to an object oriented programming language such as Java, Smalltalk, C + +, and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The modules described in the embodiments of the present disclosure may be implemented by software or hardware. Wherein the name of a module in some cases does not constitute a limitation on the module itself.
The functions described herein above may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), systems on a chip (SOCs), Complex Programmable Logic Devices (CPLDs), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
Example 1 provides, in accordance with one or more embodiments of the present disclosure, a testing method, the method comprising:
displaying a page to be tested of the application program;
responding to the test operation of the page to be tested, and controlling the page to be tested to update page content based on the test operation;
in the updating process of the page content, generating a text description corresponding to the test operation based on a preset operation description template and the page element associated with the test operation;
and if a program error occurs in the updating process of the page content, sending the text description to a background system, wherein the background system is used for carrying out error positioning according to the text description.
According to one or more embodiments of the present disclosure, example 2 provides the method of example 1, where generating the textual description corresponding to the test operation based on a preset operation description template and a page element associated with the test operation includes:
acquiring a corresponding target description template from preset operation description templates based on the type of the test operation, wherein each preset operation description template has identification information for representing the type of the test operation;
and generating the text description corresponding to the test operation based on the target description template and the page element associated with the test operation.
According to one or more embodiments of the present disclosure, example 3 provides the method of example 1, where each preset operation description template includes a preset information item to be filled in whose content is empty, each information item to be filled in has identification information used for characterizing the content to be filled in, and the generating a text description corresponding to the test operation based on the preset operation description template and a page element associated with the test operation includes:
determining description information of a code element corresponding to a page element associated with the test operation in a source code of the page to be tested, wherein the description information comprises at least one of class name information, object information, selector information, unit information and view information corresponding to the code element;
and filling the description information into the information item corresponding to the operation description template based on the description information and the identification information of the information item to be filled in the operation description template to obtain the text description corresponding to the test operation.
Example 4 provides the method of any of examples 1-3, further comprising, in accordance with one or more embodiments of the present disclosure:
generating an operation screenshot and log information corresponding to the test operation;
and when a program error occurs in the updating process of the page content, sending the operation screenshot and the log information to the background system, wherein the background system is used for positioning the error according to at least one of the text description, the operation screenshot and the log information.
Example 5 provides the method of example 4, and the generating an operation screenshot corresponding to the test operation includes:
recording the updating process of the page content to obtain a test operation video;
and responding to the cutting operation of the test operation video, acquiring a target video frame corresponding to the cutting operation, and taking the target video frame as an operation screenshot of the test operation.
Example 6 provides the method of any of examples 1-3, wherein sending the textual description to a backend system, in accordance with one or more embodiments of the present disclosure, includes:
and responding to the submission operation of the text description, and sending the text description to a background system.
Example 7 provides, in accordance with one or more embodiments of the present disclosure, a testing method, the method comprising:
receiving a text description corresponding to a test operation sent by a test terminal, wherein the text description is sent when a program error occurs in an updating process after the test terminal responds to the test operation on a page to be tested and controls the page to be tested to update page content based on the test operation, and in the updating process of the page content, a preset operation description template and page elements related to the test operation are generated;
and performing error positioning based on the text description.
Example 8 provides the method of example 7, further comprising, in accordance with one or more embodiments of the present disclosure:
receiving an operation screenshot and log information corresponding to the test operation sent by the test terminal;
displaying an error description page comprising the text description, the operation screenshot and the log information;
the error locating based on the text description comprises:
and responding to the selection operation of the target text description corresponding to the target test operation in the error description page, highlighting the target text description, determining a target operation screenshot corresponding to the target test operation, and highlighting the target operation screenshot.
Example 9 provides, in accordance with one or more embodiments of the present disclosure, a test apparatus, the apparatus comprising:
the first display module is used for displaying a page to be tested of the application program;
the control module is used for responding to the test operation of the page to be tested and controlling the page to be tested to update page content based on the test operation;
a first generation module, configured to generate, based on a preset operation description template and a page element associated with the test operation, a text description corresponding to the test operation in an update process of the page content;
and the first sending module is used for sending the text description to a background system when a program error occurs in the updating process of the page content, and the background system is used for positioning the error according to the text description.
Example 10 provides, in accordance with one or more embodiments of the present disclosure, a test apparatus, comprising:
the first receiving module is used for receiving a text description sent by a testing terminal, wherein the text description is sent when the testing terminal responds to a testing operation on a page to be tested, controls the page to be tested to update page content based on the testing operation, and generates page elements related to the testing operation based on a preset operation description template and the page elements related to the testing operation in the updating process of the page content and then sends the generated page elements when a program error occurs in the updating process;
and the positioning module is used for carrying out error positioning based on the text description.
Example 11 provides a non-transitory computer-readable storage medium having stored thereon a computer program that, when executed by a processing device, implements the steps of the method of any of examples 1-8, in accordance with one or more embodiments of the present disclosure.
Example 12 provides, in accordance with one or more embodiments of the present disclosure, an electronic device, comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to carry out the steps of the method of any of examples 1-8.
The foregoing description is only exemplary of the preferred embodiments of the disclosure and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the disclosure herein is not limited to the particular combination of features described above, but also encompasses other embodiments in which any combination of the features described above or their equivalents does not depart from the spirit of the disclosure. For example, the above features and (but not limited to) the features disclosed in this disclosure having similar functions are replaced with each other to form the technical solution.
Further, while operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limitations on the scope of the disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms of implementing the claims. With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.

Claims (12)

1. A method of testing, the method comprising:
displaying a page to be tested of the application program;
responding to the test operation of the page to be tested, and controlling the page to be tested to update page content based on the test operation;
in the updating process of the page content, generating a text description corresponding to the test operation based on a preset operation description template and the page element associated with the test operation;
and if a program error occurs in the updating process of the page content, sending the text description to a background system, wherein the background system is used for carrying out error positioning according to the text description.
2. The method according to claim 1, wherein the generating of the text description corresponding to the test operation based on the preset operation description template and the page element associated with the test operation comprises:
acquiring a corresponding target description template from preset operation description templates based on the type of the test operation, wherein each preset operation description template has identification information for representing the type of the test operation;
and generating the text description corresponding to the test operation based on the target description template and the page element associated with the test operation.
3. The method according to claim 1, wherein each preset operation description template includes a preset information item to be filled, whose content is empty, and each information item to be filled has identification information for characterizing the content to be filled, and the generating of the text description corresponding to the test operation based on the preset operation description template and the page element associated with the test operation includes:
determining description information of a code element corresponding to a page element associated with the test operation in a source code of the page to be tested, wherein the description information comprises at least one of class name information, object information, selector information, unit information and view information corresponding to the code element;
and filling the description information into the information item corresponding to the operation description template based on the description information and the identification information of the information item to be filled in the operation description template to obtain the text description corresponding to the test operation.
4. The method according to any one of claims 1-3, further comprising:
generating an operation screenshot and log information corresponding to the test operation;
and when a program error occurs in the updating process of the page content, sending the operation screenshot and the log information to the background system, wherein the background system is used for positioning the error according to at least one of the text description, the operation screenshot and the log information.
5. The method of claim 4, wherein the generating the operation screenshot corresponding to the test operation comprises:
recording the updating process of the page content to obtain a test operation video;
and responding to the cutting operation of the test operation video, acquiring a target video frame corresponding to the cutting operation, and taking the target video frame as an operation screenshot of the test operation.
6. The method of any of claims 1-3, wherein sending the textual description to a backend system comprises:
and responding to the submission operation of the text description, and sending the text description to a background system.
7. A method of testing, the method comprising:
receiving a text description corresponding to a test operation sent by a test terminal, wherein the text description is sent when a program error occurs in an updating process after the test terminal responds to the test operation on a page to be tested and controls the page to be tested to update page content based on the test operation, and in the updating process of the page content, a preset operation description template and page elements related to the test operation are generated;
and performing error positioning based on the text description.
8. The method of claim 7, further comprising:
receiving an operation screenshot and log information corresponding to the test operation sent by the test terminal;
displaying an error description page comprising the text description, the operation screenshot and the log information;
the error locating based on the text description comprises:
and responding to the selection operation of the target text description corresponding to the target test operation in the error description page, highlighting the target text description, determining a target operation screenshot corresponding to the target test operation, and highlighting the target operation screenshot.
9. A test apparatus, the apparatus comprising:
the first display module is used for displaying a page to be tested of the application program;
the control module is used for responding to the test operation of the page to be tested and controlling the page to be tested to update page content based on the test operation;
a first generation module, configured to generate, based on a preset operation description template and a page element associated with the test operation, a text description corresponding to the test operation in an update process of the page content;
and the first sending module is used for sending the text description to a background system when a program error occurs in the updating process of the page content, and the background system is used for positioning the error according to the text description.
10. A test apparatus, the apparatus comprising:
the first receiving module is used for receiving a text description corresponding to a test operation sent by a test terminal, wherein the text description is sent when a program error occurs in an updating process after the test terminal responds to the test operation on a page to be tested, controls the page to be tested to update page content based on the test operation, and generates a preset operation description template and page elements associated with the test operation in the updating process of the page content;
and the positioning module is used for carrying out error positioning based on the text description.
11. A non-transitory computer readable storage medium, having stored thereon a computer program, characterized in that the program, when executed by a processing device, implements the steps of the method of any one of claims 1-8.
12. An electronic device, comprising:
a storage device having a computer program stored thereon;
processing means for executing the computer program in the storage means to carry out the steps of the method according to any one of claims 1 to 8.
CN202111275484.7A 2021-10-29 2021-10-29 Test method, test device, storage medium and electronic equipment Pending CN113849416A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111275484.7A CN113849416A (en) 2021-10-29 2021-10-29 Test method, test device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111275484.7A CN113849416A (en) 2021-10-29 2021-10-29 Test method, test device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN113849416A true CN113849416A (en) 2021-12-28

Family

ID=78983668

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111275484.7A Pending CN113849416A (en) 2021-10-29 2021-10-29 Test method, test device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN113849416A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116610557A (en) * 2023-04-10 2023-08-18 前海飞算云智软件科技(深圳)有限公司 Action binding information debugging method and device, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180365023A1 (en) * 2017-06-15 2018-12-20 Macpaw Inc. Teaser of an application available for installation
CN112597040A (en) * 2020-12-28 2021-04-02 中国农业银行股份有限公司 Interface automatic testing method and device and electronic equipment
CN112860587A (en) * 2021-04-02 2021-05-28 中国工商银行股份有限公司 UI automatic test method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20180365023A1 (en) * 2017-06-15 2018-12-20 Macpaw Inc. Teaser of an application available for installation
CN112597040A (en) * 2020-12-28 2021-04-02 中国农业银行股份有限公司 Interface automatic testing method and device and electronic equipment
CN112860587A (en) * 2021-04-02 2021-05-28 中国工商银行股份有限公司 UI automatic test method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116610557A (en) * 2023-04-10 2023-08-18 前海飞算云智软件科技(深圳)有限公司 Action binding information debugging method and device, storage medium and electronic equipment
CN116610557B (en) * 2023-04-10 2024-02-09 前海飞算云智软件科技(深圳)有限公司 Action binding information debugging method and device, storage medium and electronic equipment

Similar Documents

Publication Publication Date Title
CN112597047A (en) Test method, test device, electronic equipment and computer readable medium
CN111190520A (en) Menu item selection method and device, readable medium and electronic equipment
CN112395188B (en) Test-oriented software project development method and device, electronic equipment and storage medium
CN112596738B (en) Method and device for determining front-end page to be tested, storage medium and electronic equipment
CN113806212A (en) Application program exception positioning method and device and electronic equipment
CN114428925A (en) Page rendering method and device, electronic equipment and computer readable medium
CN114417782A (en) Display method and device and electronic equipment
CN113849416A (en) Test method, test device, storage medium and electronic equipment
CN110489326B (en) IDS-based HTTPAPI debugging method device, medium and equipment
CN109408387B (en) Page testing method and device
CN111930629A (en) Page testing method and device, electronic equipment and storage medium
CN116662193A (en) Page testing method and device
CN114510305B (en) Model training method and device, storage medium and electronic equipment
CN110689285A (en) Test method, test device, electronic equipment and computer readable storage medium
CN112669816B (en) Model training method, voice recognition method, device, medium and equipment
CN114116480A (en) Method, device, medium and equipment for determining application program test coverage rate
CN110084298B (en) Method and device for detecting image similarity
CN112306858A (en) Test method and device and electronic equipment
CN112346630B (en) State determination method, device, equipment and computer readable medium
CN116561015B (en) Map application testing method, electronic device and computer readable medium
CN115860573B (en) Highway engineering detection method based on detection item, electronic equipment and readable medium
CN112328341B (en) Model display method, device, electronic equipment and storage medium
US20230360105A1 (en) Information Recommendation Method and Device
CN117667710A (en) Determination method, test method, device, medium and equipment for page test case
CN116303050A (en) Test method and device

Legal Events

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