CN114996122A - Automatic testing method and device, electronic equipment and storage medium - Google Patents

Automatic testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN114996122A
CN114996122A CN202210451869.2A CN202210451869A CN114996122A CN 114996122 A CN114996122 A CN 114996122A CN 202210451869 A CN202210451869 A CN 202210451869A CN 114996122 A CN114996122 A CN 114996122A
Authority
CN
China
Prior art keywords
resource
target
page
information
tested
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
CN202210451869.2A
Other languages
Chinese (zh)
Inventor
朴金学
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Dajia Internet Information Technology Co Ltd
Original Assignee
Beijing Dajia Internet Information Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Dajia Internet Information Technology Co Ltd filed Critical Beijing Dajia Internet Information Technology Co Ltd
Priority to CN202210451869.2A priority Critical patent/CN114996122A/en
Publication of CN114996122A publication Critical patent/CN114996122A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/50Information retrieval; Database structures therefor; File system structures therefor of still image data
    • G06F16/58Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually
    • G06F16/583Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually using metadata automatically derived from the content
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/907Retrieval characterised by using metadata, e.g. metadata not derived from the content or metadata generated manually

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Library & Information Science (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The present disclosure relates to an automated testing method, an automated testing apparatus, an electronic device, and a storage medium, wherein the method comprises: acquiring resource information of a reference resource corresponding to a page to be tested based on a page identifier of the page to be tested; performing resource search in a target page area of the page to be tested to obtain a resource search result; the target page area is a page area corresponding to the reference position information in the page to be tested; under the condition that the resource searching result indicates that the target resource is searched in the target page area, performing resource matching on the target resource and the reference resource to obtain a resource matching result; the target resource is at least one resource in the resources to be tested; and determining a resource test result of the resource to be tested based on the resource matching result. The resource testing method and the resource testing device can improve the efficiency of resource testing and improve the accuracy of the resource testing result.

Description

Automatic testing method and device, electronic equipment and storage medium
Technical Field
The present disclosure relates to the field of automated testing technologies, and in particular, to an automated testing method and apparatus, an electronic device, and a storage medium.
Background
Various display resources are distributed in application software, but a test scheme aiming at the display resources is always scarce. In the related art, a method of manually matching whether a preset display resource is consistent with an actual display resource in application software is generally adopted to test the display resource in the application software. The testing of the display resources is carried out in a manual matching mode, so that the testing efficiency of the display resources is low, and the testing result of the display resources is inaccurate.
Disclosure of Invention
The present disclosure provides an automated testing method, an automated testing device, an electronic apparatus, and a storage medium, so as to at least solve the problems of low testing efficiency and inaccurate testing result for display resources in the related art. The technical scheme of the disclosure is as follows:
according to a first aspect of the embodiments of the present disclosure, an automated testing method is provided, which includes:
acquiring resource information of a reference resource corresponding to a page to be tested based on a page identifier of the page to be tested; the resource information comprises reference position information of the reference resource, and the page to be tested comprises the resource to be tested;
performing resource search in a target page area of the page to be tested to obtain a resource search result; the target page area is a page area corresponding to the reference position information in the page to be tested;
under the condition that the resource searching result indicates that the target resource is searched in the target page area, performing resource matching on the target resource and the reference resource to obtain a resource matching result; the target resource is at least one resource in the resources to be tested;
and determining a resource test result of the resource to be tested based on the resource matching result.
In an exemplary embodiment, the reference position information is page coordinate information;
the resource searching is carried out in the target page area of the page to be tested to obtain a resource searching result, and the resource searching result comprises the following steps:
determining the target page area corresponding to the page coordinate information in the page to be tested;
and searching resources in the target page area to obtain the resource searching result.
In an exemplary embodiment, the reference position information is an area unit identifier, and the page to be tested includes at least one area unit;
the resource searching is carried out in the target page area of the page to be tested to obtain a resource searching result, and the resource searching result comprises the following steps:
determining a target area unit corresponding to the area unit identification in the page to be tested, and determining the target area unit as the target page area;
and searching resources in the target page area to obtain the resource searching result.
In an exemplary embodiment, the resource information further includes resource identification information of the reference resource, and resource version information of the reference resource;
the resource matching of the target resource and the reference resource to obtain a resource matching result includes:
acquiring resource identification information of the target resource and resource version information of the target resource;
performing information matching on the resource identification information of the target resource and the resource identification information of the reference resource to obtain a first matching result;
performing information matching on the resource version information of the target resource and the resource version information of the reference resource to obtain a second matching result;
and obtaining the resource matching result based on the first matching result and the second matching result.
In an exemplary embodiment, the resource information further includes resource presentation information of the reference resource;
the resource matching of the target resource and the reference resource to obtain a resource matching result includes:
acquiring resource display information of the target resource;
performing information matching on the resource display information of the target resource and the resource display information of the reference resource to obtain a third matching result;
and obtaining the resource matching result based on the third matching result.
In an exemplary embodiment, the resource presentation information of the reference resource includes a reference resource image, and a reference resource image size;
the information matching is performed between the resource display information based on the target resource and the resource display information of the reference resource to obtain a third matching result, and the third matching result includes:
acquiring a target resource image corresponding to a target resource from the target page area; the image size of the target resource image is the reference resource image size;
performing image matching on the target resource image and the reference resource image to obtain an image matching result;
determining the third matching result based on the image matching result.
In an exemplary embodiment, the reference asset image size comprises a presentation length and a presentation height of the reference asset;
the acquiring a target resource image corresponding to a target resource from the target page area includes:
determining a target presentation area in the target page area; the length of the target display area is the display length, and the height of the target display area is the display height;
and carrying out image interception on the image in the target display area to obtain the target resource image.
In an exemplary embodiment, before the obtaining resource information of the reference resource corresponding to the page to be tested based on the page identifier of the page to be tested, the method further includes:
determining a plurality of pages to be tested contained in an object to be tested and reference resource acquisition information corresponding to the pages to be tested respectively; the reference resource acquisition information is used for acquiring resource information of a reference resource corresponding to the page to be tested.
According to a second aspect of embodiments of the present disclosure, there is provided an automated testing device, comprising:
the resource information acquisition unit is configured to execute page identification based on a page to be tested and acquire resource information of a reference resource corresponding to the page to be tested; the resource information comprises reference position information of the reference resource, and the page to be tested comprises the resource to be tested;
the resource searching unit is configured to perform resource searching in a target page area of the page to be tested to obtain a resource searching result; the target page area is a page area corresponding to the reference position information in the page to be tested;
the resource matching unit is configured to perform resource matching on the target resource and the reference resource under the condition that the resource searching result indicates that the target resource is searched in the target page area, so as to obtain a resource matching result; the target resource is at least one resource in the resources to be tested;
a test result determining unit configured to perform determining a resource test result for the resource to be tested based on the resource matching result.
In an exemplary embodiment, the reference position information is page coordinate information;
the resource searching unit comprises:
a first determining unit configured to perform determining the target page area corresponding to the page coordinate information in the page to be tested;
and the first searching unit is configured to perform resource searching in the target page area to obtain the resource searching result.
In an exemplary embodiment, the reference position information is an area unit identifier, and the page to be tested includes at least one area unit;
the resource searching unit comprises:
a second determining unit configured to determine a target area unit corresponding to the area unit identifier in the page to be tested, and determine the target area unit as the target page area;
and the second searching unit is configured to perform resource searching in the target page area to obtain the resource searching result.
In an exemplary embodiment, the resource information further includes resource identification information of the reference resource, and resource version information of the reference resource;
the resource matching unit includes:
a first acquisition unit configured to perform acquisition of resource identification information of the target resource and resource version information of the target resource;
a first matching unit configured to perform information matching on the resource identification information of the target resource and the resource identification information of the reference resource to obtain a first matching result;
the second matching unit is configured to perform information matching on the resource version information of the target resource and the resource version information of the reference resource to obtain a second matching result;
a third determining unit configured to perform obtaining the resource matching result based on the first matching result and the second matching result.
In an exemplary embodiment, the resource information further includes resource presentation information of the reference resource;
the resource matching unit includes:
a second acquisition unit configured to perform acquisition of resource presentation information of the target resource;
the third matching unit is configured to perform information matching on the resource display information of the target resource and the resource display information of the reference resource to obtain a third matching result;
a fourth determining unit configured to perform obtaining the resource matching result based on the third matching result.
In an exemplary embodiment, the resource representation information of the reference resource includes a reference resource image, and a reference resource image size;
the third matching unit includes:
a target resource image determining unit configured to execute acquiring a target resource image corresponding to a target resource from the target page area; the image size of the target resource image is the reference resource image size;
the image matching unit is configured to perform image matching on the target resource image and the reference resource image to obtain an image matching result;
a fifth determination unit configured to perform determining the third matching result based on the image matching result.
In an exemplary embodiment, the reference asset image size comprises a presentation length and a presentation height of the reference asset;
the target resource image determination unit includes:
a target presentation area determination unit configured to perform determination of a target presentation area in the target page area; the length of the target display area is the display length, and the height of the target display area is the display height;
and the image intercepting unit is configured to execute image interception on the image in the target display area to obtain the target resource image.
In an exemplary embodiment, the apparatus further comprises:
a sixth determining unit configured to determine a plurality of pages to be tested included in an object to be tested, and reference resource acquisition information corresponding to each of the plurality of pages to be tested; the reference resource acquisition information is used for acquiring resource information of a reference resource corresponding to the page to be tested.
According to a third aspect of the embodiments of the present disclosure, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the automated testing method as described above.
According to a fourth aspect of embodiments of the present disclosure, there is provided a computer-readable storage medium, wherein instructions, when executed by a processor of a server, enable the server to perform an automated testing method as described above.
According to a fifth aspect of embodiments of the present disclosure, there is provided a computer program product comprising a computer program stored in a readable storage medium, from which at least one processor of a computer device reads and executes the computer program, causing the device to perform the automated testing method described above.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
when a resource to be tested included in a page to be tested is tested, resource information of a reference resource corresponding to the page to be tested is obtained based on a page identification of the page to be tested, wherein the resource information of the reference resource includes reference position information; then, searching resources in a target page area corresponding to the reference position information in the page to be tested, and under the condition that the target resources are searched, performing resource matching on the target resources and the reference resources to obtain a resource matching result; the target resource may be at least one of the resources to be tested; and determining a resource test result of the resource to be tested based on the resource matching result. The method and the device can realize automatic testing of the display resources in the page, can determine the corresponding target resources by referring to the reference position information of the resources, and realize accurate and quick positioning of the resources to be tested, thereby improving the efficiency of resource testing and the accuracy of the resource testing result.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
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 and are not to be construed as limiting the disclosure.
FIG. 1 is a schematic diagram of an implementation environment shown in accordance with an exemplary embodiment.
FIG. 2 is a flow diagram illustrating an automated testing method according to an exemplary embodiment.
FIG. 3 is a flowchart illustrating a resource lookup method according to an example embodiment.
FIG. 4 is a flow diagram illustrating another resource lookup method in accordance with an exemplary embodiment.
FIG. 5 is a flowchart illustrating a resource matching method according to an example embodiment.
FIG. 6 is a flow diagram illustrating another resource matching method in accordance with an exemplary embodiment.
FIG. 7 is a flow chart illustrating a resource image matching method according to an example embodiment.
FIG. 8 is a flowchart illustrating an image matching method according to an exemplary embodiment.
FIG. 9 is a flowchart illustrating a target resource image acquisition method according to an example embodiment.
FIG. 10 is a schematic diagram illustrating resource testing in accordance with an exemplary embodiment.
FIG. 11 is a block diagram of an automated testing device, shown in accordance with an exemplary embodiment.
FIG. 12 is a block diagram illustrating an electronic device for an automated testing method in accordance with an exemplary embodiment.
Detailed Description
In order to make the technical solutions of the present disclosure better understood by those of ordinary skill in the art, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the above-described drawings 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 disclosure described herein are capable of operation in sequences other than those illustrated or otherwise described herein. The implementations described in the exemplary embodiments below are not intended to represent all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present disclosure, as detailed in the appended claims.
It should be noted that, the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data for presentation, analyzed data, etc.) referred to in the present disclosure are information and data authorized by the user or sufficiently authorized by each party.
Referring to fig. 1, a schematic diagram of an implementation environment provided by an embodiment of the disclosure is shown, where the implementation environment may include: a user terminal 110, a testing terminal 120, and a resource server 130; the user end 110 and the testing end 120, and the testing end 120 and the resource server 130 can perform data communication through a network.
Specifically, the user end 110 may be installed with application software to be tested, and the actual display resource in each page to be tested of the application software to be tested may be the resource to be tested; the testing end 120 can execute the automated testing script, obtain the reference resource corresponding to each page to be tested from the resource server 130, and then perform resource matching between the resource to be tested and the reference resource to obtain a resource testing result of the resource to be tested. The resource server 130 may store reference resources corresponding to the application software to be tested.
Further, to avoid network resource consumption caused by network communication between the user terminal 110 and the testing terminal 120 during the resource testing process, the testing terminal 120 may directly install the application software to be tested, so that the testing terminal 120 and the resource server 130 may be included in the corresponding implementation environment.
Specifically, the user terminal 110 and the testing terminal 120 may include: smart phones, tablet computers, notebook computers, digital assistants, smart wearable devices, vehicle terminals, and other types of physical devices. The operating systems running on the user terminal 110 and the testing terminal 120 in the embodiment of the present disclosure may include, but are not limited to, an android system, an IOS system, linux, windows, and the like.
The resource server 130 and the testing terminal 120 may establish a communication connection through a wired or wireless connection, and the resource server 130 may include a server operating independently, or a distributed server, or a server cluster composed of a plurality of servers, where the server may be a cloud server.
In order to solve the problems of low efficiency of testing display resources and inaccurate test results in the related art, the embodiment of the disclosure provides an automatic test method, and an execution main body of the method can be the test end; specifically, referring to fig. 2, the method may include:
s210, acquiring resource information of a reference resource corresponding to a page to be tested based on a page identifier of the page to be tested; the resource information comprises reference position information of the reference resource, and the page to be tested comprises the resource to be tested.
For application software, to implement corresponding functions or facilitate interaction with a user, a plurality of application pages may be generally included, and each application page may include one or more display resources; therefore, in an automatic test scene, for application software to be tested which needs to perform resource testing, a plurality of application pages included in the application software can be regarded as pages to be tested, and each page to be tested has a corresponding page identification; the resources actually displayed in each page to be tested can be the resources to be tested.
The resource server can store reference resources corresponding to the application software to be tested; the reference resource may be a preset resource designed in the development of the application software, that is, the preset resource needs to be added to the application software so that the preset resource can be displayed in the application software; however, due to the existence of relevant interference factors in the development process, the resources actually displayed in the application software may be different from the preset resources, so that the resources need to be tested, the condition that the reference resources are inconsistent with the actually displayed resources can be found in time, and the resources which fail the test can be repaired as soon as possible.
The reference position information of the reference resource can be preset position information of the reference resource in a reference page when the application software is developed, and the reference position information of the reference resource can be used for quickly and accurately positioning the resource corresponding to the reference resource in the page to be tested.
S220, performing resource search in a target page area of the page to be tested to obtain a resource search result; and the target page area is a page area corresponding to the reference position information in the page to be tested.
After reference position information of the reference resource is acquired, a target page area corresponding to the reference position information can be determined; in general, the position information of the reference resource in the reference page is consistent with the position information of the resource to be tested in the page to be tested, so that in order to find the resource to be displayed corresponding to the reference resource, the target page area to be searched can be determined on the premise of consistency of the position information; and then, searching resources in the target page area to obtain a resource searching result.
Because the deviation of the position information of the reference resource and the resource to be tested can be controlled within a preset range, the page area within the preset range associated with the reference position information can be determined as the target page area, and therefore the resource searching omission can be avoided.
S230, under the condition that the resource searching result indicates that the target resource is searched in the target page area, performing resource matching on the target resource and the reference resource to obtain a resource matching result; the target resource is at least one resource in the resources to be tested.
The target page area may contain resources, and accordingly the searched resources can be determined as target resources; the target page area may not contain resources, and accordingly it may be determined that the resource to be tested corresponding to the reference resource failed the test.
If the reference resource is one resource, but a plurality of target resources are found in the target page area, the target resource corresponding to the reference resource can be determined based on the distance information between the plurality of target resources and the reference position information; specifically, the target resource closest to the reference position information may be determined as the target resource corresponding to the reference resource.
Under the condition that the target resource is found, performing resource matching on the target resource and the reference resource; the resource matching specifically may be matching the target resource and the reference resource in a plurality of resource feature items, and then obtaining a corresponding resource matching result based on the matching result of each resource feature item.
S240, determining a resource testing result of the resource to be tested based on the resource matching result.
The resource matching result can comprise that the resource matching is consistent and the resource matching is inconsistent; and if the resource matching is consistent, determining that the target resource corresponding to the reference resource passes the resource test, and if the resource matching is inconsistent, determining that the target resource corresponding to the reference resource does not pass the resource test, so that the target resource of the application software needs to be adjusted to be consistent with the reference resource.
When a resource to be tested included in a page to be tested is tested, resource information of a reference resource corresponding to the page to be tested is obtained based on a page identification of the page to be tested, wherein the resource information of the reference resource includes reference position information; then, searching resources in a target page area corresponding to the reference position information in the page to be tested, and under the condition that the target resources are searched, performing resource matching on the target resources and the reference resources to obtain a resource matching result; the target resource may be at least one of the resources to be tested; and determining a resource test result of the resource to be tested based on the resource matching result. The method and the device can realize automatic testing of the display resources in the page, can determine the corresponding target resources by referring to the reference position information of the resources, and realize accurate and rapid positioning of the resources to be tested, thereby improving the efficiency of resource testing and the accuracy of the resource testing result.
In a specific embodiment, the reference position information of the reference resource may be page coordinate information, for example, a corresponding coordinate system may be created with reference to the upper left corner of the page as an origin, the lateral direction to the right as an x-axis, and the longitudinal direction to the bottom as a y-axis, that is, the page coordinate information of the reference resource in the reference page may be determined; or a corresponding coordinate system is created by taking the lower left corner of the reference page as an origin, the transverse direction to the right as an x axis and the longitudinal direction to the upper side as a y axis, and the like. Other ways of creating the coordinate system are also possible and will not be described herein. Accordingly, the coordinate system of the page to be tested is created in the same way as the coordinate system of the reference page, so please refer to fig. 3, which shows a resource searching method, which may include:
s310, determining the target page area corresponding to the page coordinate information in the page to be tested.
And S320, performing resource search in the target page area to obtain the resource search result.
The target page area corresponding to the page coordinate information may be a page area that is located at a central point and is distant from a preset range of the page coordinate information, or a preset page area to which the page coordinate information belongs, and the like, and this embodiment is not particularly limited.
After the target page area is determined based on the page coordinate information, resource searching can be performed in the target page area to obtain a resource searching result. By referring to the page coordinate information of the resource, the resource is searched in the target page area corresponding to the page coordinate information of the page to be tested, so that the resource to be tested in the page to be tested can be quickly and accurately positioned, and the resource searching efficiency is improved; and the resource testing efficiency can be further improved.
In another optional embodiment, the page to be tested may include at least one area unit, the division of the area unit in the page to be tested is consistent with the division of the area unit in the reference page, and each area unit may include one or more resources to be predicted; the corresponding reference location information may be an area unit identifier, that is, the reference resource belongs to an area unit corresponding to the area unit identifier; referring to FIG. 4, another method of resource lookup is shown, which may include:
s410, determining a target area unit corresponding to the area unit identification in the page to be tested, and determining the target area unit as the target page area.
And S420, performing resource search in the target page area to obtain a resource search result.
The area units divided in the page to be tested are consistent with the area units divided in the reference page, and the number of the area units in the page to be tested is limited, so that the efficiency of determining the target area unit can be improved by determining the target area unit based on the area unit identification. And further, the resource is searched based on the determined target page area, so that the searching range of the target area unit can be reduced, and the resource searching efficiency is improved.
Further, under the condition that the target resource is found in the target page area, resource matching can be carried out on the reference resource and the target resource; the resource information also comprises resource identification information of the reference resource and resource version information of the reference resource; referring specifically to fig. 5, a resource matching method is shown, which may include:
s510, acquiring resource identification information of the target resource and resource version information of the target resource.
S520, performing information matching on the resource identification information of the target resource and the resource identification information of the reference resource to obtain a first matching result.
S530, performing information matching on the resource version information of the target resource and the resource version information of the reference resource to obtain a second matching result.
And S540, obtaining the resource matching result based on the first matching result and the second matching result.
The resource identification information of the target resource and the resource version information of the target resource can be stored in a terminal memory for installing application software to be tested, and can be acquired from the terminal memory through an automatic test script in the process of carrying out automatic testing.
The resource identification information of the target resource is matched with the resource identification information of the reference resource to determine whether the target resource and the reference resource are consistent in resource identification, for example, whether the target resource and the reference resource have the same resource name or the same resource label. The first matching result may include that the resource identification information of the target resource matches the resource identification information of the reference resource consistently, or that the resource identification information of the target resource does not match the resource identification information of the reference resource consistently.
Because the resource may be in the process of continuous updating, the resource version information of the target resource and the resource version information of the reference resource can be further compared to determine whether the target resource and the reference resource are consistent; for example, the resource version information may be version identification information, or version update timestamp information, etc. The second matching result may include that the resource version information of the target resource matches the resource version information of the reference resource consistently, or that the resource version information of the target resource does not match the resource version information of the reference resource consistently.
The resource identification information and the resource version information can be used as the implicit attribute information of the resource, so that the corresponding implicit attribute information matching result of the resource is determined through the matching of the implicit attribute information of the target resource and the implicit attribute information of the reference resource, the corresponding resource matching result is determined based on the implicit matching result, and the accuracy of the resource matching is improved.
In an optional embodiment, when the resource identification information and the resource version information of the target resource and the reference resource are both consistent, the display information of the target resource and the reference resource may be further matched. The resource information can also comprise resource display information of reference resources, and the resource display information can comprise resource display information and resource implicit display information; the resource display and display information can be image information, display format information and the like when the resource is displayed; the implicit resource display information may be configuration information when the resource is displayed, such as display time, display frequency, and the like. Accordingly, referring to fig. 6, another resource matching method is shown, which may include:
s610, acquiring resource display information of the target resource.
S620, performing information matching on the resource display information of the target resource and the resource display information of the reference resource to obtain a third matching result.
And S630, obtaining the resource matching result based on the third matching result.
The resource display information of the target resource can be stored in a terminal memory for installing the application software to be tested, and can be acquired from the terminal memory through an automatic test script in the process of carrying out automatic testing.
The resource display information of the target resource is matched with the resource display information of the reference resource to determine whether the resource display information of the target resource is consistent with the resource display information of the reference resource, visual presentation information during resource display can be generated based on the resource display information, and the visual presentation information can be generated based on the resource display information and the resource implicit display information. The third resource matching result may include that the resource display information of the target resource is consistent with the resource display information matching result of the reference resource, and the resource display information of the target resource is inconsistent with the resource display information matching result of the reference resource.
Therefore, the resource display information of the target resource is matched with the resource display information of the reference resource to obtain a corresponding resource matching result, and the accuracy of resource matching can be improved.
In one embodiment, the resource presentation information for the reference resource may include a reference resource image and a reference resource image size; referring to fig. 7, a method for resource image matching is shown, which may include:
s710, acquiring a target resource image corresponding to a target resource from the target page area; and the image size of the target resource image is the image size of the reference resource image.
And S720, carrying out image matching on the target resource image and the reference resource image to obtain an image matching result.
S730, determining the third matching result based on the image matching result.
When the target resource is found in the target page area, the target resource image corresponding to the target resource can be obtained from the target page area, and the image size of the obtained target resource is consistent with the image size of the reference resource. After the target resource image is acquired, image matching can be performed on the target resource image and the reference resource image.
In one example, the reference resource image is an original image corresponding to the reference resource, and the reference resource image size is the size of the original image; the image matching method can match each pixel point contained in the target resource image with the pixel point at the corresponding position of the reference resource image to obtain an image matching result. Under the condition that the pixel point similarity after matching is greater than or equal to a first preset similarity, determining that the image matching of the image matching result is consistent; and otherwise, determining that the image matching of the image matching result is inconsistent under the condition that the pixel point similarity after matching is smaller than the first preset similarity.
The size of the target resource image is consistent with that of the reference resource image, and image matching is performed based on the same image size, so that the image matching rationality can be improved; on the other hand, images with the same size are obtained for matching, so that resource consumption caused by large-scale image matching can be avoided, and the image matching efficiency is improved.
In another example, the reference resource image may be a template image corresponding to an original image of the reference resource, i.e., the template image is a part of the original image of the reference resource, i.e., the size of the template image is smaller than that of the original image, and the reference resource image size is the size of the original image; referring to fig. 8, an image matching method is shown, which includes:
s810, dividing image areas of a target resource image based on the size of a template image to obtain a plurality of image areas; the size of each image area corresponds to the size of the template image.
S820, carrying out image matching on the template image and a plurality of image areas, and determining a target image area based on an image matching result; and the similarity between the image of the target image area and the matching image is greater than or equal to a second preset similarity.
And S830, under the condition that the target image area is matched, determining that the image matching result is image matching consistency.
S840, under the condition that the target image area is not matched, determining that the image matching result is that the image matching is inconsistent.
The image matching is carried out through the template image with the size smaller than that of the target resource image, the image can be matched in a subarea mode, and the size of the template image is smaller than that of the original image of the reference resource, so that the network resource consumption for obtaining the template image is smaller than that for obtaining the original image, and the network resource can be saved.
Further, the reference asset image size comprises a presentation length and a presentation height of the reference asset; thus, referring to FIG. 9, a method for acquiring an image of a target resource is shown, which may include:
s910, determining a target display area in the target page area; the length of the target display area is the display length, and the height of the target display area is the display height.
S920, image interception is carried out on the image in the target display area, and the target resource image is obtained.
Based on the display length and the display height of the reference resource, the display length and the display height of the target resource can be determined, and then the target display area can be determined from the target page area; the range of the target display area is matched with the display length and the display height.
In one example, the target display area may be a rectangular area, wherein the length of the rectangular area is the display length, and the height of the rectangular area is the display height; in the case of a uniform display length and display height, the rectangular area may be a square area.
In another example, the target presentation area may be an irregular graphic area, wherein the range of the irregular graphic area is contained within a rectangular area range, wherein the length of the rectangular area is the presentation length and the height of the rectangular area is the presentation height.
And determining the target resource image with the corresponding size based on the display length and the display height of the photo resource, so that the accuracy of determining the target resource image can be improved, and the accuracy of the image matching result is further improved.
In an optional embodiment, the reference information of the reference resource corresponding to the page to be tested may be acquired through an automated test script, the reference information of the reference resource may be stored in the resource server, the corresponding reference resource acquisition information may be set for each page to be tested in advance, and the reference resource acquisition information may be stored in a memory of the terminal in which the application software to be tested is installed, so that the automated test script may acquire the resource information of the corresponding reference resource according to the reference resource acquisition information. Specifically, a plurality of pages to be tested included in an object to be tested and reference resource acquisition information corresponding to the pages to be tested can be predetermined; the reference resource acquisition information is used for acquiring resource information of a reference resource corresponding to the page to be tested. The reference resource acquisition information can be link acquisition information or path acquisition information, and each reference resource acquisition information can be used for jumping to a corresponding resource acquisition page so that the automatic test script can acquire corresponding resource information based on the resource acquisition page; therefore, the efficiency and the accuracy of resource information acquisition can be realized.
The method for testing the resources can be used for testing one of the application software to be tested or the resources in the page by taking the page as a unit, and related testing operations can be executed by the automatic testing script by presetting the page identification of the corresponding page to be tested in the automatic testing script.
In the embodiment of the disclosure, the corresponding relation between the global resource library and the reference resource of the reference page can be established, so that the uniform maintenance of the resource information is facilitated; that is, when the resource information of the reference resource needs to be obtained, the relevant resource information can be obtained from the global resource library.
Referring to fig. 10(a), a page to be tested may include a resource a, a resource B, and a resource C, and a reference resource corresponding to the corresponding page to be tested may include a resource a ', a resource B', and a resource C ', where the resource a' may be a reference resource of the resource a, the resource B 'may be a reference resource of the resource B, and the resource C' may be a reference resource of the resource C; a corresponding target page area S1 is determined in the page to be tested based on the reference position information of the resource a ', and corresponding target page areas S2 and S3 are determined in the page to be tested based on the reference position information of the resource B ' and the resource C ', as shown in fig. 10(B), wherein the area selected by the dashed frame is the target page area. Performing resource search in the target page area, for example, when the resource a is searched in the target page area S1, performing resource matching on the searched resource a and the resource a', and when the matching result is consistent, determining that the resource a in the page to be tested passes the test; the same test method as that for resource a can be adopted for resource B and resource C, so that the test results for resource B and resource C can be obtained.
FIG. 11 is a block diagram illustrating an automated testing apparatus according to an exemplary embodiment. Referring to fig. 10, the apparatus includes:
a resource information obtaining unit 1110 configured to perform obtaining resource information of a reference resource corresponding to a page to be tested based on a page identifier of the page to be tested; the resource information comprises reference position information of the reference resource, and the page to be tested comprises the resource to be tested;
a resource searching unit 1120, configured to perform resource searching in a target page area of the page to be tested, so as to obtain a resource searching result; the target page area is a page area corresponding to the reference position information in the page to be tested;
a resource matching unit 1130 configured to perform resource matching on the target resource and the reference resource to obtain a resource matching result, when the resource searching result indicates that the target resource is found in the target page area; the target resource is at least one resource in the resources to be tested;
a test result determining unit 1140 configured to perform determining a resource test result for the resource to be tested based on the resource matching result.
In an exemplary embodiment, the reference position information is page coordinate information;
the resource searching unit comprises:
a first determining unit configured to perform determining the target page area corresponding to the page coordinate information in the page to be tested;
and the first searching unit is configured to perform resource searching in the target page area to obtain the resource searching result.
In an exemplary embodiment, the reference position information is an area unit identifier, and the page to be tested includes at least one area unit;
the resource searching unit comprises:
the second determining unit is configured to determine a target area unit corresponding to the area unit identifier in the page to be tested, and determine the target area unit as the target page area;
and the second searching unit is configured to perform resource searching in the target page area to obtain the resource searching result.
In an exemplary embodiment, the resource information further includes resource identification information of the reference resource, and resource version information of the reference resource;
the resource matching unit 1130 includes:
a first acquisition unit configured to perform acquisition of resource identification information of the target resource and resource version information of the target resource;
a first matching unit configured to perform information matching on the resource identification information of the target resource and the resource identification information of the reference resource to obtain a first matching result;
the second matching unit is configured to perform information matching on the resource version information of the target resource and the resource version information of the reference resource to obtain a second matching result;
a third determining unit configured to perform obtaining the resource matching result based on the first matching result and the second matching result.
In an exemplary embodiment, the resource information further includes resource presentation information of the reference resource;
the resource matching unit 1130 includes:
a second obtaining unit configured to perform obtaining resource display information of the target resource;
the third matching unit is configured to perform information matching on the resource display information of the target resource and the resource display information of the reference resource to obtain a third matching result;
a fourth determining unit configured to perform obtaining the resource matching result based on the third matching result.
In an exemplary embodiment, the resource presentation information of the reference resource includes a reference resource image, and a reference resource image size;
the third matching unit includes:
a target resource image determining unit configured to execute acquiring a target resource image corresponding to a target resource from the target page area; the image size of the target resource image is the reference resource image size;
the image matching unit is configured to perform image matching on the target resource image and the reference resource image to obtain an image matching result;
a fifth determination unit configured to perform determining the third matching result based on the image matching result.
In an exemplary embodiment, the reference asset image size comprises a presentation length and a presentation height of the reference asset;
the target resource image determination unit includes:
a target presentation area determination unit configured to perform determining a target presentation area in the target page area; the length of the target display area is the display length, and the height of the target display area is the display height;
and the image intercepting unit is configured to execute image interception on the image in the target display area to obtain the target resource image.
In an exemplary embodiment, the apparatus further comprises:
a sixth determining unit configured to determine a plurality of pages to be tested included in an object to be tested, and reference resource acquisition information corresponding to each of the plurality of pages to be tested; the reference resource acquisition information is used for acquiring resource information of a reference resource corresponding to the page to be tested.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
In an exemplary embodiment, there is also provided a computer readable storage medium including instructions, which may optionally be ROM, Random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, and the like; the instructions in the computer readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform any of the methods described above.
In an exemplary embodiment, there is also provided a computer program product comprising a computer program stored in a readable storage medium, from which at least one processor of a computer device reads and executes the computer program, causing the device to perform any of the methods described above.
Fig. 12 is a block diagram illustrating an electronic device for an automated testing method, which may be a terminal, according to an example embodiment, and an internal structure thereof may be as shown in fig. 12. The electronic device comprises a processor, a memory, a network interface, a display screen and an input device which are connected through a system bus. Wherein the processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic equipment comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operating system and the computer program to run on the non-volatile storage medium. The network interface of the electronic device is used for connecting and communicating with an external terminal through a network. The computer program is executed by a processor to implement an automated testing method. The display screen of the electronic equipment can be a liquid crystal display screen or an electronic ink display screen, and the input device of the electronic equipment can be a touch layer covered on the display screen, a key, a track ball or a touch pad arranged on the shell of the electronic equipment, an external keyboard, a touch pad or a mouse and the like.
It will be appreciated by those skilled in the art that the structure shown in fig. 12 is a block diagram of only a portion of the structure associated with the disclosed aspects and does not constitute a limitation on the electronic devices to which the disclosed aspects apply, and that a particular electronic device may include more or fewer components than shown in the figures, or combine certain components, or have a different arrangement of components.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any variations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It will be understood that the present disclosure is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.

Claims (10)

1. An automated testing method, comprising:
acquiring resource information of a reference resource corresponding to a page to be tested based on a page identifier of the page to be tested; the resource information comprises reference position information of the reference resource, and the page to be tested comprises the resource to be tested;
performing resource search in a target page area of the page to be tested to obtain a resource search result; the target page area is a page area corresponding to the reference position information in the page to be tested;
under the condition that the resource searching result indicates that the target resource is searched in the target page area, performing resource matching on the target resource and the reference resource to obtain a resource matching result; the target resource is at least one resource in the resources to be tested;
and determining a resource test result of the resource to be tested based on the resource matching result.
2. The method according to claim 1, wherein the reference position information is page coordinate information;
the resource searching is carried out in the target page area of the page to be tested to obtain a resource searching result, and the resource searching result comprises the following steps:
determining the target page area corresponding to the page coordinate information in the page to be tested;
and searching resources in the target page area to obtain the resource searching result.
3. The method according to claim 1, wherein the reference position information is a zone unit identifier, and the page to be tested includes at least one zone unit;
the resource searching is carried out in the target page area of the page to be tested to obtain a resource searching result, and the resource searching result comprises the following steps:
determining a target area unit corresponding to the area unit identification in the page to be tested, and determining the target area unit as the target page area;
and searching resources in the target page area to obtain the resource searching result.
4. The method of claim 1, wherein the resource information further includes resource identification information of the reference resource and resource version information of the reference resource;
the resource matching of the target resource and the reference resource to obtain a resource matching result includes:
acquiring resource identification information of the target resource and resource version information of the target resource;
performing information matching on the resource identification information of the target resource and the resource identification information of the reference resource to obtain a first matching result;
performing information matching on the resource version information of the target resource and the resource version information of the reference resource to obtain a second matching result;
and obtaining the resource matching result based on the first matching result and the second matching result.
5. The method according to claim 1 or 4, wherein the resource information further comprises resource presentation information of the reference resource;
the resource matching of the target resource and the reference resource to obtain a resource matching result includes:
acquiring resource display information of the target resource;
performing information matching on the resource display information of the target resource and the resource display information of the reference resource to obtain a third matching result;
and obtaining the resource matching result based on the third matching result.
6. The method of claim 5, wherein the resource presentation information for the reference resource comprises a reference resource image, and a reference resource image size;
the information matching is performed between the resource display information based on the target resource and the resource display information of the reference resource to obtain a third matching result, and the third matching result includes:
acquiring a target resource image corresponding to a target resource from the target page area; the image size of the target resource image is the image size of the reference resource image;
performing image matching on the target resource image and the reference resource image to obtain an image matching result;
determining the third matching result based on the image matching result.
7. An automated testing apparatus, comprising:
the resource information acquisition unit is configured to execute page identification based on a page to be tested and acquire resource information of a reference resource corresponding to the page to be tested; the resource information comprises reference position information of the reference resource, and the page to be tested comprises the resource to be tested;
the resource searching unit is configured to perform resource searching in a target page area of the page to be tested to obtain a resource searching result; the target page area is a page area corresponding to the reference position information in the page to be tested;
the resource matching unit is configured to perform resource matching on the target resource and the reference resource under the condition that the resource searching result indicates that the target resource is searched in the target page area, so as to obtain a resource matching result; the target resource is at least one resource in the resources to be tested;
a test result determining unit configured to perform determining a resource test result for the resource to be tested based on the resource matching result.
8. An electronic device, comprising:
a processor;
a memory for storing the processor-executable instructions;
wherein the processor is configured to execute the instructions to implement the automated testing method of any of claims 1 to 6.
9. A computer-readable storage medium, wherein instructions in the computer-readable storage medium, when executed by a processor of an electronic device, enable the electronic device to perform the automated testing method of any of claims 1-6.
10. A computer program product comprising computer programs/instructions, characterized in that the computer programs/instructions, when executed by a processor, implement the automated testing method of any one of claims 1 to 6.
CN202210451869.2A 2022-04-26 2022-04-26 Automatic testing method and device, electronic equipment and storage medium Pending CN114996122A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210451869.2A CN114996122A (en) 2022-04-26 2022-04-26 Automatic testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210451869.2A CN114996122A (en) 2022-04-26 2022-04-26 Automatic testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN114996122A true CN114996122A (en) 2022-09-02

Family

ID=83025451

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210451869.2A Pending CN114996122A (en) 2022-04-26 2022-04-26 Automatic testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN114996122A (en)

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252410A (en) * 2013-06-27 2014-12-31 阿里巴巴集团控股有限公司 Method and equipment for testing control in page
US20150370688A1 (en) * 2014-06-20 2015-12-24 Vmware, Inc. Automatic updating of graphical user interface element locators based on dimension comparison
CN107274442A (en) * 2017-07-04 2017-10-20 北京云测信息技术有限公司 A kind of image-recognizing method and device
CN109739752A (en) * 2018-12-21 2019-05-10 北京城市网邻信息技术有限公司 Built-in resource testing method, apparatus, electronic equipment and readable storage medium storing program for executing
CN110473249A (en) * 2019-07-12 2019-11-19 平安普惠企业管理有限公司 A kind of control methods, device and the terminal device of web user interface and design original text
CN112783790A (en) * 2021-02-04 2021-05-11 腾讯科技(深圳)有限公司 Application program testing method and device
CN113448835A (en) * 2020-09-25 2021-09-28 北京新氧科技有限公司 Static resource testing method and device, electronic equipment and storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104252410A (en) * 2013-06-27 2014-12-31 阿里巴巴集团控股有限公司 Method and equipment for testing control in page
US20150370688A1 (en) * 2014-06-20 2015-12-24 Vmware, Inc. Automatic updating of graphical user interface element locators based on dimension comparison
CN107274442A (en) * 2017-07-04 2017-10-20 北京云测信息技术有限公司 A kind of image-recognizing method and device
CN109739752A (en) * 2018-12-21 2019-05-10 北京城市网邻信息技术有限公司 Built-in resource testing method, apparatus, electronic equipment and readable storage medium storing program for executing
CN110473249A (en) * 2019-07-12 2019-11-19 平安普惠企业管理有限公司 A kind of control methods, device and the terminal device of web user interface and design original text
CN113448835A (en) * 2020-09-25 2021-09-28 北京新氧科技有限公司 Static resource testing method and device, electronic equipment and storage medium
CN112783790A (en) * 2021-02-04 2021-05-11 腾讯科技(深圳)有限公司 Application program testing method and device

Similar Documents

Publication Publication Date Title
CN110751149B (en) Target object labeling method, device, computer equipment and storage medium
CN110765379B (en) Method, device, computer equipment and storage medium for loading resource file
US8392887B2 (en) Systems and methods for identifying graphic user-interface components
CN110781658B (en) Resume analysis method, resume analysis device, electronic equipment and storage medium
CN110780939B (en) Method, device, computer equipment and storage medium for loading resource file
CN107807841B (en) Server simulation method, device, equipment and readable storage medium
CN112487883B (en) Intelligent pen writing behavior feature analysis method and device and electronic equipment
US20160283062A1 (en) Storage medium, facility inspection support method, and facility inspection support apparatus
CN112487871B (en) Handwriting data processing method and device and electronic equipment
CN110288037A (en) Image processing method, device and electronic equipment
CN113282488A (en) Terminal test method and device, storage medium and terminal
US20220386071A1 (en) Road side positioning method and apparatus, device, and storage medium
CN111290931A (en) Method and device for visually displaying buried point data
US20230096934A1 (en) Integrated circuit post-layout simulation method and device, electronic device and storage medium
CN114924815B (en) Page rendering method and device, electronic equipment and storage medium
CN111739136B (en) Rendering method, computer device, and storage medium
US12089143B2 (en) Network search method and apparatus, device and storage medium
CN111581324A (en) Navigation data generation method, device and equipment
CN112486337B (en) Handwriting graph analysis method and device and electronic equipment
CN110706035B (en) Updating effect evaluation method and device, storage medium and electronic equipment
CN115639578B (en) Beidou navigation positioning monitoring processing method and system
CN114996122A (en) Automatic testing method and device, electronic equipment and storage medium
CN113722203A (en) Program testing method and device, electronic device and computer readable storage medium
CN112559362B (en) Automatic testing method and testing device for dynamic user interface
CN114327435A (en) Technical document generation method and device and computer readable 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