CN114328242A - Form testing method and device, electronic equipment and medium - Google Patents
Form testing method and device, electronic equipment and medium Download PDFInfo
- Publication number
- CN114328242A CN114328242A CN202111652803.1A CN202111652803A CN114328242A CN 114328242 A CN114328242 A CN 114328242A CN 202111652803 A CN202111652803 A CN 202111652803A CN 114328242 A CN114328242 A CN 114328242A
- Authority
- CN
- China
- Prior art keywords
- text box
- input text
- 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.)
- Granted
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 204
- 238000000034 method Methods 0.000 claims description 38
- 230000006870 function Effects 0.000 claims description 22
- 238000012545 processing Methods 0.000 claims description 16
- 238000004590 computer program Methods 0.000 claims description 15
- 238000004458 analytical method Methods 0.000 claims description 8
- 238000000605 extraction Methods 0.000 claims description 8
- 239000000284 extract Substances 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 19
- 238000004891 communication Methods 0.000 description 9
- 238000010998 test method Methods 0.000 description 6
- 238000013459 approach Methods 0.000 description 3
- 238000004422 calculation algorithm Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 238000010801 machine learning Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 230000008569 process Effects 0.000 description 3
- 238000004364 calculation method Methods 0.000 description 2
- 238000007405 data analysis Methods 0.000 description 2
- 238000007418 data mining Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 238000007477 logistic regression Methods 0.000 description 2
- 238000007781 pre-processing Methods 0.000 description 2
- 238000003491 array Methods 0.000 description 1
- 238000013473 artificial intelligence Methods 0.000 description 1
- 230000010267 cellular communication Effects 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 238000010276 construction Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 239000013307 optical fiber Substances 0.000 description 1
- 239000004065 semiconductor Substances 0.000 description 1
- 230000001953 sensory effect Effects 0.000 description 1
- 230000002123 temporal effect Effects 0.000 description 1
- 230000000007 visual effect Effects 0.000 description 1
Images
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: obtaining 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 the category corresponding to the second input text box, and acquiring a first input text box of the same category as the second input text box and test input and test output corresponding to the first input text box from the reference data; filling the obtained test input into a second input text box, and extracting the 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
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to the field of page configuration technologies, and in particular, to a method and an apparatus for testing a form, an electronic device, a computer-readable storage medium, and a computer program product.
Background
The form page is primarily responsible for the collection of data in a web page or application to gather different types of user input. In order to improve the effectiveness of information acquisition and improve the user's coordination, 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, unless otherwise indicated, the problems mentioned in this section should not be considered as having been acknowledged in any prior art.
Disclosure of Invention
The disclosure provides a form testing method, a form testing device, an electronic device, a computer readable storage medium and a 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 the category corresponding to the second input text box, and acquiring a first input text box of the same category as the second input text box and test input and test output corresponding to the first input text box from the reference data; 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; 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 form testing apparatus, including: a first obtaining module 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 a 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 the category corresponding to the second input text box, and acquire a first input text box of the same category as the second input text box and test input and test output corresponding to the first input text box from the reference data; the extraction module is configured to fill the second input text box with the test input obtained from the reference data and extract the test output of the second input text box; a comparison module 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 the second determination module is configured to determine 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 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 perform a method of testing a form.
According to another aspect of the disclosure, a computer program product is provided, comprising a computer program, wherein the computer program realizes the method of testing a form when executed by a processor.
According to one or more embodiments of the present disclosure, a method for automatically testing a form is provided, which includes obtaining test data of input textboxes of the same category from reference data, testing the input textboxes in a form to be tested, and comparing test outputs 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 of the form to be tested and the test output can be completed by an automatic test tool without the participation of testers, so that the test efficiency can be effectively improved, and the labor cost is reduced.
It should be understood that the statements in this section do not necessarily identify key or critical features of the embodiments of the present disclosure, nor do they limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate exemplary embodiments of the embodiments and, together with the description, serve to explain the exemplary implementations of the embodiments. The illustrated embodiments are for purposes of illustration only and do not limit the scope of the claims. Throughout the drawings, identical reference numbers designate similar, but not necessarily identical, elements.
FIG. 1 shows a flow diagram of a method of testing a form according to an embodiment of the present disclosure;
FIG. 2 shows a flow diagram of a method of acquiring reference data according to an embodiment of the present disclosure;
FIG. 3 illustrates a flow diagram of a method of parsing a reference form according to an embodiment of the disclosure;
FIG. 4 illustrates a flow diagram 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 device for testing forms, 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 present 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 with reference to the accompanying drawings, in which various details of the embodiments of the disclosure are included to assist understanding, and which are to be considered as merely exemplary. Accordingly, those 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, unless otherwise specified, the use of the terms "first", "second", and the like to describe various elements is not intended to limit the positional relationship, the temporal relationship, or the importance relationship of the elements, and such terms are used only to distinguish one element from another. In some examples, a first element and a second element may refer to the same instance of the element, and in some cases, based on the context, they may also refer to different instances.
The terminology used in the description of the various described 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, if the number of elements is not specifically limited, the elements may be one or more. Furthermore, the term "and/or" as used in this disclosure is intended to encompass any and all possible combinations of the listed items.
In the related art, a manual testing method can be used for testing the content of each text box in the form, and whether the form has a problem is judged through page prompt. The form can also be tested by compiling an automatic case by means of an automatic testing tool, however, the method has certain testing experience requirements on testers, and the testing threshold is high.
In order to solve the above problems, the present disclosure uses the test data of the correctly verified reference form as the reference data, obtains the test data of the input text boxes of the same category from the reference data, tests the input text boxes in the form to be tested, and compares the test outputs, thereby verifying the correctness of the form to be tested. In the test process, the acquisition of the reference data and the comparison of the test of the form to be tested and the test output can be completed by an automatic test tool without the 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 shows a flow diagram of a method of testing a form according to an embodiment of the present disclosure. As shown in fig. 1, the method 100 for testing a form includes: step S101, obtaining reference data generated based on a plurality of reference forms, wherein each of the plurality of reference forms contains a corresponding first input text box, and the reference data comprises test data corresponding to each of the plurality of reference forms, and the test data comprises a category of the first input text box contained in the corresponding reference form, a test input for the first input text box and a test output; step S102, obtaining a form to be tested, 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 of the same category as the second input text box and test input and test output corresponding to the first input text box 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 S105, 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 validated correct reference forms is used as reference data, wherein the plurality of reference forms can contain different classes of input text boxes. The input text box in the form to be tested is tested by obtaining test input by determining the type of the input text box in the form to be tested and obtaining the test data of the input text box of the same type in the reference data, and the test output is compared, so that the correctness of the form to be tested is verified.
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 needs to be obtained from the reference data. When the obtained test input is "pushover several oxx" and the test output is "only supporting Chinese letters, 2-8 characters", the test input of "pushover several oxx" is filled into an input text box for name collection in a form to be tested, and the test output of the input text box is extracted to be compared with the test output of "only supporting Chinese letters, 2-8 characters". When the two are consistent, the input text box in the form to be tested can give the expected error prompt for the input of the user, namely, the test is passed.
In the test method, the acquisition of the reference data and the comparison of the test of the form to be tested and the test output can be completed by an automatic test tool without the 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 reference data may be derived based on data mining and analysis of verified correct reference forms for automated testing of many different types of forms.
A description will be given below of a specific manner of acquiring the reference data.
Fig. 2 shows a flow diagram of a method of acquiring reference data according to an embodiment of the present disclosure. As shown in fig. 2, the method of acquiring reference data includes: step S201, analyzing each reference form in the plurality of reference forms to determine the category of a 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 of the plurality of reference forms.
Therefore, a large number of reference forms can be analyzed and tested to obtain different types of input text boxes and corresponding test data as reference data for testing new forms. The analysis and the test of the reference form can be completed by relying on an automatic test tool, so that the reference data can be acquired without the participation of a tester, and a large amount of data can be acquired for reference.
According to some embodiments, the extraction of the test output may be implemented based on 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 an illegal character, an error prompt of a red word appears in the first input text box region, the red content region may be intercepted to obtain a text box picture, and the word information in the picture is analyzed. Specifically, the text box picture can be converted from the RGB space to the HSV color space, the HSV color dictionary is queried to retain only the red content in the HSV picture, and then an and operation is performed pixel by pixel with the original text box picture to obtain an RGB image retaining only the red region, and the content of the characters is obtained through the OCR capability to extract and obtain the 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 random number generating method comprises a number function for randomly generating random numbers, a Chinese character function for randomly generating random numbers, an English letter function for randomly generating random numbers, a name function for randomly generating, a telephone function for randomly generating, a mail function for randomly generating, an identity card function for randomly generating and the like.
According to some embodiments, the generated test input may be filled into an input text box with the aid of an automated testing tool to enable automated testing of the reference form.
FIG. 3 shows a flow diagram of a method of parsing a reference form according to an embodiment of the disclosure. As shown in fig. 3, the method for parsing the reference form includes: step S301, performing image processing on each reference form in the plurality of reference forms to obtain an analysis graph corresponding to the reference form, wherein the analysis graph 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, the character information in the rectangular box and the 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, the image processing for each reference form in step S301 may include: preprocessing operations such as cutting and picture graying are carried out on the image containing the reference form so as to remove redundant information; and scanning pixel values in the horizontal and vertical directions of the gray image obtained by the graying processing to identify a background area and a foreground area in the gray image, and acquiring an analytic graph corresponding to the reference form and a plurality of rectangular frames contained in the analytic graph and used as text frames for subsequent identification of the input text frames.
It is to be understood that the plurality of rectangular boxes included in the parsing diagram are different types of text boxes, such as an input text box, a drop-down text box, a single selection text box, a date text box, and the like, and the input text box in the different types of text boxes can be determined according to the preset condition of step S302 based on at least one of the length of the rectangular box, the text information in the rectangular box, and the pixel information in the rectangular box, for the test of the input text box in the subsequent flow.
FIG. 4 illustrates a flow diagram of a method of determining a category of a first input text box according to an embodiment of the disclosure. As shown in fig. 4, the method of determining the category of the first input text box includes: step S401, aiming at a first input text box contained in each of the multiple reference forms, identifying characters above the first input text box to obtain a title corresponding to the first input text box; step S402, obtaining 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 the determination of the category of the first input text box is achieved by the title of the text box, and that text boxes of the same category may have different titles, for example, for a name box, for some input text boxes may be referred to by the title "name", by the title "nickname", by the title "name", and by the title "name", which, although different, are all representative of the same type of input text box. Therefore, the determination of the category of the first input text box is to firstly convert the title into a semantic vector through a depth model word2vec, and then realize character classification through machine learning algorithm logistic regression, so as to determine the category of the first input text box.
According to another aspect of the present disclosure, a device for testing forms is provided. As shown in fig. 5, the form testing 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 corresponding 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, from the reference data, a first input text box of the same category as the second input text box and a test input and a test output corresponding to the first input text box; an extracting module 504, configured to fill the second input text box with the test input obtained from the reference data, and extract the test output 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 whether the form to be tested passes the test based on the comparison result.
The operations of the modules 501 and 506 of the form testing apparatus 500 are similar to those of the steps S101 to S106 described above, and are not repeated herein.
The first obtaining module 501 takes test data of a plurality of verified correct reference forms as reference data, wherein the plurality of reference forms may contain different categories of input text boxes. The type of the input text box in the form to be tested is determined by the first determining module 503, and the test data of the input text box of the same type is obtained from the reference data to obtain the test input, the input text box in the form to be tested is tested by the extracting module 504, and the test output is compared by the comparing module 505, so that the correctness of the form to be tested is verified by the second determining module 506.
For example, when the first determining module 503 determines 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 needs to be obtained from the reference data. When the obtained test input is "flip few oxx" and the test output is "only chinese character support, 2-8 characters", the extraction module 504 fills the test input of "flip few oxx" into an input text box for name collection in the form to be tested, extracts the test output of the input text box, and compares the content of the test output of "only chinese character support, 2-8 characters" by the comparison module 505. When the two are consistent, the input text box in the form to be tested can give the expected error prompt for the input of the user, namely, the test is passed.
The acquisition of the reference data by the first acquisition module 501 and the comparison of the test output and the test of the form to be tested by the comparison module 505 can be completed by an automatic test tool without the 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 obtaining module 501 may derive reference data for automated testing of multiple different types of forms based on data mining and analysis of verified correct reference forms.
Fig. 6 shows a block diagram of a first obtaining module according to an embodiment of the present disclosure. As shown in fig. 6, the first obtaining module 501 includes: a first determining unit 601 configured to parse each of the plurality of reference forms to determine a category of a first input text box included in the reference form; an extracting unit 602 configured to fill in 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 the category of the first input text box, the test input of the first input text box, and the 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.
Thus, a large number of reference forms can be parsed and tested by the first determination unit 601 to obtain different categories of input text boxes and corresponding test data as reference data for testing of new forms. The analysis and the test of the reference form can be completed by relying on an automatic test tool, so that the reference data can be acquired without the participation of a tester, and a large amount of data can be acquired for reference.
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 an illegal character, an error prompt of a red word appears in the first input text box region, the red content region may be intercepted to obtain a text box picture, and the word information in the picture is analyzed. Specifically, the text box picture can be converted from the RGB space to the HSV color space, the HSV color dictionary is queried to retain only the red content in the HSV picture, and then an and operation is performed pixel by pixel with the original text box picture to obtain an RGB image retaining only the red region, and the content of the characters is obtained through the OCR capability to extract and obtain the 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 random number generating method comprises a number function for randomly generating random numbers, a Chinese character function for randomly generating random numbers, an English letter function for randomly generating random numbers, a name function for randomly generating, a telephone function for randomly generating, a mail function for randomly generating, an identity card function for randomly generating and the like.
According to some embodiments, the extraction unit 602 may populate the generated test input into the input text box by means of an automated testing tool to enable automated testing of the reference form.
Fig. 7 shows a block diagram of a 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 multiple reference forms to obtain an analysis graph corresponding to the reference form, where the analysis graph includes multiple rectangular frames; a third determining unit 702 configured to determine the first input text box contained in the reference form based on at least one of the length of each of the plurality of rectangular boxes, the text information in the rectangular box, and the 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 obtaining unit 701 may include: preprocessing operations such as cutting and picture graying are carried out on the image containing the reference form so as to remove redundant information; and scanning pixel values in the horizontal and vertical directions of the gray image obtained by the graying processing to identify a background area and a foreground area in the gray image, and acquiring an analytic graph corresponding to the reference form and a plurality of rectangular frames contained in the analytic graph and used as text frames for subsequent identification of the input text frames.
It is to be understood that the plurality of rectangular boxes included in the parse graph are different types of text boxes, such as an input text box, a drop-down text box, a single selection text box, a date text box, and the like, and the input text box in the different types of text boxes may be determined by the third determining 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 use in testing of the input text box 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, for a first input text box included in each of the multiple reference forms, identify a word above the first input text box 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 is to be understood that the fifth determining unit 803 determines the category of the first input text box by identifying the titles of the text boxes, and the text boxes of the same category may have different titles, for example, for a name box, for some input text boxes, the title may be "name", the title may be "nickname", and the title may be "name", and the titles may be all the same type of input text boxes represented, although they are different. Therefore, the determination of the category of the first input text box is to determine the category of the first input text box by converting the title of the first input text box into a semantic vector through the depth model word2vec by the third obtaining unit 802, and then performing character classification through logistic regression by the machine learning algorithm by the fifth determining unit 803.
According to an embodiment 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 a structure of an electronic device 900, which 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 device is 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 phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be examples only, and are not meant to limit implementations of the disclosure described and/or claimed herein.
As shown in fig. 9, the electronic apparatus 900 includes a computing unit 901, which can perform various appropriate actions and processes in accordance with 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 calculation unit 901, ROM 902, and RAM903 are connected to each other via a bus 904. An input/output (I/O) interface 905 is also connected to 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, and the input unit 906 may receive input numeric or character information and generate key signal inputs related to user settings and/or function controls of the electronic device, and may include, but is not limited to, a mouse, a keyboard, a touch screen, a track pad, a track ball, a joystick, a microphone, and/or a remote control. Output unit 907 may be any type of device capable of presenting information and may include, but is not limited to, a display, speakers, a video/audio output terminal, a vibrator, and/or a printer. Storage unit 908 may include, but is not limited to, a magnetic disk, an optical disk. The communication unit 909 allows the electronic device 900 to pass through a computer network such as the internet and/or various telecommunication networksThe network exchanges information/data with other devices and may include, but is not limited to, a modem, a network card, an infrared communication device, a wireless communication transceiver, and/or a chipset, such as bluetoothTMDevices, 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 the computing unit 901 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various dedicated Artificial Intelligence (AI) computing chips, various computing units running machine learning model algorithms, a Digital Signal Processor (DSP), and any suitable processor, controller, microcontroller, and so forth. The calculation unit 901 performs the respective methods and processes described above, such as the method of page layout. For example, in some embodiments, the method of page layout may be implemented as a computer software program tangibly embodied in 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 the RAM903 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 by any other suitable means (e.g., by means of firmware) to perform the method of page layout.
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuitry, Field Programmable Gate Arrays (FPGAs), Application Specific Integrated Circuits (ASICs), Application Specific Standard Products (ASSPs), system on a 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 that are executable and/or interpretable on a programmable system including at least one programmable processor, which may be special or general purpose, receiving data and instructions from, and transmitting data and instructions to, a storage system, at least one input device, and at least one output device.
Program code for implementing the methods of the present disclosure may be written in any combination of one or more programming languages. These program codes 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 codes, when executed by the processor or controller, cause the functions/operations specified in the flowchart and/or block diagram to be performed. 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. 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.
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 a pointing device (e.g., a mouse or a 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 can 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, speech, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a back-end 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 back-end, 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 clients and servers. A client and server are generally 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 with a combined blockchain.
It should be understood that various forms of the flows shown above may be used, with steps reordered, added, or deleted. For example, the steps described in the present disclosure may be performed in parallel, sequentially or in different orders, and are not limited herein as long as the desired results of the technical solutions disclosed in the present disclosure can be achieved.
Although embodiments or examples of the present disclosure have been described with reference to the accompanying drawings, it is to be understood that the above-described 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 as issued and their equivalents. Various elements in the embodiments or examples may be omitted or may be replaced with equivalents thereof. Further, the steps may be performed in an order different from that described in the present disclosure. Further, various elements in 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 with equivalent elements that appear after the present disclosure.
Claims (13)
1. A method for 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 the category corresponding to the second input text box, and acquiring a first input text box of the same category as the second input text box and test input and test output corresponding to the first input text box from the reference data;
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;
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 a first input text box contained in the reference form;
filling test input into the first input text box, and extracting 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
determining the reference data based on the test data corresponding to each of the plurality of reference forms.
3. The method of claim 2, wherein parsing each of the plurality of reference forms to determine the category of the first input text box contained in the reference form comprises, for each of the reference forms:
for each of the plurality of reference forms,
performing image processing on the reference form 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 the 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 included 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 characters above the first input text box to obtain a title corresponding to the first input text box;
obtaining 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 for testing the first input text box is generated based on a random function.
6. An apparatus for testing forms, comprising:
a first obtaining module 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 a 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 the category corresponding to the second input text box, and acquire a first input text box of the same category as the second input text box and test input and test output corresponding to the first input text box from the reference data;
the extraction module is configured to fill the second input text box with the test input obtained from the reference data and extract the test output of the second input text box;
a comparison module 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 determination 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 obtaining means comprises:
a first determination 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 included in the reference form;
an extraction unit configured to fill in 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 and the test output of the first input text box so as to obtain test data corresponding to the reference form; 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 obtaining unit is configured to perform image processing on each of the plurality of reference forms to obtain an analysis graph corresponding to the reference form, wherein the analysis graph comprises a plurality of rectangular frames;
a third determination unit configured to determine the 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 the fourth determining unit is configured to acquire the title corresponding to the first input text box so as to determine the category of the first input text box.
9. The apparatus of claim 8, wherein the fourth determining unit comprises:
the second acquisition unit is configured to identify, for a first input text box included in each of the plurality of reference forms, characters above the first input text box 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
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 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 having stored thereon 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 realizes the method of any one of claims 1-5 when executed by a processor.
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 true CN114328242A (en) | 2022-04-12 |
CN114328242B 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 (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20200074169A1 (en) * | 2018-08-31 | 2020-03-05 | Accenture Global Solutions Limited | System And Method For Extracting Structured Information From Image Documents |
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 |
-
2021
- 2021-12-30 CN CN202111652803.1A patent/CN114328242B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US10613971B1 (en) * | 2018-01-12 | 2020-04-07 | Intuit Inc. | Autonomous testing of web-based applications |
US20200074169A1 (en) * | 2018-08-31 | 2020-03-05 | Accenture Global Solutions Limited | System And Method For Extracting Structured Information From Image Documents |
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)
Title |
---|
黄茂生;杨春晖;: "基于词法分析的超链接自动测试技术与实现", 现代电子技术, no. 22, 15 November 2009 (2009-11-15) * |
黄陇;吴际;金茂忠;刘超;: "一种Web应用测试数据生成与组织架构", 计算机工程与应用, no. 09, 21 March 2006 (2006-03-21) * |
黄陇;李诺;金茂忠;刘超;: "基于DataPool的Web测试数据生成与维护方法", 计算机科学, no. 10, 25 October 2006 (2006-10-25) * |
Also Published As
Publication number | Publication date |
---|---|
CN114328242B (en) | 2024-02-20 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102171220B1 (en) | Character recognition method, device, server and storage medium of claim documents | |
CN110647523B (en) | Data quality analysis method and device, storage medium and electronic equipment | |
CN115063875B (en) | Model training method, image processing method and device and electronic equipment | |
CN109684008B (en) | Card rendering method, device, terminal and computer readable storage medium | |
CN111900694B (en) | Relay protection equipment information acquisition method and system based on automatic identification | |
US12118770B2 (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 | |
CN114924959A (en) | Page testing method and device, electronic equipment and medium | |
CN113962670A (en) | File approval method and equipment of file approval system and storage medium | |
CN110826306B (en) | Data acquisition method and device, computer readable storage medium and electronic equipment | |
CN116340172A (en) | Data collection method and device based on test scene and test case detection method | |
CN114328242B (en) | Form testing method and device, electronic equipment and medium | |
CN115937891A (en) | Document comparison method, device, equipment and medium | |
CN115659347A (en) | Safety testing method and device, electronic equipment and storage medium | |
CN110083807B (en) | Contract modification influence automatic prediction method, device, medium and electronic equipment | |
CN115952792A (en) | Text auditing method and device, electronic equipment, storage medium and product | |
CN115061921A (en) | Automatic test method, device, electronic equipment and readable storage medium | |
CN111079185B (en) | Database information processing method and device, storage medium and electronic equipment | |
CN114239505A (en) | Method, device and equipment for cleaning hidden characters in word document | |
CN114722401A (en) | Equipment safety testing method, device, equipment and storage medium | |
CN113268617A (en) | Method and device for detecting metadata of papers | |
CN113886745B (en) | Page picture testing method and device and electronic equipment | |
CN110618888A (en) | Method and related device for repeatedly identifying system errors | |
CN114218079A (en) | Case testing method, device and equipment and readable storage medium | |
CN117493785A (en) | Data processing method and device and electronic equipment |
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 |