CN114328242B - Form testing method and device, electronic equipment and medium - Google Patents

Form testing method and device, electronic equipment and medium Download PDF

Info

Publication number
CN114328242B
CN114328242B CN202111652803.1A CN202111652803A CN114328242B CN 114328242 B CN114328242 B CN 114328242B CN 202111652803 A CN202111652803 A CN 202111652803A CN 114328242 B CN114328242 B CN 114328242B
Authority
CN
China
Prior art keywords
input text
text box
test
input
category
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.)
Active
Application number
CN202111652803.1A
Other languages
Chinese (zh)
Other versions
CN114328242A (en
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 Baidu Netcom Science and Technology Co Ltd
Original Assignee
Beijing Baidu Netcom Science and 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 Baidu Netcom Science and Technology Co Ltd filed Critical Beijing Baidu Netcom Science and Technology Co Ltd
Priority to CN202111652803.1A priority Critical patent/CN114328242B/en
Publication of CN114328242A publication Critical patent/CN114328242A/en
Application granted granted Critical
Publication of CN114328242B publication Critical patent/CN114328242B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The disclosure provides a form testing method, relates to the technical field of computers, and particularly relates to the technical field of page configuration. The implementation scheme is as follows: acquiring reference data generated based on a plurality of reference forms, wherein each reference form comprises a corresponding first input text box; acquiring a form to be tested, wherein the form to be tested comprises a second input text box; determining a category corresponding to the second input text box, and acquiring a first input text box with the same category as the second input text box, and test input and test output corresponding to the first input text from the reference data; filling the obtained test input into a second input text box, and extracting test output of the second input text box; comparing the test output of the second input text box with the test output corresponding to the first input text box obtained from the reference data; and determining whether the form to be tested passes the test or not based on the comparison result.

Description

Form testing method and device, electronic equipment and medium
Technical Field
The present disclosure relates to the field of computer technology, and in particular, to the field of page configuration technology, and in particular, to a method and apparatus for testing a form, an electronic device, a computer readable storage medium, and a computer program product.
Background
Form pages are primarily responsible for the collection of data in web pages or applications to gather different types of user input. In order to improve the effectiveness of acquiring information and improve the coordination of users, it becomes very important to ensure the correctness of the form page capability.
The approaches described in this section are not necessarily approaches that have been previously conceived or pursued. Unless otherwise indicated, it should not be assumed that any of the approaches described in this section qualify as prior art merely by virtue of their inclusion in this section. Similarly, the problems mentioned in this section should not be considered as having been recognized in any prior art unless otherwise indicated.
Disclosure of Invention
The present disclosure provides a form testing method, apparatus, electronic device, computer readable storage medium, and computer program product.
According to an aspect of the present disclosure, there is provided a method for testing a form, including: obtaining reference data generated based on a plurality of reference forms, wherein each of the plurality of reference forms contains a respective first input text box, and wherein the reference data comprises test data corresponding to each of the plurality of reference forms, the test data comprising a category of the first input text box contained in the corresponding reference form, a test input to the first input text box, and a test output; acquiring a form to be tested, wherein the form to be tested comprises a second input text box; determining a category corresponding to the second input text box, and acquiring a first input text box with the same category as the second input text box, and test input and test output corresponding to the first input text from the reference data; filling test input obtained from the reference data into the second input text box, and extracting test output of the second input text box; comparing the test output of the second input text box with the test output corresponding to the first input text box obtained from the reference data; and determining whether the form to be tested passes the test or not based on the comparison result.
According to another aspect of the present disclosure, there is provided a test device for a form, including: a first acquisition module configured to acquire reference data generated based on a plurality of reference forms, wherein each of the plurality of reference forms contains a respective first input text box, and wherein the reference data includes test data corresponding to each of the plurality of reference forms, the test data including a category of the first input text box contained in the corresponding reference form, a test input to the first input text box, and a test output; the second acquisition module is configured to acquire a form to be tested, wherein the form to be tested comprises a second input text box; the first determining module is configured to determine a category corresponding to the second input text box, and acquire a first input text box with the same category as the second input text box, and a test input and a test output corresponding to the first input text from the reference data; an extraction module configured to fill in the test input obtained from the reference data into the second input text box and extract a test output of the second input text box; the comparison module is configured to compare the test output of the second input text box with the test output corresponding to the first input text box obtained from the reference data; and a second determining module configured to determine whether the form to be tested passes the test based on the comparison result.
According to another aspect of the present disclosure, there is provided an electronic device including: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform a method of testing a form.
According to another aspect of the present disclosure, there is provided a non-transitory computer-readable storage medium storing computer instructions for causing the computer to execute a test method of a form.
According to another aspect of the present disclosure, a computer program product is provided, comprising a computer program, wherein the computer program when executed by a processor implements a method of testing a form.
According to one or more embodiments of the present disclosure, a method for automatically testing a form is provided, in which test data of input text boxes of the same category are obtained from reference data, the input text boxes in the form to be tested are tested, and test outputs are compared, so that correctness of the form to be tested is verified. In the test process, the acquisition of the reference data and the comparison of the test output and the test output of the form to be tested can be completed by an automatic test tool without participation of testers, so that the test efficiency can be effectively improved, and the labor cost is reduced.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the disclosure, nor is it intended to be used to limit the scope of the disclosure. Other features of the present disclosure will become apparent from the following specification.
Drawings
The accompanying drawings illustrate exemplary embodiments and, together with the description, serve to explain exemplary implementations of the embodiments. The illustrated embodiments are for exemplary purposes only and do not limit the scope of the claims. Throughout the drawings, identical reference numerals designate similar, but not necessarily identical, elements.
FIG. 1 illustrates a flow chart of a method of testing a form according to an embodiment of the present disclosure;
FIG. 2 illustrates a flow chart of a method of acquiring reference data according to an embodiment of the present disclosure;
FIG. 3 illustrates a flow chart of a method of parsing a reference form according to an embodiment of the present disclosure;
FIG. 4 illustrates a flowchart of a method of determining a category of a first input text box according to an embodiment of the present disclosure;
FIG. 5 shows a block diagram of a testing device for a form according to an embodiment of the present disclosure;
FIG. 6 shows a block diagram of a first acquisition module according to an embodiment of the disclosure;
Fig. 7 shows a block diagram of a first determination unit according to an embodiment of the present disclosure;
fig. 8 shows a block diagram of a fourth determination unit according to an embodiment of the present disclosure; and
fig. 9 illustrates a block diagram of an exemplary electronic device that can be used to implement embodiments of the present disclosure.
Detailed Description
Exemplary embodiments of the present disclosure are described below in conjunction with the accompanying drawings, which include various details of the embodiments of the present disclosure to facilitate understanding, and should be considered as merely exemplary. Accordingly, one of ordinary skill in the art will recognize that various changes and modifications of the embodiments described herein can be made without departing from the scope of the present disclosure. Also, descriptions of well-known functions and constructions are omitted in the following description for clarity and conciseness.
In the present disclosure, the use of the terms "first," "second," and the like to describe various elements is not intended to limit the positional relationship, timing relationship, or importance relationship of the elements, unless otherwise indicated, and such terms are merely used to distinguish one element from another element. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, they may also refer to different instances based on the description of the context.
The terminology used in the description of the various illustrated examples in this disclosure is for the purpose of describing particular examples only and is not intended to be limiting. Unless the context clearly indicates otherwise, the elements may be one or more if the number of the elements is not specifically limited. Furthermore, the term "and/or" as used in this disclosure encompasses any and all possible combinations of the listed items.
In the related art, a manual testing method can be adopted to test the content of each text box in the form, and whether the form has a problem or not is judged through page prompt, however, the method has a great deal of requirements on manpower, and the testing efficiency is low. The form can also be tested by writing an automatic use case by means of an automatic test tool, however, the method has certain test experience requirements for testers, and the test threshold is higher.
In order to solve the problems, the method and the device take the test data of the verified correct reference form as the reference data, test the input text boxes in the form to be tested by acquiring the test data of the input text boxes of the same category from the reference data, and compare the test output so as to verify the correctness of the form to be tested. In the test process, the acquisition of the reference data and the comparison of the test output and the test output of the form to be tested can be completed by an automatic test tool without participation of testers, so that the automatic test of the form to be tested is realized, the test efficiency can be effectively improved, and the labor cost is reduced.
Embodiments of the present disclosure will be described in detail below with reference to the accompanying drawings.
FIG. 1 illustrates a flow chart of a method of testing a form according to an embodiment of the present disclosure. As shown in fig. 1, the form testing method 100 includes: step S101, obtaining reference data generated based on a plurality of reference forms, wherein each reference form in the plurality of reference forms comprises a corresponding first input text box, and wherein the reference data comprises test data corresponding to each reference form in the plurality of reference forms, and the test data comprises a category of the first input text box contained in the corresponding reference form, test input and test output of the first input text box; step S102, a form to be tested is obtained, wherein the form to be tested comprises a second input text box; step S103, determining the category corresponding to the second input text box, and acquiring a first input text box with the same category as the second input text box, and test input and test output corresponding to the first input text from the reference data; step S104, filling the test input obtained from the reference data into the second input text box, and extracting the test output of the second input text box; step 105, comparing the test output of the second input text box with the test output corresponding to the first input text box obtained from the reference data; and step S106, determining whether the form to be tested passes the test or not based on the comparison result.
Test data of a plurality of verified correct reference forms are used as reference data, wherein the plurality of reference forms can contain input text boxes of different categories. The method comprises the steps of determining the types of input text boxes in a form to be tested, acquiring test data of the input text boxes with the same types from reference data, testing the input text boxes in the form to be tested by acquiring test input, and comparing test output so as to verify the correctness of the form to be tested.
For example, when it is determined that the form to be tested includes an input text box for collecting names, test data corresponding to the input text box for collecting names in the same category is required to be obtained from the reference data. When the acquired test input is 'o-button o-ring whetstone and the test output is' only supporting hanzi letters and 2-8 characters ', filling the test input of' o-button o-ring whetstone into an input text box for collecting names in a to-be-tested form, and extracting the test output of the input text box to compare with the content of the test output of 'only supporting hanzi letters and 2-8 characters'. When the two are in agreement, this input text box representing the form to be tested may give the expected error indication for the user's input, i.e. pass the test described above.
In the test method, the acquisition of the reference data and the comparison of the test output and the test of the form to be tested can be completed by an automatic test tool without the participation of a tester, so that the automatic test of the form to be tested is realized, the test efficiency can be effectively improved, and the labor cost is reduced.
According to some embodiments, the reference data may be derived based on data mining and analysis of verified correct reference forms for automated testing of a variety of different types of forms.
A description will be given below of a specific manner of acquiring the reference data.
Fig. 2 shows a flowchart of a method of acquiring reference data according to an embodiment of the present disclosure. As shown in fig. 2, the method for acquiring the reference data includes: step S201, analyzing each reference form in the plurality of reference forms to determine the category of the first input text box contained in the reference form; step S202, filling test input into the first input text box, and extracting test output of the first input text box; step S203, storing the category of the first input text box, the test input and the test output of the first input text box to obtain the test data corresponding to the reference form; and step S204, determining the reference data based on the test data corresponding to each reference form in the plurality of reference forms.
Therefore, a large number of reference forms can be analyzed and tested to obtain input text boxes of different categories and corresponding test data serving as reference data for testing new forms. The analysis and the test of the reference form can be completed by means of an automatic test tool, so that the acquisition of the reference data can obtain a large amount of data for reference without the participation of a tester.
According to some embodiments, the extraction of the test output may be implemented based on the processing of the image. For example, after the test input is filled in the first input text box, when the test input is an unsatisfactory text or illegal character, the error prompt of the red text appears in the first input text box area, the red content area can be intercepted to obtain a text box picture, and text information in the picture is analyzed. Specifically, the text box picture can be transferred from the RGB space to the HSV color space, the HSV color dictionary is queried to only reserve the red content in the HSV picture, then the operation of pixel-by-pixel is performed with the original text box picture to obtain an RGB image only reserved in the red area, and the content of characters is obtained through OCR capability to extract and obtain test output.
According to some embodiments, the test input for testing the first input text box is generated based on a random function. In particular, the test input may comprise one or more of the following: the method comprises the steps of randomly generating a number function of random digits, randomly generating a Chinese character function of random digits, randomly generating an English letter function of random digits, randomly generating a name function, randomly generating a telephone function, randomly generating a mail function, randomly generating an identity card function and the like, and adopting the random function or the combination of a plurality of random functions can ensure the diversity of generated contents and improve the coverage rate of error prompt of form pages.
According to some embodiments, the generated test inputs may be filled into the input text box by means of an automated test tool to enable automated testing of the reference form.
Fig. 3 illustrates a flow chart of a method of parsing a reference form according to an embodiment of the present disclosure. As shown in fig. 3, the method for parsing the reference form includes: step 301, performing image processing on each reference form in the plurality of reference forms to obtain an analysis chart corresponding to the reference form, wherein the analysis chart comprises a plurality of rectangular frames; step S302, determining a first input text box contained in the reference form based on at least one of the length of each rectangular box in the plurality of rectangular boxes, text information in the rectangular box and pixel information in the rectangular box; and step S303, acquiring a title corresponding to the first input text box to determine the category of the first input text box.
According to some embodiments, in step S301, the image processing for each reference form may include: preprocessing operations such as clipping and picture graying are carried out on the image containing the reference form so as to remove redundant information; and scanning pixel values of the gray level image obtained through the gray level processing in the horizontal and vertical directions to identify a background area and a foreground area in the gray level image, and acquiring an analysis chart corresponding to the reference form and a plurality of rectangular frames contained in the analysis chart and used as text frames for subsequent identification of the input text frames.
It is understood that the plurality of rectangular boxes included in the resolution chart are different types of text boxes, such as an input text box, a drop-down text box, a single-choice text box, a date text box, and the like, and the input text boxes in the different types of text boxes can be determined for the test of the input text boxes in the subsequent flow according to the preset conditions of step S302 based on at least one of the length of the rectangular boxes, the text information in the rectangular boxes, and the pixel information in the rectangular boxes.
Fig. 4 illustrates a flowchart of a method of determining a category of a first input text box according to an embodiment of the present disclosure. As shown in fig. 4, the method for determining the category of the first input text box includes: step S401, identifying characters above a first input text box aiming at the first input text box contained in each reference form in the plurality of reference forms so as to acquire a title corresponding to the first input text box; step S402, acquiring a semantic vector of the title; and step S403, determining the category of the first input text box based on the semantic vector.
It will be appreciated that determining the category of the first input text box is achieved by the titles of the text boxes, the text boxes of the same category may have different titles, for example, for name boxes, some input text boxes may correspond to the title "name", may correspond to the title "nickname", and may correspond to the "title", which, although different, are all representative input text boxes of the same type. Therefore, the category of the first input text box is determined by converting the title into a semantic vector through a depth model word2vec, and then realizing text classification through machine learning algorithm logistic regression.
According to another aspect of the present disclosure, a form testing apparatus is provided. As shown in fig. 5, the form test apparatus 500 includes: a first obtaining module 501 configured to obtain reference data generated based on a plurality of reference forms, wherein each of the plurality of reference forms contains a respective first input text box, and wherein the reference data includes test data corresponding to each of the plurality of reference forms, the test data including a category of the first input text box contained in the corresponding reference form, a test input to the first input text box, and a test output; a second obtaining module 502 configured to obtain a form to be tested, where the form to be tested includes a second input text box; a first determining module 503, configured to determine a category corresponding to the second input text box, and obtain a first input text box with the same category as the second input text box and a test input and a test output corresponding to the first input text from the reference data; an extraction module 504 configured to populate the second input text box with test inputs obtained from the reference data and extract test outputs of the second input text box; a comparison module 505 configured to compare the test output of the second input text box with the test output corresponding to the first input text box obtained from the reference data; and a second determining module 506 configured to determine, based on the comparison result, whether the form to be tested passes the test.
The operation of the modules 501-506 of the form testing apparatus 500 is similar to the operation of steps S101-S106 described above and will not be described in detail herein.
The first acquisition module 501 takes as reference data test data for a plurality of verified correct reference forms, where the plurality of reference forms may contain different categories of input text boxes. The first determining module 503 determines the category of the input text box in the form to be tested, and obtains the test data of the input text box in the same category from the reference data, so as to obtain test input, the extracting module 504 tests the input text box in the form to be tested, the comparing module 505 compares the test output, and the second determining module 506 verifies the correctness of the form to be tested.
For example, when the first determining module 503 determines that the form to be tested includes an input text box for collecting a name, test data corresponding to the input text box for collecting a name in the same category needs to be obtained from the reference data. When the obtained test input is "o-hook-up and the test output is" support only hanzi letters, 2-8 characters ", the extraction module 504 fills the test input of" o-hook-up and o-hook-up "into the input text box for collecting the name in the form to be tested, and extracts the test output of the input text box, so that the content of the test output of" support only hanzi letters, 2-8 characters "is compared by the comparison module 505. When the two are in agreement, this input text box representing the form to be tested may give the expected error indication for the user's input, i.e. pass the test described above.
The first acquisition module 501 can be used for acquiring the reference data and the comparison module 505 can be used for completing the test of the form to be tested and the comparison of the test output by an automatic test tool without participation of testers, so that the automatic test of the form to be tested is realized, the test efficiency can be effectively improved, and the labor cost is reduced.
According to some embodiments, the first acquisition module 501 may derive reference data for automated testing of a plurality of different types of forms based on data mining and analysis of verified correct reference forms.
Fig. 6 shows a block diagram of a first acquisition module according to an embodiment of the disclosure. As shown in fig. 6, the first acquisition module 501 includes: a first determining unit 601 configured to parse, for each of the plurality of reference forms, the reference form to determine a category of a first input text box included in the reference form; an extraction unit 602 configured to fill a test input into the first input text box and extract a test output of the first input text box; a storage unit 603 configured to store a category of the first input text box, a test input of the first input text box, and a test output to obtain test data corresponding to the reference form; and a second determining unit 604 configured to determine the reference data based on the test data corresponding to each of the plurality of reference forms.
Therefore, a large number of reference forms can be analyzed and tested by the first determining unit 601 to obtain input text boxes of different categories and corresponding test data as reference data for testing new forms. The analysis and the test of the reference form can be completed by means of an automatic test tool, so that the acquisition of the reference data can obtain a large amount of data for reference without the participation of a tester.
According to some embodiments, the extraction of the test output by the extraction unit 602 may be implemented based on the processing of the image. For example, after the test input is filled in the first input text box, when the test input is an unsatisfactory text or illegal character, the error prompt of the red text appears in the first input text box area, the red content area can be intercepted to obtain a text box picture, and text information in the picture is analyzed. Specifically, the text box picture can be transferred from the RGB space to the HSV color space, the HSV color dictionary is queried to only reserve the red content in the HSV picture, then the operation of pixel-by-pixel is performed with the original text box picture to obtain an RGB image only reserved in the red area, and the content of characters is obtained through OCR capability to extract and obtain test output.
According to some embodiments, the test input for testing the first input text box is generated based on a random function. In particular, the test input may comprise one or more of the following: the method comprises the steps of randomly generating a number function of random digits, randomly generating a Chinese character function of random digits, randomly generating an English letter function of random digits, randomly generating a name function, randomly generating a telephone function, randomly generating a mail function, randomly generating an identity card function and the like, and adopting the random function or the combination of a plurality of random functions can ensure the diversity of generated contents and improve the coverage rate of error prompt of form pages.
According to some embodiments, the extraction unit 602 may populate the generated test input into the input text box with an automated test tool to enable automated testing of the reference form.
Fig. 7 shows a block diagram of the first determination unit according to an embodiment of the present disclosure. As shown in fig. 7, the first determination unit 601 includes: a first obtaining unit 701, configured to perform image processing on each of the plurality of reference forms to obtain an resolution chart corresponding to the reference form, where the resolution chart includes a plurality of rectangular frames; a third determining unit 702 configured to determine a first input text box included in the reference form based on at least one of a length of each of the plurality of rectangular boxes, text information in the rectangular box, and pixel information in the rectangular box; and a fourth determining unit 703 configured to acquire a title corresponding to the first input text box to determine a category of the first input text box.
According to some embodiments, the image processing of each reference form by the first acquisition unit 701 may include: preprocessing operations such as clipping and picture graying are carried out on the image containing the reference form so as to remove redundant information; and scanning pixel values of the gray level image obtained through the gray level processing in the horizontal and vertical directions to identify a background area and a foreground area in the gray level image, and acquiring an analysis chart corresponding to the reference form and a plurality of rectangular frames contained in the analysis chart and used as text frames for subsequent identification of the input text frames.
It is understood that the plurality of rectangular boxes included in the resolution chart are different types of text boxes, such as an input text box, a drop-down text box, a single-choice text box, a date text box, and the like, and the input text boxes in the different types of text boxes may be determined by the third determination unit 702 based on preset conditions such as at least one of the length of the rectangular box, text information in the rectangular box, and pixel information in the rectangular box, for the test of the input text boxes in the subsequent flow.
Fig. 8 shows a block diagram of a fourth determination unit according to an embodiment of the present disclosure. As shown in fig. 8, the fourth determination unit 703 includes: a second obtaining unit 801, configured to identify, for a first input text box included in each of the plurality of reference forms, a text above the first input text box, so as to obtain a title corresponding to the first input text box; a third obtaining unit 802 configured to obtain a semantic vector of the title; and a fifth determining unit 803 configured to determine a category of the first input text box based on the semantic vector.
It will be appreciated that the fifth determining unit 803 determines that the category of the first input text box is achieved by recognition of the titles of the text boxes, the text boxes of the same category may have different titles, for example, for name boxes, some input text boxes may be entitled "name", may be entitled "nickname", and may be entitled "title", and these titles, although different, are all representative input text boxes of the same type. Therefore, the category of the first input text box is determined by first converting the title into a semantic vector by the third obtaining unit 802 through the depth model word2vec and then implementing text classification by the fifth determining unit 803 through the machine learning algorithm logistic regression.
According to embodiments of the present disclosure, there is also provided an electronic device, a readable storage medium and a computer program product.
Referring to fig. 9, a block diagram of an electronic device 900 that may be a server or a client of the present disclosure, which is an example of a hardware device that may be applied to aspects of the present disclosure, will now be described. Electronic devices are intended to represent various forms of digital electronic computer devices, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 9, the electronic device 900 includes a computing unit 901 that can perform various appropriate actions and processes according to a computer program stored in a Read Only Memory (ROM) 902 or a computer program loaded from a storage unit 908 into a Random Access Memory (RAM) 903. In the RAM903, various programs and data required for the operation of the electronic device 900 can also be stored. The computing unit 901, the ROM 902, and the RAM903 are connected to each other by a bus 904. An input/output (I/O) interface 905 is also connected to the bus 904.
A number of components in the electronic device 900 are connected to the I/O interface 905, including: an input unit 906, an output unit 907, a storage unit 908, and a communication unit 909. The input unit 906 may be any type of device capable of inputting information to the electronic device 900, the input unit 906 may receive input numeric or character information and generate key signal inputs related to user settings and/or function control of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a trackpad, a trackball, a joystick, a microphone, and/or a remote control. The output unit 907 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, video/audio output terminals, vibrators, and/or printers. Storage unit 908 may include, but is not limited to, magnetic disks, optical disks. The communication unit 909 allows the electronic device 900 to exchange information/data with other devices through a computer network such as the internet and/or various telecommunications networks, and may include, but is not limited to, modems, network cards, infrared communication devices, wireless communication transceivers and/or chipsets, such as bluetooth TM Devices, 802.11 devices, wiFi devices, wiMax devices, cellular communication devices, and/or the like.
The computing unit 901 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of computing unit 901 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 901 performs the respective methods and processes described above, for example, a method of page layout. For example, in some embodiments, the method of page layout may be implemented as a computer software program tangibly embodied on a machine-readable medium, such as storage unit 908. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 900 via the ROM 902 and/or the communication unit 909. When the computer program is loaded into RAM 903 and executed by the computing unit 901, one or more steps of the method of page layout described above may be performed. Alternatively, in other embodiments, the computing unit 901 may be configured to perform the method of page layout in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), complex Programmable Logic Devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for carrying out methods of the present disclosure may be written in any combination of one or more programming languages. These program code may be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus such that the program code, when executed by the processor or controller, causes the functions/operations specified in the flowchart and/or block diagram to be implemented. The program code may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
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. The 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.
To provide for interaction with a user, the systems and techniques described here can be implemented on a computer having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and pointing device (e.g., a mouse or trackball) by which a user can provide input to the computer. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), and the internet.
The computer system may include a client and a server. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server may be a cloud server, a server of a distributed system, or a server incorporating a blockchain.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps recited in the present disclosure may be performed in parallel, sequentially or in a different order, provided that the desired results of the disclosed aspects are achieved, and are not limited herein.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the foregoing methods, systems, and apparatus are merely exemplary embodiments or examples, and that the scope of the present invention is not limited by these embodiments or examples but only by the claims following the grant and their equivalents. Various elements of the embodiments or examples may be omitted or replaced with equivalent elements thereof. Furthermore, the steps may be performed in a different order than described in the present disclosure. Further, various elements of the embodiments or examples may be combined in various ways. It is important that as technology evolves, many of the elements described herein may be replaced by equivalent elements that appear after the disclosure.

Claims (13)

1. A method of testing a form, comprising:
obtaining reference data generated based on a plurality of reference forms, wherein each of the plurality of reference forms contains a respective first input text box, and wherein the reference data comprises test data corresponding to each of the plurality of reference forms, the test data comprising a category of the first input text box contained in the corresponding reference form, a test input to the first input text box, and a test output;
Acquiring a form to be tested, wherein the form to be tested comprises a second input text box;
determining a category corresponding to the second input text box, and acquiring a first input text box with the same category as the second input text box, and test input and test output corresponding to the first input text from the reference data;
filling test input obtained from the reference data into the second input text box, and extracting test output of the second input text box;
comparing the test output of the second input text box with the test output corresponding to the first input text box obtained from the reference data; and
and determining whether the form to be tested passes the test or not based on the comparison result.
2. The method of claim 1, wherein the reference data is obtained by:
for each of the plurality of reference forms,
analyzing the reference form to determine the category of the first input text box contained in the reference form;
filling a test input into the first input text box, and extracting a test output of the first input text box;
Storing the category of the first input text box, the test input and the test output of the first input text box to obtain test data corresponding to the reference form; and
and determining the reference data based on the test data corresponding to each reference form in the plurality of reference forms.
3. The method of claim 2, wherein parsing each of the plurality of reference forms to determine a category of a first input text box contained in the reference form comprises:
for each of the plurality of reference forms,
image processing is carried out on the reference form so as to obtain an analytic graph corresponding to the reference form, wherein the analytic graph comprises a plurality of rectangular frames;
determining a first input text box contained in the reference form based on at least one of a length of each of the plurality of rectangular boxes, text information in the rectangular box, and pixel information in the rectangular box; and
and acquiring a title corresponding to the first input text box to determine the category of the first input text box.
4. The method of claim 3, wherein, for a first input text box contained in each of the plurality of reference forms, obtaining a title corresponding to the first input text box to determine a category of the first input text box comprises:
For a first input text box contained in each of the plurality of reference forms,
identifying the characters above the first input text box to obtain a title corresponding to the first input text box;
acquiring a semantic vector of the title; and
based on the semantic vector, a category of the first input text box is determined.
5. The method of any of claims 1-4, wherein the test input to test the first input text box is generated based on a random function.
6. A form testing apparatus comprising:
a first acquisition module configured to acquire reference data generated based on a plurality of reference forms, wherein each of the plurality of reference forms contains a respective first input text box, and wherein the reference data includes test data corresponding to each of the plurality of reference forms, the test data including a category of the first input text box contained in the corresponding reference form, a test input to the first input text box, and a test output;
the second acquisition module is configured to acquire a form to be tested, wherein the form to be tested comprises a second input text box;
The first determining module is configured to determine a category corresponding to the second input text box, and acquire a first input text box with the same category as the second input text box, and a test input and a test output corresponding to the first input text from the reference data;
an extraction module configured to fill in the test input obtained from the reference data into the second input text box and extract a test output of the second input text box;
the comparison module is configured to compare the test output of the second input text box with the test output corresponding to the first input text box obtained from the reference data; and
and the second determining module is configured to determine whether the form to be tested passes the test or not based on the comparison result.
7. The apparatus of claim 6, wherein the first acquisition module comprises:
a first determining unit configured to parse, for each of the plurality of reference forms, the reference form to determine a category of a first input text box contained in the reference form;
an extraction unit configured to fill a test input into the first input text box and extract a test output of the first input text box;
The storage unit is configured to store the category of the first input text box, the test input of the first input text box and the test output so as to obtain test data corresponding to the reference form; and
and a second determining unit configured to determine the reference data based on the test data corresponding to each of the plurality of reference forms.
8. The apparatus of claim 7, wherein the first determining unit comprises:
the first acquisition unit is configured to perform image processing on each reference form in the plurality of reference forms to acquire an analysis chart corresponding to the reference form, wherein the analysis chart comprises a plurality of rectangular frames;
a third determination unit configured to determine a first input text box included in the reference form based on at least one of a length of each of the plurality of rectangular boxes, text information in the rectangular box, and pixel information in the rectangular box; and
and a fourth determining unit configured to acquire a title corresponding to the first input text box to determine a category of the first input text box.
9. The apparatus of claim 8, wherein the fourth determination unit comprises:
the second acquisition unit is configured to identify characters above a first input text box for the first input text box contained in each reference form in the plurality of reference forms so as to acquire a title corresponding to the first input text box;
a third acquisition unit configured to acquire a semantic vector of the title; and
and a fifth determining unit configured to determine a category of the first input text box based on the semantic vector.
10. The apparatus of any of claims 6-9, wherein the test input to test the first input text box is generated based on a random function.
11. An electronic device, comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein the method comprises the steps of
The memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-5.
12. A non-transitory computer readable storage medium storing computer instructions for causing the computer to perform the method of any one of claims 1-5.
13. A computer program product comprising a computer program, wherein the computer program, when executed by a processor, implements the method of any of claims 1-5.
CN202111652803.1A 2021-12-30 2021-12-30 Form testing method and device, electronic equipment and medium Active CN114328242B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111652803.1A CN114328242B (en) 2021-12-30 2021-12-30 Form testing method and device, electronic equipment and medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111652803.1A CN114328242B (en) 2021-12-30 2021-12-30 Form testing method and device, electronic equipment and medium

Publications (2)

Publication Number Publication Date
CN114328242A CN114328242A (en) 2022-04-12
CN114328242B true CN114328242B (en) 2024-02-20

Family

ID=81018849

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111652803.1A Active CN114328242B (en) 2021-12-30 2021-12-30 Form testing method and device, electronic equipment and medium

Country Status (1)

Country Link
CN (1) CN114328242B (en)

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10613971B1 (en) * 2018-01-12 2020-04-07 Intuit Inc. Autonomous testing of web-based applications
CN112835809A (en) * 2021-03-22 2021-05-25 亿企赢网络科技有限公司 Test data setting method, device, equipment and medium based on browser
CN112989789A (en) * 2021-03-15 2021-06-18 京东数科海益信息科技有限公司 Test method and device of text audit model, computer equipment and storage medium
TW202139054A (en) * 2020-04-10 2021-10-16 鴻海精密工業股份有限公司 Form data detection method, computer device and storage medium

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10853638B2 (en) * 2018-08-31 2020-12-01 Accenture Global Solutions Limited System and method for extracting structured information from image documents

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10613971B1 (en) * 2018-01-12 2020-04-07 Intuit Inc. Autonomous testing of web-based applications
TW202139054A (en) * 2020-04-10 2021-10-16 鴻海精密工業股份有限公司 Form data detection method, computer device and storage medium
CN113515588A (en) * 2020-04-10 2021-10-19 富泰华工业(深圳)有限公司 Form data detection method, computer device and storage medium
CN112989789A (en) * 2021-03-15 2021-06-18 京东数科海益信息科技有限公司 Test method and device of text audit model, computer equipment and storage medium
CN112835809A (en) * 2021-03-22 2021-05-25 亿企赢网络科技有限公司 Test data setting method, device, equipment and medium based on browser

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
一种Web应用测试数据生成与组织架构;黄陇;吴际;金茂忠;刘超;;计算机工程与应用;20060321(第09期);全文 *
基于DataPool的Web测试数据生成与维护方法;黄陇;李诺;金茂忠;刘超;;计算机科学;20061025(第10期);全文 *
基于词法分析的超链接自动测试技术与实现;黄茂生;杨春晖;;现代电子技术;20091115(第22期);全文 *

Also Published As

Publication number Publication date
CN114328242A (en) 2022-04-12

Similar Documents

Publication Publication Date Title
EP3117369B1 (en) Detecting and extracting image document components to create flow document
CN108229485B (en) Method and apparatus for testing user interface
KR20190026641A (en) Method of character recognition of claims document, apparatus, server and storage medium
CN109446061B (en) Page detection method, computer readable storage medium and terminal device
KR102002024B1 (en) Method for processing labeling of object and object management server
CN115063875B (en) Model training method, image processing method and device and electronic equipment
CN110647523B (en) Data quality analysis method and device, storage medium and electronic equipment
CN113408251B (en) Layout document processing method and device, electronic equipment and readable storage medium
CN112949767A (en) Sample image increment, image detection model training and image detection method
US20230096921A1 (en) Image recognition method and apparatus, electronic device and readable storage medium
CN112835579A (en) Method and device for determining interface code, electronic equipment and storage medium
CN113033346A (en) Text detection method and device and electronic equipment
CN115690443A (en) Feature extraction model training method, image classification method and related device
CN110826619A (en) File classification method and device of electronic files and electronic equipment
CN113626441A (en) Text management method, device and equipment based on scanning equipment and storage medium
CN114328242B (en) Form testing method and device, electronic equipment and medium
CN116468479A (en) Method for determining page quality evaluation dimension, and page quality evaluation method and device
CN116340172A (en) Data collection method and device based on test scene and test case detection method
CN115934928A (en) Information extraction method, device, equipment and storage medium
CN114924959A (en) Page testing method and device, electronic equipment and medium
CN107071553B (en) Method, device and computer readable storage medium for modifying video and voice
CN115270711A (en) Electronic signature method, electronic signature device, electronic apparatus, and storage medium
CN110083807B (en) Contract modification influence automatic prediction method, device, medium and electronic equipment
CN111079185B (en) Database information processing method and device, storage medium and electronic equipment
CN114722401A (en) Equipment safety testing method, device, equipment and storage medium

Legal Events

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