CN111104308A - Display page testing method and device, storage medium and electronic equipment - Google Patents

Display page testing method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN111104308A
CN111104308A CN201911099427.0A CN201911099427A CN111104308A CN 111104308 A CN111104308 A CN 111104308A CN 201911099427 A CN201911099427 A CN 201911099427A CN 111104308 A CN111104308 A CN 111104308A
Authority
CN
China
Prior art keywords
page
picture
test
set page
correct
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
CN201911099427.0A
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.)
Beike Technology Co Ltd
Original Assignee
Beike 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 Beike Technology Co Ltd filed Critical Beike Technology Co Ltd
Priority to CN201911099427.0A priority Critical patent/CN111104308A/en
Publication of CN111104308A publication Critical patent/CN111104308A/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
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/44Arrangements for executing specific programs
    • G06F9/451Execution arrangements for user interfaces

Landscapes

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

Abstract

The embodiment of the disclosure discloses a method and a device for testing a display page, a storage medium and electronic equipment, wherein the method comprises the following steps: acquiring a test case from a database; the database comprises a plurality of test cases; executing the test case to obtain a set page picture corresponding to the test case; identifying the set page picture through an analysis model to obtain an identification result of whether the set page picture is correct or not; determining a test result of a page corresponding to the test case based on the identification result; according to the embodiment, the set page image is identified through the analysis model, whether the page display is expected or not is macroscopically detected, whether the page layout is normal or not is detected, the testing speed is accelerated, and the testing efficiency is improved.

Description

Display page testing method and device, storage medium and electronic equipment
Technical Field
The present disclosure relates to web page testing technologies, and in particular, to a method and an apparatus for testing a display page, a storage medium, and an electronic device.
Background
User interface testing (User interface testing), abbreviated as UI testing, the contents to be tested include: whether the layout of the functional modules of the user interface is reasonable or not, whether the overall style is consistent or not and whether the placement positions of the controls accord with the use habits of customers or not, more importantly, whether the operation is convenient or fast, the navigation is simple and understandable, whether characters in the interface are correct or not, whether the naming is uniform or not, whether the page is attractive or not, whether the combination of the characters and the pictures is perfect or not and the like are required. However, in the prior art, user interface testing is usually realized through manual testing, and most of the existing UI automated testing schemes perform automated detection through fixed input and fixed verification methods. For the test point for checking whether the page layout is normal, the traditional scheme can not solve the problem.
Disclosure of Invention
The present disclosure is proposed to solve the above technical problems. The embodiment of the disclosure provides a display page testing method and device, a storage medium and electronic equipment.
According to an aspect of the embodiments of the present disclosure, there is provided a method for testing a display page, including:
acquiring a test case from a database; the database comprises a plurality of test cases;
executing the test case to obtain a set page picture corresponding to the test case;
identifying the set page picture through an analysis model to obtain an identification result of whether the set page picture is correct or not;
and determining a test result of the page corresponding to the test case based on the identification result.
Optionally, the identifying the set page picture through the analysis model to obtain an identification result of whether the set page picture is correct includes:
extracting the regional characteristics of the set page picture through the analysis model;
and determining whether the set page picture is correct or not based on the result of the region feature extraction.
Optionally, the determining whether the set page picture is correct based on the result of the region feature extraction includes:
judging whether at least one page feature obtained by the regional feature extraction is matched with a plurality of set key features;
when more than one page feature exists in the at least one page feature and the key feature is not matched, determining that the set page picture is wrong; otherwise, determining that the set page picture is correct.
Optionally, the determining whether the set page picture is correct based on the result of the region feature extraction includes:
judging whether at least one page feature obtained by the regional feature extraction is matched with a plurality of set key features;
when a set number of page features in the at least one page feature are matched with the key features, determining that the set page picture is correct; otherwise, determining that the set page picture is wrong.
Optionally, before identifying the set page picture through an analysis model to obtain an identification result of whether the set page picture is correct, the method further includes:
training the analysis model by using a sample page set corresponding to the set page picture; the sample page set includes a plurality of correct sample page pictures and a plurality of incorrect sample page pictures.
Optionally, the executing the test case to obtain a set page picture corresponding to the test case includes:
starting a browser, and controlling the browser to run according to codes in the test case;
and executing screen capture operation on a set page displayed in the process of executing the test case by the browser to acquire a set page picture.
Optionally, the performing a screen capture operation on a set page displayed in the process of executing the test case by the browser to obtain the set page picture includes:
and when the browser displays the set page and the set page is loaded, triggering screen capture operation to acquire the set page picture.
Optionally, the method further comprises:
storing the recognition result in a database;
when the number of the identification results corresponding to the test cases stored in the database reaches a preset condition; generating a test report based on the recognition results in the database.
Optionally, the preset condition includes at least one of:
the number of the identification results is greater than or equal to a first preset number, the number of the correct results in the identification results is greater than or equal to a second preset number, and the number of the error results in the identification results is greater than or equal to a third preset number.
Optionally, the determining, based on the recognition result, a test result of the page corresponding to the test case includes:
responding to the recognition result that the set page picture is correct, and the test result shows that the page is correct;
and responding to the identification result representing a set page picture error, wherein the test result represents the page error.
According to another aspect of the embodiments of the present disclosure, there is provided a test apparatus for displaying a page, including:
the case acquisition module is used for acquiring the test cases from the database; the database comprises a plurality of test cases;
the picture acquisition module is used for executing the test case to obtain a set page picture corresponding to the test case;
the image identification module is used for identifying the set page image through an analysis model to obtain an identification result of whether the set page image is correct or not;
and the test result module is used for determining the test result of the page corresponding to the test case based on the identification result.
Optionally, the picture recognition module includes:
the characteristic extraction module is used for extracting the regional characteristics of the set page picture through the analysis model;
and the result judging module is used for determining whether the set page picture is correct or not based on the result of the regional feature extraction.
Optionally, the result determining module is specifically configured to determine whether at least one page feature obtained by the region feature extraction matches with a plurality of set key features; when more than one page feature exists in the at least one page feature and the key feature is not matched, determining that the set page picture is wrong; otherwise, determining that the set page picture is correct.
Optionally, the result determining module is specifically configured to determine whether at least one page feature obtained by the region feature extraction matches with a plurality of set key features; when a set number of page features in the at least one page feature are matched with the key features, determining that the set page picture is correct; otherwise, determining that the set page picture is wrong.
Optionally, the apparatus further comprises:
the model training module is used for training the analysis model by utilizing the sample page set corresponding to the set page picture; the sample page set includes a plurality of correct sample page pictures and a plurality of incorrect sample page pictures.
Optionally, the image obtaining module is specifically configured to start a browser and control the browser to run according to a code in the test case; and executing screen capture operation on a set page displayed in the process of executing the test case by the browser to acquire a set page picture.
Optionally, the image obtaining module is configured to, when a screen capturing operation is performed on a set page displayed in a process of executing the test case by the browser, and the set page image is obtained, trigger the screen capturing operation when the set page is displayed by the browser and the set page is loaded, and obtain the set page image.
Optionally, the apparatus further comprises:
the result storage module is used for storing the identification result into a database;
the report generation module is used for judging whether the quantity of the identification results corresponding to the test cases stored in the database reaches a preset condition; generating a test report based on the recognition results in the database.
Optionally, the preset condition includes at least one of:
the number of the identification results is greater than or equal to a first preset number, the number of the correct results in the identification results is greater than or equal to a second preset number, and the number of the error results in the identification results is greater than or equal to a third preset number.
Optionally, the test result module is specifically configured to respond that the identification result indicates that the set page picture is correct, and the test result indicates that the page is correct; and responding to the identification result representing a set page picture error, wherein the test result represents the page error.
According to still another aspect of the embodiments of the present disclosure, there is provided a computer-readable storage medium storing a computer program for executing the method for testing a display page according to any one of the embodiments.
According to still another 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;
the processor is configured to read the executable instruction from the memory and execute the instruction to implement the method for testing a display page according to any of the embodiments.
Based on the method and the device for testing the display page, the storage medium and the electronic equipment, which are provided by the embodiment of the disclosure, the test case is obtained from the database; the database comprises a plurality of test cases; executing the test case to obtain a set page picture corresponding to the test case; identifying the set page picture through an analysis model to obtain an identification result of whether the set page picture is correct or not; determining a test result of a page corresponding to the test case based on the identification result; according to the embodiment, the set page image is identified through the analysis model, whether the page display is expected or not is macroscopically detected, whether the page layout is normal or not is detected, the testing speed is accelerated, and the testing efficiency is improved.
The technical solution of the present disclosure is further described in detail by the accompanying drawings and examples.
Drawings
The above and other objects, features and advantages of the present disclosure will become more apparent by describing in more detail embodiments of the present disclosure with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the disclosure and are incorporated in and constitute a part of this specification, illustrate embodiments of the disclosure and together with the description serve to explain the principles of the disclosure and not to limit the disclosure. In the drawings, like reference numbers generally represent like parts or steps.
Fig. 1 is a schematic flowchart of a method for testing a display page according to an exemplary embodiment of the present disclosure.
FIG. 2 is a schematic flow chart of step 106 in the embodiment shown in FIG. 1 of the present disclosure.
Fig. 3 is a schematic diagram of a correct sample page picture in an alternative embodiment of the present disclosure.
Fig. 4a-d are schematic diagrams of correct sample page pictures in a sample page set in alternative embodiments of the present disclosure.
Fig. 5a-d are schematic diagrams of erroneous sample page pictures in a sample page set in alternative embodiments of the present disclosure.
Fig. 6 is a schematic flow chart of step 104 in the embodiment shown in fig. 1 of the present disclosure.
Fig. 7 is a flowchart illustrating a method for testing a display page according to another exemplary embodiment of the present disclosure.
Fig. 8 is a schematic structural diagram of a device for testing a display page according to an exemplary embodiment of the present disclosure.
Fig. 9 is a block diagram of an electronic device provided in an exemplary embodiment of the present disclosure.
Detailed Description
Hereinafter, example embodiments according to the present disclosure will be described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of the embodiments of the present disclosure and not all embodiments of the present disclosure, with the understanding that the present disclosure is not limited to the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, the numerical expressions, and numerical values set forth in these embodiments do not limit the scope of the present disclosure unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present disclosure are used merely to distinguish one element from another, and are not intended to imply any particular technical meaning, nor is the necessary logical order between them.
It is also understood that in embodiments of the present disclosure, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the disclosure, may be generally understood as one or more, unless explicitly defined otherwise or stated otherwise.
In addition, the term "and/or" in the present disclosure is only one kind of association relationship describing an associated object, and means that three kinds of relationships may exist, for example, a and/or B may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" in the present disclosure generally indicates that the former and latter associated objects are in an "or" relationship.
It should also be understood that the description of the various embodiments of the present disclosure emphasizes the differences between the various embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the disclosure, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
The disclosed embodiments may be applied to electronic devices such as terminal devices, computer systems, servers, etc., which are operational with numerous other general purpose or special purpose computing system environments or configurations. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set top boxes, programmable consumer electronics, network pcs, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above systems, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Summary of the application
In the process of implementing the present disclosure, the inventor finds that most of the existing UI automation test schemes perform automation detection through a fixed input and a fixed verification manner. This prior art has at least the following problems: for a test point for checking whether the page layout is normal, the traditional scheme cannot solve the problem; the maintenance cost is high, and when the page control is changed, the automatic detection code needs to be modified along with the change; the test time is long, and the test needs to be always operated on the browser and the result is verified.
Exemplary method
Fig. 1 is a schematic flowchart of a method for testing a display page according to an exemplary embodiment of the present disclosure. The embodiment can be applied to an electronic device, as shown in fig. 1, and includes the following steps:
step 102, obtaining a test case from a database.
The database comprises a plurality of test cases.
The test cases may be in code form, for example: one test case includes:
Figure BDA0002269380230000081
Figure BDA0002269380230000091
and 104, executing the test case to obtain a set page picture corresponding to the test case.
Optionally, each test case may correspond to a setting page, and the setting page is used as a page to be tested, and an image of the page needs to be acquired to obtain a setting page picture corresponding to the setting page.
And 106, identifying the set page picture through the analysis model to obtain an identification result of whether the set page picture is correct or not.
Optionally, the analysis model may be a deep neural network, and the deep neural network may be trained to determine whether the set page image is correct, and the specific structure and the training process of the deep neural network are not limited in this embodiment.
And 108, determining a test result of the page corresponding to the test case based on the identification result.
In this embodiment, a test result of the page is determined based on an identification result of whether the set page picture is correct, where the set page picture corresponds to the page to be tested, and optionally, the test result indicates that the set page picture is correct in response to the identification result; and responding to the recognition result representing the setting page picture error, and the test result representing the page error.
According to the test method for the display page provided by the embodiment of the disclosure, a test case is obtained from a database; the database comprises a plurality of test cases; executing the test case to obtain a set page picture corresponding to the test case; identifying the set page picture through an analysis model to obtain an identification result of whether the set page picture is correct or not; determining a test result of a page corresponding to the test case based on the identification result; according to the embodiment, the set page image is identified through the analysis model, whether the page display is expected or not is macroscopically detected, whether the page layout is normal or not is detected, the testing speed is accelerated, and the testing efficiency is improved.
As shown in fig. 2, based on the embodiment shown in fig. 1, step 106 may include the following steps:
and 1061, extracting the regional characteristics of the set page picture through the analysis model.
Optionally, the analysis model may be a deep neural network capable of implementing region feature extraction, and the region feature extraction is performed on the set page picture through the analysis model to obtain at least one page feature, where each page feature may represent a feature of a certain region in the page picture.
Step 1062, determining whether the set page picture is correct based on the result of the region feature extraction.
In some optional embodiments, whether the setting page picture is correct may be determined by:
judging whether at least one page feature obtained by regional feature extraction is matched with a plurality of set key features; when more than one page feature exists in the at least one page feature and the key feature is not matched, determining that the set page picture is wrong; otherwise, the setting page picture is determined to be correct.
In this embodiment, all the page features that need to be obtained by feature extraction have corresponding key features, which is a relatively accurate page determination method.
In other alternative embodiments, whether the setting page picture is correct or not can be determined by the following method: judging whether at least one page feature obtained by regional feature extraction is matched with a plurality of set key features; when the page features with the set number in the at least one page feature are matched with the key features, determining that the set page picture is correct; otherwise, determining that the set page picture is wrong.
In this embodiment, when there is a set number of page features matching with the key features, it may be determined that the set page picture is correct, and the correctness determination of the page picture may be determined according to the setting, for example, it may be determined that 80% of the set page features matching with the key features, so that the method of this embodiment has a certain fault tolerance, and the robustness of the method of this embodiment is improved.
The correctness judgment of the set page picture is realized based on the analysis model, the set page picture can be directly input into the analysis model, a correct or wrong result is directly output based on the analysis model, and at the moment, the training of the analysis model is based on the known correct or incorrect picture of the corresponding website.
In some optional embodiments, before performing step 106, the method may further include:
and training the analysis model by using the sample page set corresponding to the set page picture.
For example, the page shown in fig. 3 is taken as a correct sample page picture, and through analysis model extraction, 7 circles circled therein can be determined to be a corresponding region of the page feature of the page, at this time, the corresponding correct sample page picture is as shown in fig. 4a, 4b, 4c, and 4d, and the error page sample picture can be as shown in fig. 5a, 5b, 5c, and 5 d.
In this embodiment, the process of training the analysis model by using the page image picture known to be correct or not may include inputting the correct sample page picture or the incorrect sample page picture into the analysis model, obtaining at least one predicted page feature through the analysis model, matching the predicted page feature with the known key feature, determining a loss of the analysis model based on a matching result and whether the known input page picture is correct or not, and adjusting parameters in the analysis model by using a back propagation gradient method based on the loss to improve the accuracy of the analysis model in obtaining the page feature.
As shown in fig. 6, based on the embodiment shown in fig. 1, step 104 may include the following steps:
and 1041, starting the browser, and controlling the browser to run according to codes in the test case.
And 1042, executing screen capture operation on a set page displayed in the process of executing the test case by the browser, and acquiring a set page picture.
Optionally, when the browser displays the setting page and the loading of the setting page is completed, a screen capture operation is triggered to obtain the setting page picture.
Optionally, in an example, the automated test case may be scheduled by unittest and executed item by item, where the test case may be executed by selenium, and an example execution process of the test case includes: a) opening a browser; b) accessing addresses in test cases, for example: http:// test-loan2.lianjia. com/Message; c) when the address page needs to be logged in through a user name and a password, inputting the user name and the password, and clicking to log in; d) and entering a setting page, for example, a short message sending page.
In this embodiment, the timing of obtaining the set page picture is that after the set page is loaded (in an actual operation, whether a refresh button in the page is displayed can be taken as a standard for completing loading, when the refresh button is displayed, the page is considered to be loaded completely, otherwise, the page is considered not to be loaded completely), a screen capture operation is triggered to obtain the set page picture, optionally, the time of the screen capture operation is recorded when the set page picture is obtained, the set page pictures obtained at different times of the same page are distinguished by the time, and the record of the change of the set page is realized; when the set page is not loaded completely, the problem of incomplete page display may exist, and if the screen capturing is performed at this time, the obtained picture cannot accurately judge whether the page is correct due to the problems of incomplete display and the like, so that the page screen capturing operation is not performed when the set page is not loaded completely. In some examples, the screen capture storage position: and (3) under a down/upload/case _1 item root directory, wherein the case _1 represents the uploaded screenshot of the first test case. There are n case _ n directories under the upload directory. Screen capture name: picture _ name ═ pic _20190610174943.png ", where 20190610174943 is YYYY-MM-DD-HH-MM-SS, the current time taken to avoid repetition.
Fig. 7 is a flowchart illustrating a method for testing a display page according to another exemplary embodiment of the present disclosure.
As shown in fig. 7, the method comprises the following steps:
step 102, obtaining a test case from a database.
The database comprises a plurality of test cases.
And 104, executing the test case to obtain a set page picture corresponding to the test case.
And 106, identifying the set page picture through the analysis model to obtain an identification result of whether the set page picture is correct or not.
Step 708, save the recognition result to the database.
Step 710, when the number of the identification results of the corresponding test cases stored in the database reaches a preset condition; and generating a test report based on the identification result in the database.
In this embodiment, after obtaining the identification result corresponding to the test case, the identification result is stored, and in order to improve the processing efficiency, optionally, the preset condition includes, but is not limited to, at least one of the following: the number of the recognition results is greater than or equal to a first preset number, the number of the correct results in the recognition results is greater than or equal to a second preset number, and the number of the error results in the recognition results is greater than or equal to a third preset number. The first preset quantity, the second preset quantity and the third preset quantity can be set according to specific requirements of users or the limitation of storage space, and therefore test reports can be generated more flexibly. Optionally, after the test report is generated, the test report may be sent to the relevant person according to a preset address, for example, a test report (for example, in an html format) is generated, and the relevant person is notified of the identification result in an email or IM format, for example, the test case is correct or incorrect, the page shows an incorrect test case, the sent test report may further include a corresponding set page picture, and the relevant person (for example, the test person) may correct the set page picture in the test report and the corresponding identification result.
Any kind of test method for display pages provided by the embodiments of the present disclosure may be executed by any suitable device with data processing capability, including but not limited to: terminal equipment, a server and the like. Alternatively, the method for testing any display page provided by the embodiments of the present disclosure may be executed by a processor, for example, the processor may execute the method for testing any display page mentioned in the embodiments of the present disclosure by calling a corresponding instruction stored in a memory. And will not be described in detail below.
Exemplary devices
Fig. 8 is a schematic structural diagram of a device for testing a display page according to an exemplary embodiment of the present disclosure. As shown in fig. 8, the present embodiment includes:
the use case obtaining module 81 is configured to obtain a test use case from a database.
The database comprises a plurality of test cases.
And the picture acquisition module 82 is used for executing the test case to obtain a set page picture corresponding to the test case.
And the image identification module 83 is configured to identify the set page image through the analysis model, and obtain an identification result of whether the set page image is correct.
And the test result module 84 is configured to determine a test result of the page corresponding to the test case based on the identification result.
The test device for displaying the page provided by the embodiment of the disclosure obtains the test case from the database; the database comprises a plurality of test cases; executing the test case to obtain a set page picture corresponding to the test case; identifying the set page picture through an analysis model to obtain an identification result of whether the set page picture is correct or not; determining a test result of a page corresponding to the test case based on the identification result; according to the embodiment, the set page image is identified through the analysis model, whether the page display is expected or not is macroscopically detected, whether the page layout is normal or not is detected, the testing speed is accelerated, and the testing efficiency is improved.
In some optional embodiments, the picture recognition module 83 includes:
the characteristic extraction module is used for extracting the regional characteristics of the set page picture through the analysis model;
and the result judging module is used for determining whether the set page picture is correct or not based on the result of the region feature extraction.
In some embodiments, the result determining module is specifically configured to determine whether at least one page feature obtained by extracting the regional feature matches with a plurality of set key features; when more than one page feature exists in the at least one page feature and the key feature is not matched, determining that the set page picture is wrong; otherwise, the setting page picture is determined to be correct.
In other embodiments, the result determining module is specifically configured to determine whether at least one page feature obtained by extracting the regional feature matches with a plurality of set key features; when the page features with the set number in the at least one page feature are matched with the key features, determining that the set page picture is correct; otherwise, determining that the set page picture is wrong.
Optionally, the apparatus provided in this embodiment further includes:
and the model training module is used for training the analysis model by utilizing the sample page set corresponding to the set page picture. Wherein the sample page set includes a plurality of correct sample page pictures and a plurality of incorrect sample page pictures.
Optionally, the image obtaining module 82 is specifically configured to start a browser and control the browser to run according to codes in the test case; and executing screen capture operation on a set page displayed in the process of executing the test case by the browser to acquire a set page picture.
Optionally, the image obtaining module 82 is configured to, when a screen capturing operation is performed on a set page displayed in a process of executing the test case by the browser to obtain a set page image, trigger the screen capturing operation to obtain the set page image when the browser displays the set page and the set page is loaded.
In some optional embodiments, the apparatus provided in this embodiment further includes:
the result storage module is used for storing the identification result into the database;
the report generation module is used for judging whether the number of the identification results of the corresponding test cases stored in the database reaches a preset condition; and generating a test report based on the identification result in the database.
Optionally, the preset condition comprises at least one of:
the number of the recognition results is greater than or equal to a first preset number, the number of the correct results in the recognition results is greater than or equal to a second preset number, and the number of the error results in the recognition results is greater than or equal to a third preset number.
Optionally, the test result module is specifically configured to respond that the recognition result indicates that the set page picture is correct, and the test result indicates that the page is correct; and responding to the recognition result representing the setting page picture error, and the test result representing the page error.
Exemplary electronic device
Next, an electronic apparatus according to an embodiment of the present disclosure is described with reference to fig. 9. The electronic device may be either or both of the first device 100 and the second device 200, or a stand-alone device separate from them that may communicate with the first device and the second device to receive the collected input signals therefrom.
FIG. 9 illustrates a block diagram of an electronic device in accordance with an embodiment of the disclosure.
As shown in fig. 9, the electronic device 90 includes one or more processors 91 and memory 92.
The processor 91 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 90 to perform desired functions.
Memory 92 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by the processor 91 to implement the method for testing display pages of the various embodiments of the present disclosure described above and/or other desired functions. Various contents such as an input signal, a signal component, a noise component, etc. may also be stored in the computer-readable storage medium.
In one example, the electronic device 90 may further include: an input device 93 and an output device 94, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
For example, when the electronic device is the first device 100 or the second device 200, the input device 93 may be a microphone or a microphone array as described above for capturing an input signal of a sound source. When the electronic device is a stand-alone device, the input means 93 may be a communication network connector for receiving the acquired input signals from the first device 100 and the second device 200.
The input device 93 may also include, for example, a keyboard, a mouse, and the like.
The output device 94 may output various information including the determined distance information, direction information, and the like to the outside. The output devices 94 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, among others.
Of course, for simplicity, only some of the components of the electronic device 90 relevant to the present disclosure are shown in fig. 9, omitting components such as buses, input/output interfaces, and the like. In addition, the electronic device 90 may include any other suitable components, depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the above-described methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in the method of testing a display page according to various embodiments of the present disclosure described in the "exemplary methods" section of this specification above.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform steps in a method of testing display pages according to various embodiments of the present disclosure described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, systems referred to in this disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the devices, apparatuses, and methods of the present disclosure, each component or step can be decomposed and/or recombined. These decompositions and/or recombinations are to be considered equivalents of the present disclosure.
The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (10)

1. A test method for a display page is characterized by comprising the following steps:
acquiring a test case from a database; the database comprises a plurality of test cases;
executing the test case to obtain a set page picture corresponding to the test case;
identifying the set page picture through an analysis model to obtain an identification result of whether the set page picture is correct or not;
and determining a test result of the page corresponding to the test case based on the identification result.
2. The method according to claim 1, wherein the identifying the set page picture through the analysis model to obtain an identification result of whether the set page picture is correct comprises:
extracting the regional characteristics of the set page picture through the analysis model;
and determining whether the set page picture is correct or not based on the result of the region feature extraction.
3. The method of claim 2, wherein determining whether the set page picture is correct based on the result of the region feature extraction comprises:
judging whether at least one page feature obtained by the regional feature extraction is matched with a plurality of set key features;
when more than one page feature exists in the at least one page feature and the key feature is not matched, determining that the set page picture is wrong; otherwise, determining that the set page picture is correct.
4. The method of claim 2, wherein determining whether the set page picture is correct based on the result of the region feature extraction comprises:
judging whether at least one page feature obtained by the regional feature extraction is matched with a plurality of set key features;
when a set number of page features in the at least one page feature are matched with the key features, determining that the set page picture is correct; otherwise, determining that the set page picture is wrong.
5. The method according to any one of claims 1 to 4, before identifying the set page picture through the analysis model to obtain an identification result of whether the set page picture is correct, further comprising:
training the analysis model by using a sample page set corresponding to the set page picture; the sample page set includes a plurality of correct sample page pictures and a plurality of incorrect sample page pictures.
6. The method according to any one of claims 1 to 5, wherein the executing the test case to obtain the set page picture corresponding to the test case comprises:
starting a browser, and controlling the browser to run according to codes in the test case;
and executing screen capture operation on a set page displayed in the process of executing the test case by the browser to acquire a set page picture.
7. The method according to claim 6, wherein the performing a screen capture operation on a set page displayed in the process of executing the test case by the browser to obtain the set page picture comprises:
and when the browser displays the set page and the set page is loaded, triggering screen capture operation to acquire the set page picture.
8. A test apparatus for displaying a page, comprising:
the case acquisition module is used for acquiring the test cases from the database; the database comprises a plurality of test cases;
the picture acquisition module is used for executing the test case to obtain a set page picture corresponding to the test case;
the image identification module is used for identifying the set page image through an analysis model to obtain an identification result of whether the set page image is correct or not;
and the test result module is used for determining the test result of the page corresponding to the test case based on the identification result.
9. A computer-readable storage medium, characterized in that the storage medium stores a computer program for executing the method for testing a display page according to any one of claims 1 to 7.
10. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is used for reading the executable instructions from the memory and executing the instructions to realize the test method of the display page of any one of the claims 1 to 7.
CN201911099427.0A 2019-11-12 2019-11-12 Display page testing method and device, storage medium and electronic equipment Pending CN111104308A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911099427.0A CN111104308A (en) 2019-11-12 2019-11-12 Display page testing method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911099427.0A CN111104308A (en) 2019-11-12 2019-11-12 Display page testing method and device, storage medium and electronic equipment

Publications (1)

Publication Number Publication Date
CN111104308A true CN111104308A (en) 2020-05-05

Family

ID=70420630

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911099427.0A Pending CN111104308A (en) 2019-11-12 2019-11-12 Display page testing method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN111104308A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181807A (en) * 2020-09-08 2021-01-05 支付宝(杭州)信息技术有限公司 Application program inspection method, device and equipment

Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150378876A1 (en) * 2014-06-25 2015-12-31 Vmware, Inc. Visual graphical user interface verification
WO2016095554A1 (en) * 2014-12-19 2016-06-23 广州博冠信息科技有限公司 Test method, device and system for application
CN106951302A (en) * 2017-04-28 2017-07-14 努比亚技术有限公司 Using the method for testing and terminal and computer-readable recording medium of the time of startup
CN107707561A (en) * 2017-11-01 2018-02-16 北京知道创宇信息技术有限公司 penetration testing method and device
CN107783898A (en) * 2017-07-24 2018-03-09 平安科技(深圳)有限公司 The method of testing and test equipment of Mobile solution
CN109901968A (en) * 2019-01-31 2019-06-18 阿里巴巴集团控股有限公司 A kind of automation page data method of calibration and device
CN110287094A (en) * 2019-05-20 2019-09-27 平安普惠企业管理有限公司 UI automated testing method, device and computer readable storage medium
CN110309463A (en) * 2018-02-28 2019-10-08 腾讯科技(深圳)有限公司 Land page optimization method, device, computer storage medium and the network equipment
WO2019196274A1 (en) * 2018-04-10 2019-10-17 平安科技(深圳)有限公司 Web page testing method and apparatus, electronic device, and medium
CN110377500A (en) * 2019-06-14 2019-10-25 平安科技(深圳)有限公司 Test method, device, terminal device and the medium of Website page
CN110399291A (en) * 2019-06-20 2019-11-01 平安普惠企业管理有限公司 User Page test method and relevant device based on image recognition

Patent Citations (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150378876A1 (en) * 2014-06-25 2015-12-31 Vmware, Inc. Visual graphical user interface verification
WO2016095554A1 (en) * 2014-12-19 2016-06-23 广州博冠信息科技有限公司 Test method, device and system for application
CN106951302A (en) * 2017-04-28 2017-07-14 努比亚技术有限公司 Using the method for testing and terminal and computer-readable recording medium of the time of startup
CN107783898A (en) * 2017-07-24 2018-03-09 平安科技(深圳)有限公司 The method of testing and test equipment of Mobile solution
CN107707561A (en) * 2017-11-01 2018-02-16 北京知道创宇信息技术有限公司 penetration testing method and device
CN110309463A (en) * 2018-02-28 2019-10-08 腾讯科技(深圳)有限公司 Land page optimization method, device, computer storage medium and the network equipment
WO2019196274A1 (en) * 2018-04-10 2019-10-17 平安科技(深圳)有限公司 Web page testing method and apparatus, electronic device, and medium
CN109901968A (en) * 2019-01-31 2019-06-18 阿里巴巴集团控股有限公司 A kind of automation page data method of calibration and device
CN110287094A (en) * 2019-05-20 2019-09-27 平安普惠企业管理有限公司 UI automated testing method, device and computer readable storage medium
CN110377500A (en) * 2019-06-14 2019-10-25 平安科技(深圳)有限公司 Test method, device, terminal device and the medium of Website page
CN110399291A (en) * 2019-06-20 2019-11-01 平安普惠企业管理有限公司 User Page test method and relevant device based on image recognition

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112181807A (en) * 2020-09-08 2021-01-05 支付宝(杭州)信息技术有限公司 Application program inspection method, device and equipment

Similar Documents

Publication Publication Date Title
CN111177005B (en) Service application testing method, device, server and storage medium
US9489292B2 (en) Devices and methods for acquiring abnormal information
CN109376078B (en) Mobile application testing method, terminal equipment and medium
CN110704304B (en) Application program testing method and device, storage medium and server
CN110825618B (en) Method and related device for generating test case
CN109815119B (en) APP link channel testing method and device
CN111552633A (en) Interface abnormal call testing method and device, computer equipment and storage medium
CN107133165B (en) Browser compatibility detection method and device
CN107294918B (en) Phishing webpage detection method and device
CN110297767B (en) Automatic execution method, device, equipment and storage medium for test cases
CN111309505A (en) Page exception handling method and device and electronic equipment
CN111949785A (en) Query statement management method and device, readable storage medium and electronic device
CN114996103A (en) Page abnormity detection method and device, electronic equipment and storage medium
CN112035412A (en) Data file importing method, device, storage medium and device
CN111598122A (en) Data verification method and device, electronic equipment and storage medium
CN110990264A (en) Element identification method, device and equipment for UI automation test and storage medium
CN110209577A (en) A kind of test method and device
CN111104308A (en) Display page testing method and device, storage medium and electronic equipment
JP2022055811A (en) Generation apparatus, generation method, and generation program
CN110276183B (en) Reverse Turing verification method and device, storage medium and electronic equipment
JP7029557B1 (en) Judgment device, judgment method and judgment program
CN111104328B (en) Use case generation method and device, computer equipment and readable storage medium
JP6798050B1 (en) Generator, generation method and generation program
CN114189709A (en) Method and device for auditing video, storage medium and electronic equipment
CN110659191B (en) Buried data analysis method, buried data analysis 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