CN111782514A - Test data comparison method and device - Google Patents

Test data comparison method and device Download PDF

Info

Publication number
CN111782514A
CN111782514A CN202010583221.1A CN202010583221A CN111782514A CN 111782514 A CN111782514 A CN 111782514A CN 202010583221 A CN202010583221 A CN 202010583221A CN 111782514 A CN111782514 A CN 111782514A
Authority
CN
China
Prior art keywords
image
test
data
test data
comparison result
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202010583221.1A
Other languages
Chinese (zh)
Inventor
高路丹
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
JD Digital Technology Holdings Co Ltd
Original Assignee
JD Digital Technology Holdings 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 JD Digital Technology Holdings Co Ltd filed Critical JD Digital Technology Holdings Co Ltd
Priority to CN202010583221.1A priority Critical patent/CN111782514A/en
Publication of CN111782514A publication Critical patent/CN111782514A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/22Matching criteria, e.g. proximity measures

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • General Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Evolutionary Computation (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Artificial Intelligence (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application relates to a method and a device for comparing test data, wherein the method comprises the following steps: intercepting a first image and a second image from a test page, wherein the test page is used for receiving input test data, the first image is used for displaying the first test data received by the test page, and the second image is used for displaying second test data obtained after the first test data is stored; comparing the first image with the second image to obtain a comparison result, wherein the comparison result is used for indicating the difference between the first test data and the second test data; and sending prompt information carrying the comparison result. The technical problem that the comparison efficiency is low when the test data are compared is solved.

Description

Test data comparison method and device
Technical Field
The present application relates to the field of computers, and in particular, to a method and an apparatus for comparing test data.
Background
With the development of the internet, in the application test process, after a tester fills in test data and stores the test data, sometimes the stored test data is inconsistent with the data filled by the tester due to background code conversion (for example, the tester reselects data of a drop-down box, but the drop-down box is still in a default state after the data is stored due to problems such as code conversion, or the tester selects a video as the test data, but the video is converted into an audio frequency after the data is stored due to problems of code writing), in order to ensure the accuracy of the test data filling, the tester needs to compare the data before and after the data is stored after some test data is filled, and determine whether the stored content is accurate. In the process of implementing the invention, the inventor finds that the current comparison mode is checked by the naked eyes of a tester, which wastes the time of the tester and may not find the content with wrong filling-in to cause the test failure.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The application provides a method and a device for comparing test data, which are used for at least solving the technical problem of low comparison efficiency when the test data are compared in the related technology.
According to an aspect of an embodiment of the present application, there is provided a method for comparing test data, including:
intercepting a first image and a second image from a test page, wherein the test page is used for receiving input test data, the first image is used for displaying the first test data received by the test page, and the second image is used for displaying second test data obtained after the first test data is stored;
comparing the first image with the second image to obtain a comparison result, wherein the comparison result is used for indicating the difference between the first test data and the second test data;
and sending prompt information carrying the comparison result.
Optionally, the capturing the first image and the second image from the test page includes:
displaying the test page in a test application;
receiving the first test data input on the test page;
under the condition that an interception instruction is detected, screenshot is carried out on the first test data to obtain a first image;
and under the condition that the storage operation is detected, performing screenshot on the second test data to obtain a second image.
Optionally, the intercepting the first image and the second image from the test page includes:
displaying the test page in a test application;
receiving the first test data input on the test page;
detecting an input progress of the first test data in the test page, wherein the input progress is used for indicating a proportion of the first test data which is input to the test page in the total amount of the first test data;
under the condition that the input progress reaches a target progress, screenshot is conducted on the first test data to obtain a first image, wherein the target progress is used for indicating that the first test data are completely input;
storing the test page to obtain the second test data;
and performing screenshot on the second test data to obtain the second image.
Optionally, comparing the first image with the second image to obtain the comparison result includes:
identifying indication information from the first image and the second image, wherein the indication information is used for indicating data attributes of the test data;
searching first target data corresponding to the indication information from the first image, and searching second target data corresponding to the indication information from the second image;
matching the first target data and the second target data;
and recording difference information as the comparison result under the condition that the first target data is not matched with the second target data in a consistent manner, wherein the difference information is used for indicating the position of the difference between the first target data and the second target data.
Optionally, searching for the first target data corresponding to the indication information from the first image, and searching for the second target data corresponding to the indication information from the second image includes:
determining a data type corresponding to the indication information;
under the condition that the data type is a text type, performing character recognition on a first data position corresponding to the indication information on the first image to obtain first target data, and performing character recognition on a second data position corresponding to the indication information on the second image to obtain second target data;
and under the condition that the data type is an image type, performing screenshot on a first data position corresponding to the indication information on the first image to obtain the first target data, and performing screenshot on a second data position corresponding to the indication information on the second image to obtain the second target data.
Optionally, the recording of the difference information as the comparison result includes at least one of:
labeling the difference information on the second image;
storing the difference information in a list file.
Optionally, the sending of the prompt information carrying the comparison result includes at least one of:
acquiring the second image marked with the comparison result as the prompt information; displaying the prompt information;
acquiring a list file recording the comparison result; and displaying the list file.
Optionally, after sending the prompt information carrying the comparison result, the method further includes:
acquiring an operation instruction returned in response to the prompt message;
and executing the operation instruction on the test page.
According to another aspect of the embodiments of the present application, there is also provided a device for comparing test data, including:
the device comprises an intercepting module, a storage module and a processing module, wherein the intercepting module is used for intercepting a first image and a second image from a test page, the test page is used for receiving input test data, the first image is used for displaying the first test data received by the test page, and the second image is used for displaying second test data obtained after the first test data is stored;
the comparison module is used for comparing the first image with the second image to obtain a comparison result, wherein the comparison result is used for indicating the difference between the first test data and the second test data;
and the sending module is used for sending the prompt information carrying the comparison result.
According to another aspect of the embodiments of the present application, there is also provided a storage medium including a stored program which, when executed, performs the above-described method.
According to another aspect of the embodiments of the present application, there is also provided an electronic device, including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor executes the above method through the computer program.
In the embodiment of the application, a first image and a second image are intercepted from a test page, wherein the test page is used for receiving input test data, the first image is used for displaying the first test data received by the test page, and the second image is used for displaying second test data obtained after the first test data is subjected to storage operation; comparing the first image with the second image to obtain a comparison result, wherein the comparison result is used for indicating the difference between the first test data and the second test data; the method comprises the steps of sending prompt information carrying comparison results, respectively intercepting images before and after a test page is stored to obtain a first image and a second image, comparing the first image with the second image to obtain a difference before the test data is stored and a prompt is given to the difference before the test data, and detecting the test data filled in the test page in an image comparison mode.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and together with the description, serve to explain the principles of the invention.
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without inventive exercise.
FIG. 1 is a diagram illustrating a hardware environment of a method for comparing test data according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of an alternative method of comparing test data according to an embodiment of the present application;
FIG. 3 is a schematic diagram of a test data detection method according to an alternative embodiment of the present application;
FIG. 4 is a schematic diagram of an alternative test data alignment apparatus according to an embodiment of the present application;
fig. 5 is a block diagram of a terminal according to an embodiment of the present application.
Detailed Description
In order to make the technical solutions better understood by those skilled in the art, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the application described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
According to an aspect of embodiments of the present application, an embodiment of a method for comparing test data is provided.
Alternatively, in this embodiment, the above-mentioned comparison method of test data may be applied to a hardware environment formed by the terminal 101 and the server 103 as shown in fig. 1. As shown in fig. 1, a server 103 is connected to a terminal 101 through a network, which may be used to provide services (such as game services, application services, etc.) for the terminal or a client installed on the terminal, and a database may be provided on the server or separately from the server for providing data storage services for the server 103, and the network includes but is not limited to: the terminal 101 is not limited to a PC, a mobile phone, a tablet computer, and the like. The comparison method of the test data in the embodiment of the present application may be executed by the server 103, the terminal 101, or both the server 103 and the terminal 101. The terminal 101 may execute the method for comparing test data according to the embodiment of the present application by a client installed thereon.
Fig. 2 is a flowchart of an alternative test data comparison method according to an embodiment of the present application, and as shown in fig. 2, the method may include the following steps:
step S202, a first image and a second image are intercepted from a test page, wherein the test page is used for receiving input test data, the first image is used for displaying the first test data received by the test page, and the second image is used for displaying second test data obtained after the first test data is stored;
step S204, comparing the first image with the second image to obtain a comparison result, wherein the comparison result is used for indicating the difference between the first test data and the second test data;
and step S206, sending the prompt information carrying the comparison result.
Through the steps S202 to S206, the images before and after the test page is stored are respectively captured to obtain the first image and the second image, the first image and the second image are compared to obtain the difference before the test data is stored and the difference before the test data is prompted, and the test data filled in the test page is detected in an image comparison manner.
Optionally, in this embodiment, the comparison method of the test data may be, but is not limited to, applied to an application, a plug-in, or a script having a function of comparing the test data.
In the technical solution provided in step S202, the test page is a page for receiving input test data, such as: the test page may be, but is not limited to, a page showing a form in which test data is filled out, and the tester may fill in the test data at a corresponding position (input box) as indicated in the form. The format of the test data may include, but is not limited to: text, image, date, options, buttons, and the like.
Optionally, in this embodiment, the first image is used to show first test data received by the test page, and the second image is used to show second test data obtained after the save operation is performed on the first test data. The operation of intercepting the first image and the second image may be, but is not limited to, automatically triggered, or manually operated by a tester.
Such as: when the test data to be filled in the test page are completely filled in, the test page is automatically intercepted to obtain a first image. And when the fact that the test personnel execute the storage operation on the test page is detected, automatically intercepting the test page to obtain a second image. That is, certain operations on the test page may be used as triggers for performing the intercept operation. Or displaying an intercepting button on the test page, and intercepting the test page to obtain a first image when detecting that a tester clicks the intercepting button. And when the intercepting button is clicked again after the test personnel is detected to execute the storage operation on the test page, intercepting the test page to obtain a second image.
Optionally, in this embodiment, the saving operation may refer to, but is not limited to, a clicking operation performed by the tester on a saving button on the test page, or a saving operation performed by the tester using a keyboard shortcut key, or the like, which is used to trigger an operation of saving the data filled in on the test page.
In the technical solution provided in step S204, the comparison result obtained by comparing the first image and the second image may be, but is not limited to, used for indicating a difference between the first test data displayed in the first image and the second test data displayed in the second image, that is, the process of comparing the first image and the second image may be, but is not limited to, a process of comparing the test data displayed in the images.
Optionally, in this embodiment, the manner of comparing the first image and the second image may be, but is not limited to, a manner of comparing pixel gray levels, or a manner of image recognition and data matching, or a manner of comparing image colors. Such as: the pixel gray scale comparison may be performed by comparing pixel gray scales of corresponding positions on the first image and the second image, and determining a comparison result according to a difference between the pixel gray scales. The image recognition and data matching method can be adopted by firstly carrying out image recognition on the first image and the second image, then matching corresponding image contents on the recognized first image and the recognized second image, and determining the difference between the image contents according to the matching result to obtain a comparison result. The manner of comparing the colors of the images may be to compare color values of R, G, B channels of the corresponding position colors on the first image and the second image to obtain a color difference between pixels of the corresponding position, and determine a comparison result according to the color difference.
In the technical solution provided in step S206, the form of the prompt message may include, but is not limited to, an image, a text description, a table, and the like. Such as: the comparison result may be marked on the first image (or the second image), or the position of the difference between the first test data and the second test data on the first image (or the second image) may be described in text, or the difference between the test data and the corresponding relationship between the difference and the position of the difference on the first image (or the second image) may be listed in a table.
As an alternative embodiment, the step of intercepting the first image and the second image from the test page comprises:
s11, displaying the test page in the test application;
s12, receiving the first test data input on the test page;
s13, under the condition that an interception instruction is detected, screenshot is conducted on the first test data, and a first image is obtained;
and S14, under the condition that the saving operation is detected, performing screenshot on the second test data to obtain the second image.
Optionally, in this embodiment, the test application may include, but is not limited to, an application program for testing data, pages, code, and the like, and may be in the form of software or a plug-in. And displaying a test page on the test application, wherein a tester can fill in test data on the test page according to corresponding requirements, and can trigger the screenshot operation of the first image through an intercepting instruction and trigger the screenshot operation of the second image through a storing operation in the process of filling in the test data and storing the test data.
Optionally, in this embodiment, the intercepting instruction may be, but is not limited to, a preset instruction, and the intercepting instruction may be an instruction issued by an active operation of a tester, or an instruction issued by a detected preset operation. The saving operation may be performed actively by a tester, or may be triggered automatically according to a preset rule.
Such as: an interception button and a saving button can be displayed on the test page, and the detection of the clicking operation performed on the interception button is equivalent to the detection of the interception instruction. Detecting a click operation performed on the save button is equivalent to detecting a save operation. Or, only the save button may be displayed on the test page, and after the click operation performed on the save button is detected, the first test data is firstly subjected to screenshot to obtain the first image, then the save operation of the test data is performed, and then the second test data obtained after the save is subjected to screenshot to obtain the second image.
As an alternative embodiment, the step of intercepting the first image and the second image from the test page comprises:
s21, displaying the test page in the test application;
s22, receiving the first test data input on the test page;
s23, detecting the input progress of the first test data in the test page, wherein the input progress is used for indicating the proportion of the first test data which are input to the total quantity of the first test data;
s24, when the input progress reaches a target progress, screenshot is conducted on the first test data to obtain the first image, wherein the target progress is used for indicating that the first test data are completely input;
s25, storing the test page to obtain the second test data;
and S26, performing screenshot on the second test data to obtain the second image.
Optionally, in this embodiment, the automatic intercepting of the first image and the second image may be controlled by detecting a progress of the test data input on the test page. Such as: after all the test data on the test page are detected to be input, the first image can be actively intercepted, the test data can be automatically stored, and then the second image can be automatically intercepted.
Optionally, in this embodiment, the target progress may be set to be, but not limited to, 100%, may also be any other numerical value, and may also be a plurality of progressively increasing numerical values (that is, the data before and after being saved are compared for a plurality of times during the process of filling in the test data). The input progress reaching the target progress may be, but is not limited to, represented by determining that the input progress reaches the target progress if it is detected that all the test data required to be input are filled or uploaded, or determining that the input progress reaches the target progress if it is detected that the test data on the test page are input in the display order that the last test data are filled or uploaded.
As an optional embodiment, the comparing the first image and the second image to obtain the comparison result includes:
s31, identifying indication information from the first image and the second image, wherein the indication information is used for indicating data attributes of the test data;
s32, searching first target data corresponding to the indication information from the first image, and searching second target data corresponding to the indication information from the second image;
s33, matching the first target data and the second target data;
and S34, recording difference information as the comparison result when the first target data and the second target data are not matched and consistent, wherein the difference information is used for indicating the position of the difference between the first target data and the second target data.
Optionally, in this embodiment, the indication information in the test page may be used to indicate data attributes of the test data, such as: the indication information may be, but is not limited to, the name of the test data, that is, the content fixedly displayed on the test page, and is information that prompts the tester to fill in the process of the test data.
Optionally, in this embodiment, but not limited to, the target data corresponding to the indication information may be located through a position relationship between the data and the indication information, so as to obtain the first target data and the second target data. Such as: and the test page is displayed in an input frame form, the name of the input frame is equivalent to the indication information, the content filled in the input frame is the target data, the relative positions of the name of the input frame and the input frame are fixed, the first target data can be searched from the first image according to the position relationship between the name of the input frame and the input frame, and the second target data can be searched from the second image.
Optionally, in this embodiment, the manner of matching the first target data and the second target data may include, but is not limited to, a manner of calculating similarity, and the like.
Optionally, in this embodiment, as for the way of matching the first target data and the second target data by calculating the similarity, but not limited to, the similarity does not exceed a preset similarity threshold and is determined as the matching inconsistency, or both the similarities which do not reach 100% may be determined as the matching inconsistency.
As an alternative embodiment, searching for the first target data corresponding to the indication information from the first image, and searching for the second target data corresponding to the indication information from the second image includes:
s41, determining the data type corresponding to the indication information;
s42, when the data type is a text type, performing character recognition on a first data position corresponding to the indication information on the first image to obtain the first target data, and performing character recognition on a second data position corresponding to the indication information on the second image to obtain the second target data;
and S43, under the condition that the data type is an image type, performing screenshot on a first data position corresponding to the indication information on the first image to obtain the first target data, and performing screenshot on a second data position corresponding to the indication information on the second image to obtain the second target data.
Optionally, in this embodiment, the first target data and the second target data may be found in different manners according to the data type of the indication information.
Optionally, in this embodiment, for the indication information of the text type, the first target data and the second target data may be obtained by, but not limited to, adopting a character recognition mode. For the indication information of the image type, the first target data and the second target data can be obtained by adopting a screenshot mode, but not limited.
As an alternative embodiment, the recording of the difference information as the alignment result includes at least one of:
s51, labeling the difference information on the second image;
s52, storing the difference information in a list file.
Optionally, in this embodiment, the manner of recording the difference information between the first target data and the second target data may include, but is not limited to: the manner of annotation on the image, and one or more of the manners described in the list file.
Optionally, in this embodiment, an image area where the difference information is located may be highlighted or labeled with a prompt box on the second image.
Optionally, in this embodiment, the difference information may be stored in the list file in a manner of, but not limited to, a key-value pair. Such as: and storing the description of the difference information as a value by taking the position of the difference information as a key.
As an optional embodiment, sending the prompt information carrying the comparison result includes at least one of the following:
s61, acquiring the second image marked with the comparison result as the prompt information; displaying the prompt information;
s62, acquiring a list file recording the comparison result; and displaying the list file.
Optionally, in this embodiment, the prompt information may be, but is not limited to, the second image labeled with the comparison result, or may also be a list file recorded with the comparison result. The difference between the test data is displayed by displaying the prompt information in the form of an image or a file, so that a tester can correspondingly adjust the test data according to the displayed prompt information.
As an optional embodiment, after sending the prompt information carrying the comparison result, the method further includes:
s71, acquiring an operation instruction returned in response to the prompt message;
s72, executing the operation instruction on the test page.
Optionally, in this embodiment, after the prompt information is sent, the tester may perform corresponding operations on the difference before and after the test data indicated in the prompt information is stored, and perform operation processing on the test page according to an operation instruction triggered by the tester, so as to correct the detected difference of the test data.
The present application also provides an alternative embodiment that provides a method of test data detection by image contrast. Fig. 3 is a schematic diagram of a test data detection method according to an alternative embodiment of the present application, as shown in fig. 3, a first image and a second image before and after data storage are captured, and may be captured manually by a tester or automatically by a test plug-in, and the first image and the second image are compared, so as to find out a position where a difference exists between the first image and the second image, and label a part where the difference exists, for example: the way of labeling may be highlighting, prompt box labeling, etc.
An alternative way of comparing the first image and the second image is described below, which may include, but is not limited to, the following processes:
s1, finding corresponding fixed fields (corresponding to the indication information) in the first image and the second image, such as: time online, time offline, tree, object, jump, etc. as shown in FIG. 3.
S2, identifying the specific content (corresponding to the first target data and the second target data) corresponding to each fixed field in the first image and the second image, if the specific content is a text, performing text identification, and if the specific content is a picture, intercepting the corresponding picture. The specific content corresponding to a fixed field may have both text and pictures. The corresponding relationship between the contents to be compared can be determined according to the position relationship between the specific contents and the fixed field.
And S3, comparing the recognized characters for the fixed fields of the recognized characters, and marking the positions of different characters on the second image. And for the fixed field of the identified picture, comparing the pixel gray values of the identified picture, and marking different parts in the picture on the second image, so as to obtain the second image marked with the difference between the data as a comparison result.
S4, a prompt box for prompting that there is a difference before and after the test data is saved is displayed on the test page as a prompt message, and a second image in which the difference between the data is noted is displayed in the prompt box.
In the above-described alternative embodiment, the portion where the difference exists is highlighted directly on the image by the image contrast before and after the test data is saved, thereby determining whether or not the test data is consistent before and after the test data is saved. The time of manual comparison is saved, the waste of manpower is avoided, and the accuracy of comparison of the test data can be improved.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present application is not limited by the order of acts described, as some steps may occur in other orders or concurrently depending on the application. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required in this application.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present application may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present application.
According to another aspect of the embodiments of the present application, there is also provided an alignment apparatus for test data, which is used for implementing the above method for aligning test data. Fig. 4 is a schematic diagram of an alternative test data alignment apparatus according to an embodiment of the present application, and as shown in fig. 4, the apparatus may include:
an intercepting module 42, configured to intercept a first image and a second image from a test page, where the test page is configured to receive input test data, the first image is configured to display the first test data received by the test page, and the second image is configured to display second test data obtained after a saving operation is performed on the first test data;
a comparison module 44, configured to compare the first image and the second image to obtain a comparison result, where the comparison result is used to indicate a difference between the first test data and the second test data;
a sending module 46, configured to send a prompt message carrying the comparison result.
It should be noted that the initiating module 42 in this embodiment may be configured to execute step S202 in this embodiment, the opening module 44 in this embodiment may be configured to execute step S204 in this embodiment, and the sending module 46 in this embodiment may be configured to execute step S206 in this embodiment.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may operate in a hardware environment as shown in fig. 1, and may be implemented by software or hardware.
Through the module, images before and after the test page is stored are respectively intercepted to obtain a first image and a second image, the first image and the second image are compared to obtain a difference before the test data before and after the test page is stored, the difference before the test data is prompted, the test data filled in the test page is detected in an image comparison mode, compared with a manual detection mode, on one hand, automatic comparison of the test data is achieved, the speed of comparison of the test data is improved, on the other hand, the probability of misjudgment or disc leakage in the process of detecting the test data is reduced, the technical effect of improving the comparison efficiency when the test data is compared is achieved, and the technical problem that the comparison efficiency is low when the test data is compared is solved.
As an optional embodiment, the intercepting module further comprises:
the first display unit is used for displaying the test page in the test application;
a first receiving unit, configured to receive the first test data input on the test page;
the first capturing unit is used for capturing the first test data to obtain the first image under the condition that a capturing instruction is detected;
and the second interception unit is used for carrying out screenshot on the second test data under the condition that the storage operation is detected to obtain the second image.
As an optional embodiment, the intercepting module further comprises:
the second display unit is used for displaying the test page in the test application;
a second receiving unit, configured to receive the first test data input on the test page;
the detection unit is used for detecting the input progress of the first test data in the test page, wherein the input progress is used for indicating the proportion of the first test data which is input to the test page to the total quantity of the first test data;
the third capturing unit is used for capturing the first test data to obtain the first image under the condition that the input progress reaches a target progress, wherein the target progress is used for indicating that the first test data are completely input;
the storage unit is used for storing the test page to obtain the second test data;
and the fourth interception unit is used for carrying out screenshot on the second test data to obtain the second image.
As an alternative embodiment, the comparison module further comprises:
the identification unit is used for identifying indication information from the first image and the second image, wherein the indication information is used for indicating the data attribute of the test data;
the searching unit is used for searching first target data corresponding to the indication information from the first image and searching second target data corresponding to the indication information from the second image;
a matching unit, configured to match the first target data with the second target data;
and a recording unit, configured to record, as the comparison result, difference information when the first target data and the second target data are not matched and consistent, where the difference information is used to indicate a position where there is a difference between the first target data and the second target data.
As an optional embodiment, the lookup unit further includes:
determining a data type corresponding to the indication information;
under the condition that the data type is a text type, performing character recognition on a first data position corresponding to the indication information on the first image to obtain first target data, and performing character recognition on a second data position corresponding to the indication information on the second image to obtain second target data;
and under the condition that the data type is an image type, performing screenshot on a first data position corresponding to the indication information on the first image to obtain the first target data, and performing screenshot on a second data position corresponding to the indication information on the second image to obtain the second target data.
As an alternative embodiment, the recording unit further comprises at least one of:
labeling the difference information on the second image;
storing the difference information in a list file.
As an alternative embodiment, the sending module includes at least one of:
the first display unit is used for acquiring the second image marked with the comparison result as the prompt information; displaying the prompt information;
the second display unit is used for acquiring a list file recording the comparison result; and displaying the list file.
As an optional embodiment, after the sending module, the apparatus further includes:
the acquisition unit is used for acquiring an operation instruction returned in response to the prompt message;
and the execution unit is used for executing the operation instruction on the test page.
It should be noted here that the modules described above are the same as the examples and application scenarios implemented by the corresponding steps, but are not limited to the disclosure of the above embodiments. It should be noted that the modules described above as a part of the apparatus may be operated in a hardware environment as shown in fig. 1, and may be implemented by software, or may be implemented by hardware, where the hardware environment includes a network environment.
According to another aspect of the embodiment of the present application, a server or a terminal for implementing the comparison method of the test data is also provided.
Fig. 5 is a block diagram of a terminal according to an embodiment of the present application, and as shown in fig. 5, the terminal may include: one or more processors 501 (only one of which is shown), a memory 503, and a transmission means 505. as shown in fig. 5, the terminal may further include an input/output device 507.
The memory 503 may be used to store software programs and modules, such as program instructions/modules corresponding to the method and apparatus for comparing test data in the embodiment of the present application, and the processor 501 executes various functional applications and data processing by running the software programs and modules stored in the memory 503, that is, implements the method for comparing test data. The memory 503 may include high speed random access memory and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, the memory 503 may further include memory located remotely from the processor 501, which may be connected to the terminal through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission means 505 is used for receiving or sending data via a network, and may also be used for data transmission between the processor and the memory. Examples of the network may include a wired network and a wireless network. In one example, the transmission device 505 includes a Network adapter (NIC) that can be connected to a router via a Network cable and other Network devices to communicate with the internet or a local area Network. In one example, the transmission device 505 is a Radio Frequency (RF) module, which is used for communicating with the internet in a wireless manner.
Among them, the memory 503 is used to store an application program in particular.
The processor 501 may call the application stored in the memory 503 through the transmission means 505 to perform the following steps:
intercepting a first image and a second image from a test page, wherein the test page is used for receiving input test data, the first image is used for displaying the first test data received by the test page, and the second image is used for displaying second test data obtained after the first test data is stored;
comparing the first image with the second image to obtain a comparison result, wherein the comparison result is used for indicating the difference between the first test data and the second test data;
and sending prompt information carrying the comparison result.
By adopting the embodiment of the application, a scheme for comparing test data is provided. The method comprises the steps of respectively intercepting images before and after the test page is stored to obtain a first image and a second image, comparing the first image with the second image to obtain the difference before the test data before and after the test page is stored, prompting the difference before the test data, and detecting the test data filled in the test page in an image comparison mode.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
It can be understood by those skilled in the art that the structure shown in fig. 5 is only an illustration, and the terminal may be a terminal device such as a smart phone (e.g., an Android phone, an iOS phone, etc.), a tablet computer, a palm computer, and a Mobile Internet Device (MID), a PAD, etc. Fig. 5 is a diagram illustrating a structure of the electronic device. For example, the terminal may also include more or fewer components (e.g., network interfaces, display devices, etc.) than shown in FIG. 5, or have a different configuration than shown in FIG. 5.
Those skilled in the art will appreciate that all or part of the steps in the methods of the above embodiments may be implemented by a program instructing hardware associated with the terminal device, where the program may be stored in a computer-readable storage medium, and the storage medium may include: flash disks, Read-Only memories (ROMs), Random Access Memories (RAMs), magnetic or optical disks, and the like.
Embodiments of the present application also provide a storage medium. Optionally, in this embodiment, the storage medium may be used to execute a program code of a comparison method of test data.
Optionally, in this embodiment, the storage medium may be located on at least one of a plurality of network devices in a network shown in the above embodiment.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
intercepting a first image and a second image from a test page, wherein the test page is used for receiving input test data, the first image is used for displaying the first test data received by the test page, and the second image is used for displaying second test data obtained after the first test data is stored;
comparing the first image with the second image to obtain a comparison result, wherein the comparison result is used for indicating the difference between the first test data and the second test data;
and sending prompt information carrying the comparison result.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments, and this embodiment is not described herein again.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
The above-mentioned serial numbers of the embodiments of the present application are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or a part of or all or part of the technical solution contributing to the prior art may be embodied in the form of a software product stored in a storage medium, and including instructions for causing one or more computer devices (which may be personal computers, servers, network devices, or the like) to execute all or part of the steps of the method described in the embodiments of the present application.
In the above embodiments of the present application, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present application and it should be noted that those skilled in the art can make several improvements and modifications without departing from the principle of the present application, and these improvements and modifications should also be considered as the protection scope of the present application.

Claims (11)

1. A method for comparing test data is characterized by comprising the following steps:
intercepting a first image and a second image from a test page, wherein the test page is used for receiving input test data, the first image is used for displaying the first test data received by the test page, and the second image is used for displaying second test data obtained after the first test data is stored;
comparing the first image with the second image to obtain a comparison result, wherein the comparison result is used for indicating the difference between the first test data and the second test data;
and sending prompt information carrying the comparison result.
2. The method of claim 1, wherein the step of intercepting the first image and the second image from the test page comprises:
displaying the test page in a test application;
receiving the first test data input on the test page;
under the condition that an interception instruction is detected, screenshot is carried out on the first test data to obtain a first image;
and under the condition that the storage operation is detected, performing screenshot on the second test data to obtain a second image.
3. The method of claim 1, wherein the step of intercepting the first image and the second image from the test page comprises:
displaying the test page in a test application;
receiving the first test data input on the test page;
detecting an input progress of the first test data in the test page, wherein the input progress is used for indicating a proportion of the first test data which is input to the test page in the total amount of the first test data;
under the condition that the input progress reaches a target progress, screenshot is conducted on the first test data to obtain a first image, wherein the target progress is used for indicating that the first test data are completely input;
storing the test page to obtain the second test data;
and performing screenshot on the second test data to obtain the second image.
4. The method of claim 1, wherein comparing the first image with the second image to obtain the comparison result comprises:
identifying indication information from the first image and the second image, wherein the indication information is used for indicating data attributes of the test data;
searching first target data corresponding to the indication information from the first image, and searching second target data corresponding to the indication information from the second image;
matching the first target data and the second target data;
and recording difference information as the comparison result under the condition that the first target data is not matched with the second target data in a consistent manner, wherein the difference information is used for indicating the position of the difference between the first target data and the second target data.
5. The method of claim 4, wherein searching for first target data corresponding to the indication information from the first image and searching for second target data corresponding to the indication information from the second image comprises:
determining a data type corresponding to the indication information;
under the condition that the data type is a text type, performing character recognition on a first data position corresponding to the indication information on the first image to obtain first target data, and performing character recognition on a second data position corresponding to the indication information on the second image to obtain second target data;
and under the condition that the data type is an image type, performing screenshot on a first data position corresponding to the indication information on the first image to obtain the first target data, and performing screenshot on a second data position corresponding to the indication information on the second image to obtain the second target data.
6. The method of claim 4, wherein recording the difference information as the comparison result comprises at least one of:
labeling the difference information on the second image;
storing the difference information in a list file.
7. The method of claim 1, wherein sending the prompt message carrying the comparison result comprises at least one of:
acquiring the second image marked with the comparison result as the prompt information; displaying the prompt information;
acquiring a list file recording the comparison result; and displaying the list file.
8. The method according to claim 1, wherein after sending the prompt message carrying the comparison result, the method further comprises:
acquiring an operation instruction returned in response to the prompt message;
and executing the operation instruction on the test page.
9. An apparatus for comparing test data, comprising:
the device comprises an intercepting module, a storage module and a processing module, wherein the intercepting module is used for intercepting a first image and a second image from a test page, the test page is used for receiving input test data, the first image is used for displaying the first test data received by the test page, and the second image is used for displaying second test data obtained after the first test data is stored;
the comparison module is used for comparing the first image with the second image to obtain a comparison result, wherein the comparison result is used for indicating the difference between the first test data and the second test data;
and the sending module is used for sending the prompt information carrying the comparison result.
10. A storage medium, characterized in that the storage medium comprises a stored program, wherein the program when executed performs the method of any of the preceding claims 1 to 8.
11. An electronic device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, wherein the processor executes the method of any of the preceding claims 1 to 8 by means of the computer program.
CN202010583221.1A 2020-06-23 2020-06-23 Test data comparison method and device Pending CN111782514A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010583221.1A CN111782514A (en) 2020-06-23 2020-06-23 Test data comparison method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010583221.1A CN111782514A (en) 2020-06-23 2020-06-23 Test data comparison method and device

Publications (1)

Publication Number Publication Date
CN111782514A true CN111782514A (en) 2020-10-16

Family

ID=72757702

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010583221.1A Pending CN111782514A (en) 2020-06-23 2020-06-23 Test data comparison method and device

Country Status (1)

Country Link
CN (1) CN111782514A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113138933A (en) * 2021-05-13 2021-07-20 网易(杭州)网络有限公司 Data table testing method, electronic device and storage medium
CN114327203A (en) * 2021-12-28 2022-04-12 傲网信息科技(厦门)有限公司 User operation restoration method and device, and recording method and device

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007304846A (en) * 2006-05-11 2007-11-22 Hitachi Ltd Specification creation support method and specification creation support apparatus
CN101183387A (en) * 2007-12-14 2008-05-21 沈阳东软软件股份有限公司 Increment data capturing method and system
US20130004087A1 (en) * 2011-06-30 2013-01-03 American Express Travel Related Services Company, Inc. Method and system for webpage regression testing
JP2013105358A (en) * 2011-11-15 2013-05-30 Japan Research Institute Ltd System and method for comparative test on difference between new and old versions of program
CN109815156A (en) * 2019-02-28 2019-05-28 北京百度网讯科技有限公司 Displaying test method, device, equipment and the storage medium of visual element in the page
CN109815039A (en) * 2018-12-14 2019-05-28 深圳壹账通智能科技有限公司 Test method and device, storage medium, the computer equipment of business software
CN110287125A (en) * 2019-07-04 2019-09-27 中国工商银行股份有限公司 Software routine test method and device based on image recognition
CN110618932A (en) * 2019-08-15 2019-12-27 福建升腾资讯有限公司 Input box testing method based on Web automatic test and readable storage medium
CN110908909A (en) * 2019-11-21 2020-03-24 望海康信(北京)科技股份公司 Automatic testing method and device, storage medium and equipment

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007304846A (en) * 2006-05-11 2007-11-22 Hitachi Ltd Specification creation support method and specification creation support apparatus
CN101183387A (en) * 2007-12-14 2008-05-21 沈阳东软软件股份有限公司 Increment data capturing method and system
US20130004087A1 (en) * 2011-06-30 2013-01-03 American Express Travel Related Services Company, Inc. Method and system for webpage regression testing
JP2013105358A (en) * 2011-11-15 2013-05-30 Japan Research Institute Ltd System and method for comparative test on difference between new and old versions of program
CN109815039A (en) * 2018-12-14 2019-05-28 深圳壹账通智能科技有限公司 Test method and device, storage medium, the computer equipment of business software
CN109815156A (en) * 2019-02-28 2019-05-28 北京百度网讯科技有限公司 Displaying test method, device, equipment and the storage medium of visual element in the page
CN110287125A (en) * 2019-07-04 2019-09-27 中国工商银行股份有限公司 Software routine test method and device based on image recognition
CN110618932A (en) * 2019-08-15 2019-12-27 福建升腾资讯有限公司 Input box testing method based on Web automatic test and readable storage medium
CN110908909A (en) * 2019-11-21 2020-03-24 望海康信(北京)科技股份公司 Automatic testing method and device, storage medium and equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
刘煦;王笛;张源;杨珉;: "应用图像对比方法的UI自动化功能测试", 计算机应用与软件, no. 10, pages 117 - 122 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113138933A (en) * 2021-05-13 2021-07-20 网易(杭州)网络有限公司 Data table testing method, electronic device and storage medium
CN114327203A (en) * 2021-12-28 2022-04-12 傲网信息科技(厦门)有限公司 User operation restoration method and device, and recording method and device
CN114327203B (en) * 2021-12-28 2023-08-04 傲网信息科技(厦门)有限公司 User operation restoration method and device, and recording method and device

Similar Documents

Publication Publication Date Title
CN103079092B (en) Obtain the method and apparatus of people information in video
CN112100431B (en) Evaluation method, device and equipment of OCR system and readable storage medium
CN110175609B (en) Interface element detection method, device and equipment
CN104866414A (en) Method, device and system for testing application program
CN106485261B (en) Image recognition method and device
KR102002024B1 (en) Method for processing labeling of object and object management server
CN111782514A (en) Test data comparison method and device
US20230215206A1 (en) Resume Document Parsing using Computer Vision and Optical Character Recognition with Reblocking Feedback
CN112612690A (en) User interface information processing method and device, electronic equipment and storage medium
CN111309505B (en) Page exception handling method and device and electronic equipment
CN110248235B (en) Software teaching method, device, terminal equipment and medium
CN112148607A (en) Interface testing method and device for service scene
CN114782769A (en) Training sample generation method, device and system and target object detection method
CN110598186A (en) Auxiliary processing method, device and system for image recognition
CN113537248A (en) Image recognition method and device, electronic equipment and storage medium
US8702001B2 (en) Apparatus and method for acquiring code image in a portable terminal
CN110059184B (en) Operation error collection and analysis method and system
CN110858198B (en) System, non-transitory computer readable medium and method for retrieving contact information
CN111145143A (en) Problem image determination method and device, electronic equipment and storage medium
CN116431468A (en) Test method, test device, test processing equipment and storage medium
CN109144841B (en) Method and device for identifying advertisement application, computer equipment and storage medium
CN107330069A (en) Multimedia data processing method and device, server and storage medium
CN114973218A (en) Image processing method, device and system
CN108632370B (en) Task pushing method and device, storage medium and electronic device
CN109214474B (en) Behavior analysis and information coding risk analysis method and device based on information coding

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
CB02 Change of applicant information
CB02 Change of applicant information

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant after: Jingdong Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant before: Jingdong Digital Technology Holding Co.,Ltd.

Address after: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant after: Jingdong Digital Technology Holding Co.,Ltd.

Address before: Room 221, 2 / F, block C, 18 Kechuang 11th Street, Daxing District, Beijing, 100176

Applicant before: JINGDONG DIGITAL TECHNOLOGY HOLDINGS Co.,Ltd.