CN112559331A - Test method and device - Google Patents

Test method and device Download PDF

Info

Publication number
CN112559331A
CN112559331A CN202011433069.5A CN202011433069A CN112559331A CN 112559331 A CN112559331 A CN 112559331A CN 202011433069 A CN202011433069 A CN 202011433069A CN 112559331 A CN112559331 A CN 112559331A
Authority
CN
China
Prior art keywords
tested
page
content
data content
data
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
CN202011433069.5A
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 CN202011433069.5A priority Critical patent/CN112559331A/en
Publication of CN112559331A publication Critical patent/CN112559331A/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

Landscapes

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

Abstract

The application provides a test method and a test device, which relate to the technical field of communication and comprise the following steps: automatically testing the page to be tested by using an automatic testing tool to obtain data content; and comparing the data content with the expected content of the page to be tested to obtain a test result. Therefore, the intellectualization of the test process can be realized, the labor cost is saved, and the test efficiency is improved.

Description

Test method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a test method and apparatus.
Background
The system test may be used to check whether the data content in the system matches the expected data content, thereby ensuring proper operation of the system. The system test is also a very important and complex work in the life cycle of the system, and has a very important significance for ensuring the reliability of the system.
In general, the system needs to be tested manually, and the testing processes such as data selection, data export, data comparison and the like are completed manually by workers. For example, in the process of testing asset-backed securities (ABS) and its corresponding subsystems, data summarization needs to be performed on multiple data pages of each subsystem in the ABS system, and each iteration and each reconstruction in the testing process needs to be manually performed with a large number of repeated tests.
However, the manual testing method has a large workload, and errors are easily generated in the testing process, so that the manual testing efficiency is low, and the correctness of the testing result is difficult to ensure.
Disclosure of Invention
The embodiment of the application provides a testing method and a testing device, and aims to solve the problems that in the prior art, the workload of manual testing is large, errors are easy to occur in the testing process, the manual testing efficiency is low, and the correctness of a testing result is difficult to guarantee.
In a first aspect, an embodiment of the present application provides a testing method, including: automatically testing the page to be tested by using an automatic testing tool to obtain data content; and comparing the data content with the expected content of the page to be tested to obtain a test result.
Optionally, the automatically testing the page to be tested to obtain the data content includes: when the target control does not exist in the page to be tested; converting the page to be tested into a first picture; acquiring one or more character areas in the first picture; identifying a target character area to obtain the data content; the target text area is a text area in the one or more text areas; the comparing the data content with the expected content of the page to be tested to obtain a test result includes: and comparing the data content with the first expected content of the target character area to obtain the test result.
Optionally, the method further includes: and when the identification of the target control does not exist in the page to be tested, determining that the target control does not exist in the page to be tested.
Optionally, the comparing the data content with the first expected content of the target text area includes: copying the data content into a table; storing the table in a designated folder; acquiring first expected content of the target character area; storing the first desired content in the designated folder in tabular form; comparing the data content and the first desired content based on the table and the first desired content in table form.
Optionally, the number of the data contents is plural, and the comparing the data contents and the first desired contents based on the table and the first desired contents in the form of the table includes: the traversal compares the data content in the table with the first desired content in the table form.
Optionally, the identifying the target text area to obtain the data content includes: identifying a boundary of each of the text regions; identifying the data content within the boundaries of the target text region.
Optionally, the automatically testing the page to be tested to obtain the data content includes: when the target control exists in the page to be tested, acquiring an event corresponding to the target control; automatically executing the event to obtain the data content generated by the event; and comparing the data content generated by the event with the second expected content of the event to obtain the test result.
Optionally, the method further includes: and when the identification of the target control exists in the page to be tested, determining that the target control exists in the page to be tested.
Optionally, the obtaining an event corresponding to the target control includes: and acquiring the event from the configuration file of the target control.
Optionally, the comparing the data content generated by the event with the second expected content of the event includes: copying the data content generated by the event to a designated folder; acquiring second expected content corresponding to the event; storing the second desired content in the designated folder; comparing the event-generated data content and the second desired content in the designated folder.
Optionally, the target control is a derivation control for deriving data in the page to be tested; the events include: inquiring and exporting data according to the search condition; the automatically executing the event to obtain the data content generated by the event comprises the following steps: and automatically inputting the search condition in the page to be tested, inquiring data according to the search condition and exporting the data content.
Optionally, before the page to be tested is automatically tested by using the automatic testing tool, the method further includes: starting the automatic test tool; logging in a system to be tested by using the automatic testing tool; and opening the page to be tested by utilizing the automatic testing tool.
In a second aspect, an embodiment of the present application provides a testing apparatus, including: the device comprises a processing module and a comparison module; the processing module is used for automatically testing the page to be tested by using an automatic testing tool to obtain data content; and the comparison module is used for comparing the data content with the expected content of the page to be tested to obtain a test result.
Optionally, the processing module is specifically configured to convert the page to be tested into a first picture when it is determined that the target control does not exist in the page to be tested; acquiring one or more character areas in the first picture; identifying a target character area to obtain the data content; the target text area is a text area in the one or more text areas; the comparison module is specifically configured to compare the data content with a first expected content of the target text area to obtain the test result.
Optionally, the processing module is further configured to determine that the target control does not exist in the page to be tested when the identifier of the target control does not exist in the page to be tested.
Optionally, the processing module is specifically configured to copy the data content to a table; storing the table in a designated folder; acquiring first expected content of the target character area; storing the first desired content in the designated folder in tabular form; the comparison module is specifically configured to compare the data content with the first desired content based on the table and the first desired content in the table form.
Optionally, the number of the data contents is multiple, and the comparing module is specifically configured to traverse and compare the data contents in the table with the first desired content in the table form.
Optionally, the processing module is specifically configured to identify a boundary of each text region; identifying the data content within the boundaries of the target text region.
Optionally, the processing module is specifically configured to, when it is determined that the target control exists in the page to be tested, obtain an event corresponding to the target control; automatically executing the event to obtain the data content generated by the event; the processing module is specifically configured to compare the data content generated by the event with a second expected content of the event, so as to obtain the test result.
Optionally, the processing module is further configured to determine that a target control exists in the page to be tested when the identifier of the target control exists in the page to be tested.
Optionally, the processing module is specifically configured to obtain the event from the configuration file of the target control.
Optionally, the processing module is specifically configured to copy the data content generated by the event to a specified folder; acquiring second expected content corresponding to the event; storing the second desired content in the designated folder; the comparison module is specifically configured to compare the data content generated by the event with the second expected content in the designated folder.
Optionally, the target control is a derivation control for deriving data in the page to be tested; the events include: inquiring and exporting data according to the search condition; the processing module is specifically configured to automatically input the search condition in the page to be tested, query data according to the search condition, and export the data content.
Optionally, the processing module is further configured to start an automatic testing tool; logging in a system to be tested by using the automatic testing tool; and opening the page to be tested by utilizing the automatic testing tool.
In a third aspect, an embodiment of the present application provides an electronic device, including: at least one processor and memory; the memory stores computer-executable instructions; the at least one processor executes computer-executable instructions stored by the memory, causing the at least one processor to perform a test method as provided by the first aspect.
In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, where computer-executable instructions are stored, and when a processor executes the computer-executable instructions, the test method provided in the first aspect is implemented.
The embodiment of the application provides a testing method, which can automatically test a page to be tested by using an automatic testing tool to obtain data content; the data content is compared with the expected content of the page to be tested, and a test result can be obtained. The intelligent testing method can simulate a manual testing process, releases testing personnel from fussy execution work, reduces labor cost, has higher automation degree, and can obviously improve testing efficiency.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic flowchart of a testing method according to an embodiment of the present disclosure;
fig. 2 is a first schematic view of a test interface provided in an embodiment of the present application;
fig. 3 is a schematic view of a test interface provided in the embodiment of the present application;
fig. 4 is a schematic diagram of a test interface provided in the embodiment of the present application;
fig. 5 is a schematic diagram of a test interface provided in the embodiment of the present application;
FIG. 6 is a schematic diagram of a testing workflow provided in an embodiment of the present application;
FIG. 7 is a schematic structural diagram of a testing apparatus according to an embodiment of the present disclosure;
fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
With the foregoing drawings in mind, certain embodiments of the disclosure have been shown and described in more detail below. These drawings and written description are not intended to limit the scope of the disclosed concepts in any way, but rather to illustrate the concepts of the disclosure to those skilled in the art by reference to specific embodiments.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, 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 some 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.
In the manual testing process, special workers are often required to test the data of each page in the system for multiple times, and the data is downloaded, summarized and compared to obtain a test result finally. Therefore, a large amount of labor cost is often consumed in a complicated test process, and the manual test may be influenced by individual factors, so that the condition of misoperation occurs in the test process, and the efficiency of the manual test is difficult to guarantee.
Based on the problems in the prior art, the embodiment of the application provides a test method, and the overall concept of the embodiment of the application is as follows: the page to be tested can be automatically tested by using an automatic testing tool to obtain the data content on the test page, and the test data is compared with expected data in the database to further obtain a test result. Specifically, an automatic testing tool is used for automatically testing a page to be tested to obtain data content; and comparing the data content with the expected content of the page to be tested to obtain a test result. In conclusion, the intellectualization of the test process can be realized, the data to be tested in the page are automatically extracted and compared with the real data to obtain the test result, the automation degree of the test process is improved, the labor cost can be saved, and the test efficiency can be obviously improved.
The technical solution of the present application will be described in detail by specific examples. It should be noted that the following specific embodiments may be combined with each other, and the same or similar concepts or processes may not be described in detail in some embodiments. Embodiments of the present application will be described below with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a testing method according to an embodiment of the present disclosure. As shown in fig. 1, the test method may include the steps of:
s101, automatically testing the page to be tested by using an automatic testing tool to obtain data content.
In this embodiment of the present application, the automatic test tool may be a tool (or a data packet) for implementing a test method provided in this embodiment of the present application. The data content may include data such as text or numbers in the page to be tested.
S102, comparing the data content with the expected content of the page to be tested to obtain a test result.
In the embodiment of the application, the expected content of the page to be tested can be the content existing in the expected page or can be understood as the correct content in the page. For example, the desired content may be retrieved from a database according to preset business logic and/or search criteria. The business logic can be understood as an operation logic between data.
For example, comparing the data content with the expected content of the page to be tested to obtain the test result may be implemented by obtaining the test result according to a comparison algorithm based on a logarithmic logic, a preset mathematical model, or a neural network model. It can be understood that the method for comparing the data content with the expected content of the page to be tested to obtain the test result may include other content according to the actual scenario, which is not limited in the embodiment of the present application.
The embodiment of the application provides a testing method, which can automatically execute the testing method through an automatic testing tool and finally output a testing result, the intelligent testing method can simulate a manual testing process, testers are liberated from fussy execution work, the labor cost is reduced, the automation degree of the testing method is high, and the testing efficiency can be obviously improved.
On the basis of the above embodiment, S101 may be implemented by:
s1011, when the target control does not exist in the page to be tested, converting the page to be tested into a first picture.
Illustratively, the target control may implement functions such as clicking or generating data (e.g., jumping or the like). For example, when the control is tested, a person can click the control to test whether to jump normally, or when the target control can be used for exporting the control of the data to be tested in the page to be tested, the absence of the target control in the page can be understood as that the process of clicking the target control to export the data in the manual test cannot be simulated.
For example, fig. 2 is a schematic view of a first test interface provided in an embodiment of the present application, as shown in fig. 2, the interface may be a first picture converted from a page to be tested, and the interface may include one or more of the following items, for example: text, numbers, symbols, or icons.
S1012, one or more character areas in the first picture are obtained.
Fig. 3 is a schematic view of a second test interface provided in the embodiment of the present application, and as shown in fig. 3, a text area in a picture, such as text areas of a special plan, asset management, and asset pool details in a menu list 301, text areas of a special plan number, a loan order number, a search, and a reset in a data list 302, or other text areas, is obtained. Wherein the text area may include numbers therein.
And S1013, identifying the target character area to obtain data content.
In the embodiment of the application, the target text area is a text area in one or more text areas.
For example, fig. 4 is a schematic view of a third test interface provided in the embodiment of the present application, as shown in fig. 4, data content (e.g., the area 401 in fig. 4) that can be further screened out in the text area obtained in the step shown in S1012 may include characters and numbers.
S1014, comparing the data content with the first expected content of the target character area to obtain a test result.
In this embodiment of the application, the process of comparing the data content with the first expected content of the target text area to obtain the test result may be the same as the process of comparing the data content with the expected content of the page to be tested in the above S102, and the method of obtaining the test result is not described herein again.
The embodiment of the application provides a testing method, under the condition that no control exists, the computer vision technology can be utilized to automatically convert a page without the control into a picture, data in the picture is extracted and compared with expected data, and a testing result is finally output.
On the basis of the above embodiment, the method further includes: and when the identification of the target control does not exist in the page to be tested, determining that the target control does not exist in the page to be tested.
For example, a possible implementation of determining that the target control does not exist in the page to be tested is that the target control does not exist in the test page can be determined through an identifier of the target control, for example, an identifier such as a character, a character string, a numerical value, and the like can be set for the target control during system development, and then whether the target control exists in the page can be determined according to the identifier. For example, a value may be set in the configuration file for other information such as an identity number (ID) or a name of the target control. In the determination, it may be determined that the target control does not exist in the page to be tested according to the fact that the numerical value corresponding to the target control does not exist in the page to be tested (or it may be understood that, in the determination, an erroneous numerical value different from the numerical value corresponding to the target control is returned).
Another possible implementation of determining that the target control does not exist in the page to be tested is to determine that the target control does not exist in the test page by a preset condition, such as a keyword. For example, the page may be searched for a control corresponding to a keyword such as "export" or "export data", and it may be determined that the target control does not exist in the page.
It can be understood that the method for determining that the target control does not exist in the page may include other contents according to an actual scene, which is not limited in this embodiment of the application.
On the basis of the above embodiment, S1014 may be implemented by:
s10141, copying the data content into the table.
S10142, storing the table in the designated folder.
S10143, acquiring the first expected content of the target character area.
S10144, storing the first desired content in a specified folder in a table form.
S10145, comparing the data content with the first desired content based on the table and the first desired content in the table form.
In the embodiment of the application, naming rules can be set for the table where the created first expected content is located and the table where the data content is located, the first expected content is obtained through data content matching according to the naming rules of the tables, and then the data content and the first expected content are compared.
The embodiment of the application provides a testing method, which can realize the intellectualization of the steps shown in S10141-S10145, avoid the manual execution of the complicated testing process, save the labor cost and further improve the testing efficiency.
On the basis of the above embodiment, where the number of data contents is plural, S10145 may include: the traversal compares the data content in the table with the first desired content in table form.
In the embodiment of the present application, when there are a plurality of target text areas, correspondingly, the number of data contents may also be a plurality. It is understood that the target text area and the data content may be in a one-to-one correspondence.
Traversing and comparing the data content in the table and the first expected content in the table form, can be understood as respectively comparing each data content in the plurality of data contents with each data content in the plurality of first expected contents, and obtaining a test result after each group of data contents is compared.
On the basis of the above embodiment, S1013 may include: identifying the boundary of each text region; data content is identified within the boundaries of the target text region.
In the embodiment of the application, the data content in the text area can be identified based on computer vision technology or technical methods such as corrosion and expansion in image processing. Therefore, the intellectualization of the test process can be realized, the labor cost can be saved, and the test efficiency can be obviously improved.
On the basis of the above embodiment, S101 includes:
s501, when the target control exists in the page to be tested, obtaining an event corresponding to the target control.
Fig. 5 is a schematic diagram of a fourth test interface provided in the embodiment of the present application, as shown in fig. 5, the interface includes an export control 505, and the export control 505 may be a target control in the page to be tested. The method for determining that the target control exists in the page to be tested is similar to the method for determining that the target control does not exist in the page to be tested in the step shown in S101, for example: the target control can be determined to exist in the page by the method of identification of the target control, or keywords, and the specific determination process is not repeated.
Illustratively, as shown in FIG. 5, the export control 505 corresponds to an event that may correspond to exporting data (e.g., data outlined by dashed box 506).
And S502, automatically executing the event to obtain the data content generated by the event.
S503, comparing the data content generated by the event with the second expected content of the event to obtain a test result.
In the embodiment of the present application, the data content generated by the event is compared with the second expected content of the event, and the obtained test result is compared with the data content and the expected content of the page to be tested in the above S102, and the method for obtaining the test result is the same, and is not described herein again.
The embodiment of the application provides a test method, which can obtain corresponding data content through a target control in a page, and compare the corresponding data content with corresponding expected content to obtain a test result. The method can simulate the manual testing process, can realize the intellectualization of the testing process, can save the labor cost and can obviously improve the testing efficiency.
On the basis of the above embodiment, the method further includes: and when the identification of the target control exists in the page to be tested, determining that the target control exists in the page to be tested.
In the embodiment of the application, when the identifier of the target control exists in the page to be tested, the method for determining that the target control exists in the page to be tested is similar to the method for determining that the target control does not exist in the page to be tested when the identifier of the target control does not exist in the page to be tested, and details are not repeated here.
On the basis of the above embodiment, S501 may include: and acquiring the event from the configuration file of the target control.
On the basis of the above embodiment, S503 may be implemented by the following steps:
s5031, copying the data content generated by the event to a designated folder.
S5032, acquiring a second expected content corresponding to the event.
S5033, storing the second desired content in the designated folder.
S5034, comparing the data content generated by the event with the second desired content in the designated folder.
The embodiment of the application provides a testing method, which can realize automation of the steps shown in S5031 to S5034, avoid the complicated testing process from being executed manually, save labor cost and further improve testing efficiency.
On the basis of the embodiment, the target control is a exporting control used for exporting data in the page to be tested; the events include: inquiring and exporting data according to the search condition; s502 may include: and automatically inputting search conditions in the page to be tested, inquiring data according to the search conditions and exporting data contents.
In the embodiment of the present application, the search condition may be a search date set by the user, for example, data content in the past year or the past month is searched; alternatively, the search condition may be a data type that the user wants to search, for example, data content of a type such as a payment data or a refund data is searched; alternatively, the search condition may be a default search mode of global search, for example, when the user does not set the search condition, all data in the test page may be searched. It is understood that the search condition may include other contents according to an actual scenario, which is not limited in the embodiment of the present application.
On the basis of the above embodiment, before S101, the method further includes: starting an automatic test tool; logging in a system to be tested by using an automatic testing tool; and opening the page to be tested by utilizing an automatic testing tool. The automatic test tool is a program for implementing the test method provided by the embodiment of the application.
The embodiment of the application provides a testing method, which can simulate a manual testing process, realize the intellectualization of the testing process, improve the automation degree of the testing process, save the labor cost and obviously improve the testing efficiency.
Based on the content described in the foregoing embodiments, for better understanding of the embodiments of the present application, referring to fig. 6, fig. 6 is a schematic diagram of a testing workflow provided in the embodiments of the present application, and as shown in fig. 6, the testing workflow may include the following steps:
s601, starting an automation program.
The automated program (or referred to as an automatic test tool) may be a program for implementing the test method provided by the embodiment of the present application.
And S602, automatically opening a login page and logging in.
And S603, entering a system to be verified, and opening a page to be verified.
And S604, automatically inputting search conditions and inquiring data.
And S605, simulating the process of manually exporting data, and exporting the test result to a specified folder.
S606, inquiring the background database according to the search condition, obtaining the expected result, and storing the expected result in the appointed folder.
And S607, automatically traversing the test result and the expected result, automatically comparing the test result with the expected result to obtain a comparison result, and outputting the result to the specified folder.
And S608, generating a test report according to the comparison result.
The embodiment of the application provides a testing method, which can simulate a manual testing process, realize the intellectualization of the testing process shown in the steps S601-S608, improve the automation degree of the testing process, save the labor cost and obviously improve the testing efficiency.
It is understood that the embodiments are described in detail in conjunction with the flowcharts and interface diagrams, but it is understood that the flowcharts and interface diagrams, and the corresponding embodiments of the flowcharts and interface diagrams, are only illustrative for ease of understanding, and should not be construed as limiting the present application in any way. It is not necessary that each step in the flowcharts be performed, and some steps may be skipped, for example. In addition, the execution sequence of each step is not fixed or limited to that shown in the figures, and the execution sequence of each step should be determined by the function and the inherent logic of each step.
The multiple embodiments described in this application can be executed in any combination or in an intersection of steps, the execution order of each embodiment and the execution order of the steps of each embodiment are not fixed and are not limited to the order shown in the drawings, and the execution order of each embodiment and the intersection of the execution order of each step of each embodiment should be determined by their functions and inherent logic.
The method of the embodiment of the present application is explained above, and the test apparatus for performing the method provided by the embodiment of the present application is described below. Those skilled in the art will appreciate that the method and apparatus can be combined and referred to, and that the test apparatus provided in the embodiments of the present application can perform the steps performed by the test method described above.
Fig. 7 is a schematic structural diagram of a testing apparatus according to an embodiment of the present application. As shown in fig. 7, the apparatus may include a processing module 701 and a comparing module 702.
The processing module is used for automatically testing the page to be tested by utilizing an automatic testing tool to obtain data content;
and the comparison module is used for comparing the data content with the expected content of the page to be tested to obtain a test result.
Optionally, the processing module 701 is specifically configured to, when it is determined that the target control does not exist in the page to be tested, convert the page to be tested into a first picture; acquiring one or more character areas in a first picture; identifying a target character area to obtain data content; the target character area is a character area in one or more character areas; the comparing module 702 is specifically configured to compare the data content with the first expected content of the target text area to obtain a test result.
Optionally, the processing module 701 is further configured to determine that the target control does not exist in the page to be tested when the identifier of the target control does not exist in the page to be tested.
Optionally, the processing module 701 is specifically configured to copy the data content into a table; storing the table in a designated folder; acquiring first expected content of a target character area; storing the first desired content in a specified folder in tabular form; the comparing module 702 is specifically configured to compare the data content with the first desired content based on the table and the first desired content in table form.
Optionally, the number of the data contents is multiple, and the comparing module 702 is specifically configured to traverse and compare the data contents in the table with the first desired content in the table.
Optionally, the processing module 701 is specifically configured to identify a boundary of each text region; data content is identified within the boundaries of the target text region.
Optionally, the processing module 701 is specifically configured to, when it is determined that a target control exists in the page to be tested, obtain an event corresponding to the target control; automatically executing the event to obtain the data content generated by the event; the comparing module 702 is specifically configured to compare the data content generated by the event with the second expected content of the event, so as to obtain a test result.
Optionally, the processing module 701 is further configured to determine that the target control exists in the page to be tested when the identifier of the target control exists in the page to be tested.
Optionally, the processing module 702 is specifically configured to obtain an event from a configuration file of the target control.
Optionally, the processing module 701 is specifically configured to copy data content generated by the event to a specified folder; acquiring second expected content corresponding to the event; a comparing module 702, specifically configured to store the second desired content in the designated folder; the data content resulting from the event is compared to the second desired content in the designated folder.
Optionally, the target control is a derivation control for deriving data in the page to be tested; the events include: inquiring and exporting data according to the search condition; the processing module 701 is specifically configured to automatically input a search condition in a page to be tested, query data according to the search condition, and derive data content.
Optionally, the processing module 701 is further configured to start an automatic test tool; logging in a system to be tested by using an automatic testing tool; and opening the page to be tested by utilizing an automatic testing tool.
In this embodiment, the processing module 701 in the testing apparatus is used to execute the processing steps in the testing method; the comparison module 702 is used to perform the comparison steps in the test method.
The test apparatus provided in any of the above embodiments may be used to implement the schemes in the above embodiments, and the implementation principle and the technical effect are similar, which are not described herein again.
It should be noted that the division of the modules of the above apparatus is only a logical division, and the actual implementation may be wholly or partially integrated into one physical entity, or may be physically separated. And these modules can be realized in the form of software called by processing element; or may be implemented entirely in hardware; and part of the modules can be realized in the form of calling software by the processing element, and part of the modules can be realized in the form of hardware. For example, the processing module may be a separate processing element, or may be integrated into a chip of the apparatus, or may be stored in a memory of the apparatus in the form of program code, and a processing element of the apparatus calls and executes the functions of the above determination module. Other modules are implemented similarly. In addition, all or part of the modules can be integrated together or can be independently realized. The processing element here may be an integrated circuit with signal processing capabilities. In implementation, each step of the above method or each module above may be implemented by an integrated logic circuit of hardware in a processor element or an instruction in the form of software.
For example, the above modules may be one or more integrated circuits configured to implement the above methods, such as: one or more Application Specific Integrated Circuits (ASICs), or one or more microprocessors (DSPs), or one or more Field Programmable Gate Arrays (FPGAs), among others. For another example, when some of the above modules are implemented in the form of a processing element scheduler code, the processing element may be a general-purpose processor, such as a Central Processing Unit (CPU) or other processor that can call program code. As another example, these modules may be integrated together, implemented in the form of a system-on-a-chip (SOC).
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the present application are all or partially generated when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy disk, hard disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
Fig. 8 is a schematic structural diagram of an electronic device according to an embodiment of the present application. As shown in fig. 8, the apparatus may include: a processor 801 and a memory 802.
The processor 801 executes computer-executable instructions stored in the memory, causing the processor 801 to perform the aspects of the embodiments described above.
The processor 801 may be a general-purpose processor including a central processing unit CPU, a Network Processor (NP), and the like; but also a digital signal processor DSP, an application specific integrated circuit ASIC, a field programmable gate array FPGA or other programmable logic device, discrete gate or transistor logic, discrete hardware components.
The memory 802 stores computer-executable instructions, which may include Random Access Memory (RAM) and may also include non-volatile memory (non-volatile memory), such as at least one disk memory. Optionally, the apparatus may further include: a system bus 803, and the memory 802 may be coupled to the processor 801 via the system bus 803 and communicate with each other.
The system bus 803 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The system bus may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The embodiment of the present application further provides a computer-readable storage medium, in which computer instructions are stored, and when the computer instructions are run on a computer, the computer is caused to execute the scheme of the foregoing embodiment.
The embodiment of the application also provides a chip for running the instructions, and the chip is used for executing the scheme in the embodiment.
Embodiments of the present application also provide a computer program product, which includes a computer program stored in a computer-readable storage medium, where the computer program can be read by at least one processor from the computer-readable storage medium, and the at least one processor can implement the solutions in the above embodiments when executing the computer program.
Finally, it should be noted that: the above embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some or all of the technical features may be equivalently replaced; and the modifications or the substitutions do not make the essence of the corresponding technical solutions depart from the scope of the technical solutions of the embodiments of the present application.

Claims (15)

1. A method of testing, comprising:
automatically testing the page to be tested by using an automatic testing tool to obtain data content;
and comparing the data content with the expected content of the page to be tested to obtain a test result.
2. The method of claim 1, wherein automatically testing the page to be tested for data content comprises:
when it is determined that the target control does not exist in the page to be tested, converting the page to be tested into a first picture;
acquiring one or more character areas in the first picture;
identifying a target character area to obtain the data content; the target text area is a text area in the one or more text areas;
the comparing the data content with the expected content of the page to be tested to obtain a test result includes:
and comparing the data content with the first expected content of the target character area to obtain the test result.
3. The method of claim 2, further comprising:
and when the identification of the target control does not exist in the page to be tested, determining that the target control does not exist in the page to be tested.
4. The method of claim 2, wherein comparing the data content to a first desired content of the target text region comprises:
copying the data content into a table;
storing the table in a designated folder;
acquiring first expected content of the target character area;
storing the first desired content in the designated folder in tabular form;
comparing the data content and the first desired content based on the table and the first desired content in table form.
5. The method of claim 4, wherein the number of the data contents is plural, and wherein the comparing the data contents and the first desired contents based on the table and the first desired contents in the form of the table comprises:
the traversal compares the data content in the table with the first desired content in the table form.
6. The method of claim 2, wherein the identifying the target text region to obtain the data content comprises:
identifying a boundary of each of the text regions;
identifying the data content within the boundaries of the target text region.
7. The method according to any one of claims 1-6, wherein said automatically testing the page to be tested for data content comprises:
when the target control exists in the page to be tested, acquiring an event corresponding to the target control;
automatically executing the event to obtain the data content generated by the event;
and comparing the data content generated by the event with the second expected content of the event to obtain the test result.
8. The method of claim 7, further comprising:
and when the identification of the target control exists in the page to be tested, determining that the target control exists in the page to be tested.
9. The method of claim 7, wherein the obtaining the event corresponding to the target control comprises:
and acquiring the event from the configuration file of the target control.
10. The method of claim 7, wherein comparing the data content generated by the event with a second desired content of the event comprises:
copying the data content generated by the event to a designated folder;
acquiring second expected content corresponding to the event;
storing the second desired content in the designated folder;
comparing the event-generated data content and the second desired content in the designated folder.
11. The method of claim 7, wherein the target control is an export control for exporting data in the page to be tested; the events include: inquiring and exporting data according to the search condition;
the automatically executing the event to obtain the data content generated by the event comprises the following steps:
and automatically inputting the search condition in the page to be tested, inquiring data according to the search condition and exporting the data content.
12. The method of claim 1, wherein before automatically testing the page to be tested with the automatic testing tool, the method further comprises:
starting the automatic test tool;
logging in a system to be tested by using the automatic testing tool;
and opening the page to be tested by utilizing the automatic testing tool.
13. A test apparatus, comprising: the device comprises a processing module and a comparison module;
the processing module is used for automatically testing the page to be tested by using an automatic testing tool to obtain data content;
and the comparison module is used for comparing the data content with the expected content of the page to be tested to obtain a test result.
14. An electronic device, comprising:
a memory for storing program instructions;
a processor for invoking and executing program instructions in said memory for performing the method of any of claims 1-12.
15. A computer-readable storage medium, characterized in that the storage medium stores a computer program which, when executed by a processor, implements the method according to any one of claims 1-12.
CN202011433069.5A 2020-12-10 2020-12-10 Test method and device Pending CN112559331A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011433069.5A CN112559331A (en) 2020-12-10 2020-12-10 Test method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011433069.5A CN112559331A (en) 2020-12-10 2020-12-10 Test method and device

Publications (1)

Publication Number Publication Date
CN112559331A true CN112559331A (en) 2021-03-26

Family

ID=75060213

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011433069.5A Pending CN112559331A (en) 2020-12-10 2020-12-10 Test method and device

Country Status (1)

Country Link
CN (1) CN112559331A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113918468A (en) * 2021-10-29 2022-01-11 平安普惠企业管理有限公司 Test method and related device for reconstruction system

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109815156A (en) * 2019-02-28 2019-05-28 北京百度网讯科技有限公司 Displaying test method, device, equipment and the storage medium of visual element in the page
CN109901968A (en) * 2019-01-31 2019-06-18 阿里巴巴集团控股有限公司 A kind of automation page data method of calibration and device
CN110704304A (en) * 2019-09-06 2020-01-17 平安普惠企业管理有限公司 Application program testing method and device, storage medium and server
CN110764998A (en) * 2019-09-06 2020-02-07 平安健康保险股份有限公司 Data comparison method, device and equipment based on Django framework and storage medium
CN111026645A (en) * 2019-11-20 2020-04-17 航天信息股份有限公司 User interface automatic testing method and device, storage medium and electronic equipment
CN111104315A (en) * 2019-11-29 2020-05-05 京东数字科技控股有限公司 Test script generation method and device and computer readable storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109901968A (en) * 2019-01-31 2019-06-18 阿里巴巴集团控股有限公司 A kind of automation page data method of calibration and device
CN109815156A (en) * 2019-02-28 2019-05-28 北京百度网讯科技有限公司 Displaying test method, device, equipment and the storage medium of visual element in the page
CN110704304A (en) * 2019-09-06 2020-01-17 平安普惠企业管理有限公司 Application program testing method and device, storage medium and server
CN110764998A (en) * 2019-09-06 2020-02-07 平安健康保险股份有限公司 Data comparison method, device and equipment based on Django framework and storage medium
CN111026645A (en) * 2019-11-20 2020-04-17 航天信息股份有限公司 User interface automatic testing method and device, storage medium and electronic equipment
CN111104315A (en) * 2019-11-29 2020-05-05 京东数字科技控股有限公司 Test script generation method and device and computer readable storage medium

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113918468A (en) * 2021-10-29 2022-01-11 平安普惠企业管理有限公司 Test method and related device for reconstruction system

Similar Documents

Publication Publication Date Title
CN111506498A (en) Automatic generation method and device of test case, computer equipment and storage medium
CN109062780B (en) Development method of automatic test case and terminal equipment
CN109783346B (en) Keyword-driven automatic testing method and device and terminal equipment
CN111061733B (en) Data processing method, device, electronic equipment and computer readable storage medium
CN108460068B (en) Method, device, storage medium and terminal for importing and exporting report
CN115080398A (en) Automatic interface test system and method
CN114116496A (en) Automatic testing method, device, equipment and medium
CN109800147B (en) Test case generation method and terminal equipment
CN111124872A (en) Branch detection method and device based on difference code analysis and storage medium
CN110688111A (en) Configuration method, device, server and storage medium of business process
CN111475494A (en) Mass data processing method, system, terminal and storage medium
CN115827436A (en) Data processing method, device, equipment and storage medium
CN113220597B (en) Test method, test device, electronic equipment and storage medium
US11715037B2 (en) Validation of AI models using holdout sets
CN112559331A (en) Test method and device
CN112631920A (en) Test method, test device, electronic equipment and readable storage medium
CN112650673A (en) Method and device for creating test case in transaction tracking system and electronic equipment
JP2013077124A (en) Software test case generation device
CN113704123B (en) Interface testing method, device, equipment and storage medium
CN116383883B (en) Big data-based data management authority processing method and system
CN110750569A (en) Data extraction method, device, equipment and storage medium
CN117130946B (en) Test scene generation method and device, electronic equipment and readable storage medium
CN117573561B (en) Automatic test system, method, electronic equipment and storage medium
CN116010349B (en) Metadata-based data checking method and device, electronic equipment and storage medium
CN118132448B (en) Test case processing method, device, computer equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
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, Beijing Economic and Technological Development Zone, 100176

Applicant before: Jingdong Digital Technology Holding Co., Ltd

CB02 Change of applicant information