CN112559362A - Automatic testing method and testing device for dynamic user interface - Google Patents

Automatic testing method and testing device for dynamic user interface Download PDF

Info

Publication number
CN112559362A
CN112559362A CN202011534407.4A CN202011534407A CN112559362A CN 112559362 A CN112559362 A CN 112559362A CN 202011534407 A CN202011534407 A CN 202011534407A CN 112559362 A CN112559362 A CN 112559362A
Authority
CN
China
Prior art keywords
data
user interface
configuration data
test
acquiring
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
CN202011534407.4A
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.)
Ping An Bank Co Ltd
Original Assignee
Ping An Bank 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 Ping An Bank Co Ltd filed Critical Ping An Bank Co Ltd
Priority to CN202011534407.4A priority Critical patent/CN112559362A/en
Publication of CN112559362A publication Critical patent/CN112559362A/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/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/955Retrieval from the web using information identifiers, e.g. uniform resource locators [URL]
    • 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)
  • Databases & Information Systems (AREA)
  • Data Mining & Analysis (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Human Computer Interaction (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention relates to the technical field of cloud testing, and provides an automatic testing method and a testing device for a user interface, wherein the method comprises the following steps: responding to the automatic test command, and acquiring front-end display data corresponding to the front-end user interface at different preset positions; acquiring back-end configuration data returned from the public interface based on the preset position; and comparing the back-end configuration data with the front-end display data to determine whether the front-end user interface passes the test. The present invention verifies the accuracy of data at different locations in the front-end user interface based on the back-end configuration data returned from the common interface. When the front-end user interface changes, the test program does not need to be modified, and only different back-end configuration data need to be acquired from the same public interface. Therefore, the purpose of automatically completing the user interface test without modifying the test program can be achieved, the test efficiency of the dynamic user interface is greatly improved, and the method has higher accuracy.

Description

Automatic testing method and testing device for dynamic user interface
Technical Field
The invention relates to the technical field of cloud testing, in particular to an automatic testing method and device of a dynamic user interface, computer equipment and a storage medium.
Background
The existing user interface testing technology generally aims at a static user interface, and sequentially compares whether each part in a front-end static user interface is consistent with tested data or not in a mode of directly writing the tested data in a background into a testing program. For a dynamic user interface which changes in real time, the mode of writing fixed data to be tested in a test program is not suitable any more, so that the test of the current dynamic user interface needs manual intervention. In addition, the existing user interface test is usually only applicable to single data, such as single image data or text data, and when the user interface simultaneously contains multiple objects, such as images, texts, links, etc., the comprehensive coverage cannot be achieved, resulting in poor test effect of the existing user interface.
Disclosure of Invention
The invention aims to provide a technical scheme capable of automatically testing a dynamic user interface so as to solve the problems in the prior art.
In order to achieve the above object, the present invention provides an automated testing method for a dynamic user interface, comprising the following steps:
responding to an automatic test command of the dynamic user interface, and acquiring front-end display data corresponding to different preset positions of the front-end user interface at the current moment;
determining a public interface address corresponding to the dynamic user interface, and acquiring back-end configuration data returned from the public interface address at the current moment based on the preset position;
and comparing the back-end configuration data with the front-end display data to determine whether the front-end user interface passes the test.
According to the automatic testing method provided by the invention, the step of responding to the automatic testing command and acquiring the front-end display data corresponding to the front-end user interface at different preset positions comprises the following steps:
and sequentially acquiring front-end display data corresponding to each position number in sequence, wherein the data types of the front-end display data comprise front-end screen capture data, front-end text data and front-end link data.
According to the automatic testing method provided by the invention, the step of acquiring the back-end configuration data returned from the public interface based on the preset position comprises the following steps:
determining the record number of the back-end configuration data in the preset database according to the position number of the front-end display data and the data type;
and searching corresponding back-end configuration data from a preset database according to the record number, wherein the types of the back-end configuration data comprise back-end URL address data, back-end text data and back-end link data.
According to the automatic testing method provided by the invention, the step of determining the record number of the back-end configuration data in the preset database according to the position number and the data type of the front-end display data comprises the following steps:
determining a target data table in the preset database according to the data type;
and determining the record number from the number mark data table according to the position number.
According to the automated testing method provided by the invention, the step of comparing the back-end configuration data with the front-end display data to determine whether the front-end user interface passes the test comprises the following steps:
on the basis that the front-end display data comprise front-end screen capture data, judging whether the back-end configuration data contain URL address data;
if so, acquiring a storage image corresponding to the URL address data, and comparing whether the storage image is the same as the front-end screen capture data;
on the basis that the front-end display data comprises front-end text data, judging whether the back-end configuration data comprises back-end text data;
if yes, acquiring the back-end text data, and comparing whether the back-end text data is the same as the front-end text data;
on the basis that the front-end display data comprises front-end link data, judging whether the back-end configuration data comprises back-end link data;
if so, acquiring the back-end link data, and comparing whether the back-end link data is the same as the front-end link data;
and determining that the UI passes the test on the basis that the stored image is the same as the front-end screen capture data, the rear-end text data is the same as the front-end text data, and the rear-end link data is the same as the front-end link data.
According to the automatic testing method provided by the invention, the step of comparing whether the stored image and the front-end screen capture data are the same comprises the following steps:
setting the stored image and the front-end screen capture data to be the same size;
respectively calculating a first gray level histogram of the stored image and a second gray level histogram of the front-end screen capture image;
calculating the similarity between the first gray level histogram and the second gray level histogram;
and when the similarity is larger than a preset threshold value, determining that the stored image is the same as the front-end screen capture data.
According to the automatic test method provided by the invention, the automatic test command is sent out based on a timing task or based on the change of the preset database.
In order to achieve the above object, the present invention further provides an automatic testing apparatus for a dynamic user interface, comprising:
the front-end data acquisition module is suitable for responding to an automatic test command of the dynamic user interface and acquiring front-end display data corresponding to the front-end user interface at different preset positions at the current moment;
the back-end data acquisition module is suitable for determining a public interface address corresponding to the dynamic user interface and acquiring back-end configuration data returned from the public interface address at the current moment based on the preset position;
and the comparison module is suitable for comparing the back-end configuration data with the front-end display data so as to determine whether the front-end user interface passes the test.
To achieve the above object, the present invention further provides a computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the steps of the above method when executing the computer program.
To achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a computer program which, when being executed by a processor, carries out the steps of the above method.
The automatic test method and the test device for the user interface provided by the invention can accurately and automatically test the dynamically changed user interface. The present invention verifies the accuracy of data at different locations in the front-end user interface based on the back-end configuration data returned from the common interface. When the front-end user interface changes, the test program does not need to be modified, and only different back-end configuration data need to be acquired from the same public interface. Therefore, the purpose of automatically completing the user interface test without modifying the test program can be achieved, the test efficiency of the dynamic user interface is greatly improved, and the method has higher accuracy.
Drawings
FIG. 1 is a flowchart of a first embodiment of a method for automated testing of a user interface according to the present invention;
FIG. 2 is a diagram illustrating a front-end user interface for dividing a plurality of regions according to an embodiment of the present invention;
FIG. 3 is a schematic flow chart of comparing whether the stored image and the front-end screenshot data are the same according to a first embodiment of the present invention;
FIG. 4 is a schematic diagram of program modules of an automatic test apparatus according to a first embodiment of the present invention;
fig. 5 is a schematic diagram of a hardware structure of an automated testing apparatus according to a first embodiment of the invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
The automatic test method and the test device for the user interface provided by the invention can accurately and automatically test the dynamically changed user interface. The present invention verifies the accuracy of data at different locations in the front-end user interface based on the back-end configuration data returned from the common interface. When the front-end user interface changes, the test program does not need to be modified, and only different back-end configuration data need to be acquired from the same public interface. Therefore, the purpose of automatically completing the user interface test without modifying the test program can be achieved, the test efficiency of the dynamic user interface is greatly improved, and the method has higher accuracy.
Example one
Referring to fig. 1, the present embodiment provides an automated testing method for a dynamic user interface, including the following steps:
and S100, responding to an automatic test command of the dynamic user interface, and acquiring front-end display data corresponding to the front-end user interface at different preset positions at the current moment.
A dynamic user interface refers to an interface in which the front-end user interface changes over time. Unlike a static user interface, the content presented by a dynamic user interface may not be the same at different times. This can present difficulties to existing automated testing processes. It will be appreciated that the front-end user interface is actually a visual representation of the back-end configuration data, and thus changes to the front-end user interface are actually the result of changes to the back-end configuration data. Therefore, the present embodiment simultaneously obtains the front-end user interface and the back-end configuration data that may be changed, and compares the two data to realize automatic testing.
The invention can build an automatic test system based on jenkins engineering, and can perform automatic test on the front-end user interface on the basis of receiving an automatic test command. It can be understood that the specific content displayed by the front-end user interface corresponds to the configuration data contained in the back-end configuration file, and ideally, the specific content displayed by the front-end user interface is completely consistent with the configuration data contained in the back-end configuration file. When the inconsistency is detected, it indicates that the defect needing debugging exists in the test program or the configuration file. And the interface test is used for finding problems in time and reporting the problems to related operation and maintenance personnel, so that the stability of the system is ensured.
In one example, the automatic test command may be issued based on a timed task or based on a change in a backend profile. Configuration data typically associated with the backend profiles is stored in a database. The invention can monitor the change condition of the database in real time, and can directly trigger the automatic test command when the data in the database is increased, deleted or changed.
As previously mentioned, the front-end user interface may change over time. The automatic test procedure of the present embodiment therefore has stringent requirements with regard to timeliness. When receiving the automatic test command, the display data of the front-end user interface needs to be immediately acquired at the current moment. In consideration of network latency, a first time difference threshold value between a first time when the automatic test command is received and a first time when the display data is acquired may be set. When the time difference is smaller than the first time difference threshold value, the acquired display data can be considered to be effective; in the case where the time difference is greater than or equal to the first time difference threshold, the acquired presentation data may be considered invalid. Thereby avoiding the condition of inaccurate test caused by the change of the dynamic user interface along with the time. Furthermore, the invention can divide the front-end user interface into different areas, and each area can correspond to a unique preset position number. On the basis, the automatic test device respectively carries out automatic test on different preset position numbers in sequence.
S200, determining a public interface address corresponding to the dynamic user interface, and acquiring back-end configuration data returned from the public interface address at the current time based on the preset position.
In order to ensure that the dynamically changed backend configuration data can be accurately acquired, in this embodiment, a corresponding public interface address may be set for each dynamic user interface, and the corresponding backend configuration data is uniformly acquired through the public interface address. For example, a mapping relationship between the dynamic user interface 1 and the public interface address 1 is set, and the mapping relationship may be stored in a corresponding location of the server in advance. When the dynamic user interface 1 needs to be automatically tested, the public interface address 1 corresponding to the dynamic user interface 1 can be obtained from the server, and then the back-end configuration data corresponding to the dynamic user interface 1 can be obtained from the public interface address 1. The common interface address 1 may point to a preset first database. It will be appreciated that when the backend configuration data stored in the first database changes, the dynamic user interface 1 will change accordingly. Based on this, the background maintenance personnel can change the background configuration data stored in the first database according to the requirement. Therefore, the acquired background configuration data can be ensured to be the latest changed data through the uniform public interface address. In consideration of the requirement of timeliness, the present embodiment may set the second time difference threshold between the first time when the automatic test command is received and the second time when the backend configuration data is acquired. Wherein the second time difference threshold is greater than the first time difference threshold. When the time difference is smaller than the second time difference threshold, the acquired backend configuration data can be considered to be valid; in the case where the time difference is greater than or equal to the second time difference threshold, the acquired backend configuration data may be considered invalid.
As previously mentioned, the front-end user interface may be divided into a number of different regions. Specifically, the user interface may be first divided into a plurality of primary regions, and each primary region is further divided into a plurality of secondary regions. For example, the user interface is divided into a plurality of primary regions a1 and a2 … … An in the order from top to bottom, and then divided into a plurality of secondary regions Ak1 and Ak2 … … Akm for each primary region Ak in the order from left to right, as shown in fig. 2. Taking the e-commerce type user interface as an example, the primary area may include a food area, an electrical appliance area, a cosmetic area, etc., and the secondary area below the food area may include a grain and oil area, a fresh area, a snack area, etc. By dividing a plurality of areas on the front-end user interface, different picture data, character data, link data and the like can be conveniently displayed according to the areas, and the data maintenance and management of a background are facilitated.
The back-end configuration data in the invention can be obtained through a uniform public interface, a corresponding preset database can be accessed by calling the public interface, and the database stores back-end configuration data, such as description data records, on how to display the front-end user interface. The description data record may include a plurality of pieces, each piece corresponding to a preset position in the front-end user interface. The preset position in this embodiment may correspond to different areas in the front-end user interface, for example, the preset position 1 corresponds to the area Ak1, and the preset position 2 corresponds to the area Ak 2. The number of the preset position in the user interface to be tested is L, and the L-th description data record can be correspondingly obtained from the database.
S300, comparing the back-end configuration data with the front-end display data to determine whether the front-end user interface passes the test.
The data type of the front-end user interface in the invention at each preset position can comprise front-end image data, front-end text data and front-end link data. The front-end image data refers to displaying one or more images at a preset position, the front-end text data refers to displaying a piece of text at the preset position, and the front-end link data refers to displaying a network link address at the preset position. Correspondingly, the description data record type of the back-end configuration data comprises URL address data, back-end text data and back-end link data. The URL address data is used for describing the address of an image to be displayed at the preset position of the front-end user interface, the back-end text data is used for describing the text to be displayed at the preset position of the front-end user interface, and the back-end link data is used for describing the network link address to be displayed at the preset position of the front-end user interface.
Comparing the back-end configuration data with the front-end display data, wherein the comparing comprises comparing the front-end display data and the back-end configuration data with different types respectively. When the front-end user interface contains image data at a preset position, acquiring corresponding URL address data from a description data record of a rear end; when the front-end user interface contains text data at a preset position, acquiring corresponding back-end text data from a description data record of the back end; when the front-end user interface contains the link data at the preset position, the invention acquires the corresponding back-end link data from the description data record of the back end. Specifically, for the description data records stored in the database, what type of data is specifically contained in the description data record may be represented by different keywords. For example, URL address data type may be represented by URL, backend text data type may be represented by txt, and backend link data type may be represented by backend link data. Therefore, the front-end display data contains different data types, and specific description data records in the back-end configuration data can be acquired through the preset position numbers and the corresponding keywords.
In one example, comparing the back-end configuration data with the front-end presentation data to determine whether the front-end user interface passes the test comprises:
on the basis that the front-end display data comprise front-end screen capture data, judging whether the back-end configuration data contain URL address data; and if so, acquiring a storage image corresponding to the URL address data, and comparing whether the storage image is the same as the front-end screen capture data. The URL address data in the back-end configuration data is used for positioning a storage address, and the storage address stores a storage image which needs to be displayed on the front-end user interface. Therefore, accurate information of the image to be displayed on the front-end user interface can be obtained through the URL address. Therefore, by comparing the stored image with the front-end screen capture data, whether the image displayed in the front-end user interface is correct or complete or not, whether the display effect meets the requirements or not and the like can be determined. The specific comparison method between the stored image and the front-end screenshot data can be implemented by any image comparison algorithm in the prior art, for example, an SSIM structural similarity algorithm, a perceptual hash algorithm, an image template matching algorithm, and the like, and the comparison in this embodiment is not limited.
On the basis that the front-end display data comprises front-end text data, judging whether the back-end configuration data comprises back-end text data; and if so, acquiring the back-end text data, and comparing whether the back-end text data is the same as the front-end text data. The back-end text data and the front-end text data may be stored in the form of character strings. The similarity comparison between the back-end text data and the front-end text data can be realized by any existing text comparison algorithm, for example, a cosine similarity reference algorithm, a word shift distance algorithm, a Smooth Inverse Frequency algorithm, a pre-training encoder algorithm, and the like are used, which is not limited in this embodiment.
On the basis that the front-end display data comprises front-end link data, judging whether the back-end configuration data comprises back-end link data; and if so, acquiring the back-end link data, and comparing whether the back-end link data is the same as the front-end link data. By comparing the front-end link data with the back-end link data, whether the link address error condition exists in the front-end user interface can be found in time. The front-end link data and the back-end link data can be compared by a simple character string, the link data includes characters, and the existing text comparison method can be used, which is not limited in this embodiment.
And determining that the UI passes the test on the basis that the stored image is the same as the front-end screen capture data, the rear-end text data is the same as the front-end text data, and the rear-end link data is the same as the front-end link data.
It will be appreciated that the front-end user interface may contain multiple data types, such as both images and text and links, at the preset location. In this case, each type in the front-end presentation data needs to be compared with the corresponding type in the back-end configuration data. When all data types are the same, the representation front-end user interface passes the test; if any of the data types are different, the characterization front-end user interface fails the test. At the moment, related operation and maintenance personnel can be timely notified to carry out debugging in a prompt message sending mode, so that the accuracy of a user interface is ensured.
In one example, the location number of the front-end presentation data may include a primary region number and a secondary region number. The primary area number represents an interface area where the front-end display data is located, for example, in an e-commerce user interface, the interface area may include a food area, a clothing area, a home appliance area, and the like, and each primary area number may be represented by a combination of letters, numbers, or other symbols. The secondary area numbers may be different objects under each primary area, such as televisions, refrigerators, washing machines, etc. in the home area, and each secondary area number may also be represented by a combination of letters, numbers, or other symbols, etc. It will be understood by those skilled in the art that the position numbers in the present invention can be divided into multi-level regions as required, and are not limited to the above-mentioned two-level regions.
As previously mentioned, the backend configuration data may be stored in a preset database. In one example, the preset layout library may store a plurality of data tables, each corresponding to a data type, such as a URL address data table, a backend text data table, and a backend link data table. When the back-end configuration data is obtained based on the position number of the front-end display text, the target data table in the preset database may be determined according to the data type, and then the record number may be determined from the number label data table according to the position number. Through the steps, the corresponding back-end configuration data can be acquired more accurately and rapidly.
Illustratively, the schematic flowchart of the present invention for comparing whether the stored image and the front-end screenshot data are the same is shown in fig. 3, and comprises the following steps:
and S310, setting the storage image and the front-end screen capture data to be the same size.
It is understood that the image size of the front-end screenshot data in this embodiment is related to the size of the presentation area in the user interface, and thus the actual size of the stored image corresponding to the back-end configuration data may not be the same. For the convenience of subsequent comparison, the present embodiment first sets the stored image and the front-end screen capture data to the same size. Generally, the size of the image with larger size in the two images can be converted into the smaller image, so that the useful information in the image can be ensured not to be lost.
And S320, respectively calculating a first gray level histogram of the stored image and a second gray level histogram of the front-end screen capture image.
The gray level histogram is used for describing the gray level distribution condition in the image, and can intuitively show the proportion of each gray level in the image. In the grayscale histogram, the abscissa generally represents the grayscale level, and the ordinate represents the frequency of occurrence of the corresponding grayscale level. In this embodiment, the grayscale histogram corresponding to the stored image is used as the first grayscale histogram, and the grayscale histogram corresponding to the front-end screenshot image is used as the second grayscale histogram.
And S330, calculating the similarity between the first gray level histogram and the second gray level histogram. The overall similarity between two gray level histograms, srike, may comprise a weighted sum between the sub-similarities S of multiple gray level frequencies, which may be formulated as S α S1+ β S2+ … … + γ sn. Where α and β … … γ respectively represent the weight value of each gray level, and can be specifically set according to the actual situation of different images.
And S340, when the similarity is larger than a preset threshold value, determining that the stored image is the same as the front-end screen capture data.
Through the steps, the comparison between the image in the user interface and the image in the back-end configuration file can be accurately and quickly realized. It can be understood that the proportion of the images in the user interface is usually larger, so that the images are accurately compared, and the efficiency of the user interface test is improved.
Referring to fig. 4, the automated testing apparatus 40 for a user interface is shown, in the embodiment, the automated testing apparatus for a user interface may include or be divided into one or more program modules, and the one or more program modules are stored in a storage medium and executed by one or more processors to implement the present invention and implement the automated testing method. The program modules referred to herein are a series of computer program instruction segments that are capable of performing a specified function and are more suitable than the program itself for describing the execution of the automated test equipment 40 on a storage medium. The following description will specifically describe the functions of the program modules of the present embodiment:
the front-end data obtaining module 41 is adapted to respond to an automatic test command of the dynamic user interface, and obtain front-end display data corresponding to different preset positions of the front-end user interface at the current time;
a back-end data obtaining module 42, adapted to determine a public interface address corresponding to the dynamic user interface, and obtain back-end configuration data returned from the public interface address based on the preset position;
a comparison module 43 adapted to compare the back-end configuration data with the front-end display data to determine whether the front-end user interface passes the test.
The embodiment also provides a computer device, such as a smart phone, a tablet computer, a notebook computer, a desktop computer, a rack server, a blade server, a tower server or a rack server (including an independent server or a server cluster composed of a plurality of servers) capable of executing programs, and the like. The computer device 50 of the present embodiment includes at least, but is not limited to: a memory 51, a processor 52, which may be communicatively coupled to each other via a system bus, as shown in FIG. 5. It is noted that fig. 5 only shows a computer device 50 with components 51-52, but it is to be understood that not all shown components are required to be implemented, and that more or fewer components may be implemented instead.
In this embodiment, the memory 51 (i.e., a readable storage medium) includes a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, and the like. In some embodiments, the storage 51 may be an internal storage unit of the computer device 50, such as a hard disk or a memory of the computer device 50. In other embodiments, the memory 51 may be an external storage device of the computer device 50, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), or the like, provided on the computer device 50. Of course, the memory 51 may also include both internal and external storage devices for the computer device 50. In this embodiment, the memory 51 is generally used for storing an operating system and various application software installed on the computer device 50, such as the program code of the automatic testing apparatus 40 in the first embodiment. Further, the memory 51 may also be used to temporarily store various types of data that have been output or are to be output.
Processor 52 may be a Central Processing Unit (CPU), controller, microcontroller, microprocessor, or other data Processing chip in some embodiments. The processor 52 generally serves to control the overall operation of the computer device 50. In this embodiment, the processor 52 is configured to run the program code stored in the memory 51 or process data, for example, run the automatic testing apparatus 40, so as to implement the automatic testing method according to the first embodiment.
The present embodiment also provides a computer-readable storage medium, such as a flash memory, a hard disk, a multimedia card, a card-type memory (e.g., SD or DX memory, etc.), a Random Access Memory (RAM), a Static Random Access Memory (SRAM), a read-only memory (ROM), an electrically erasable programmable read-only memory (EEPROM), a programmable read-only memory (PROM), a magnetic memory, a magnetic disk, an optical disk, a server, an App application mall, etc., on which a computer program is stored, which when executed by a processor implements corresponding functions. The computer readable storage medium of the embodiment is used for storing an automatic testing apparatus 40, and when being executed by a processor, the automatic testing apparatus implements the automatic testing method of the first embodiment.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
Any process or method descriptions in flow charts or otherwise described herein may be understood as representing modules, segments, or portions of code which include one or more executable instructions for implementing specific logical functions or steps of the process, and alternate implementations are included within the scope of the preferred embodiment of the present invention in which functions may be executed out of order from that shown or discussed, including substantially concurrently or in reverse order, depending on the functionality involved, as would be understood by those reasonably skilled in the art of the present invention.
It will be understood by those skilled in the art that all or part of the steps carried by the method for implementing the above embodiments may be implemented by hardware related to instructions of a program, which may be stored in a computer readable medium, and when executed, the program includes one or a combination of the steps of the method embodiments.
In the description herein, references to the description of the term "one embodiment," "some embodiments," "an example," "a specific example" or "some examples" or the like are intended to mean that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the invention. In this specification, the schematic representations of the terms used above do not necessarily refer to the same embodiment or example. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
Through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (10)

1. An automated testing method for a dynamic user interface, comprising the steps of:
responding to an automatic test command of the dynamic user interface, and acquiring front-end display data corresponding to different preset positions of the front-end user interface at the current moment;
determining a public interface address corresponding to the dynamic user interface, and acquiring back-end configuration data returned from the public interface address at the current moment based on the preset position;
comparing the back-end configuration data with the front-end display data to determine whether the front-end user interface passes the test.
2. The automated testing method of claim 1, wherein the step of obtaining front-end display data corresponding to the front-end user interface at different preset positions in response to the automated testing command comprises:
and sequentially acquiring front-end display data corresponding to each position number in sequence, wherein the data types of the front-end display data comprise front-end screen capture data, front-end text data and front-end link data.
3. The automated testing method of claim 2, wherein the step of obtaining backend configuration data returned from the common interface based on the preset location comprises:
determining the record number of the back-end configuration data in the preset database according to the position number of the front-end display data and the data type;
and searching corresponding back-end configuration data from a preset database according to the record number, wherein the types of the back-end configuration data comprise back-end URL address data, back-end text data and back-end link data.
4. The automated testing method of claim 3, wherein the step of determining the record number of the backend configuration data in the preset database according to the location number and the data type of the front-end display data comprises:
determining a target data table in the preset database according to the data type;
and determining the record number from the number mark data table according to the position number.
5. The automated testing method of claim 3 or 4, wherein the step of comparing the back-end configuration data with the front-end presentation data to determine whether a front-end user interface passes the test comprises:
on the basis that the front-end display data comprise front-end screen capture data, judging whether the back-end configuration data contain URL address data;
if so, acquiring a storage image corresponding to the URL address data, and comparing whether the storage image is the same as the front-end screen capture data;
on the basis that the front-end display data comprises front-end text data, judging whether the back-end configuration data comprises back-end text data;
if yes, acquiring the back-end text data, and comparing whether the back-end text data is the same as the front-end text data;
on the basis that the front-end display data comprises front-end link data, judging whether the back-end configuration data comprises back-end link data;
if so, acquiring the back-end link data, and comparing whether the back-end link data is the same as the front-end link data;
and determining that the UI passes the test on the basis that the stored image is the same as the front-end screen capture data, the rear-end text data is the same as the front-end text data, and the rear-end link data is the same as the front-end link data.
6. The automated testing method of claim 5, wherein the step of comparing whether the stored image and the front-end screenshot data are the same comprises:
setting the stored image and the front-end screen capture data to be the same size;
respectively calculating a first gray level histogram of the stored image and a second gray level histogram of the front-end screen capture image;
calculating the similarity between the first gray level histogram and the second gray level histogram;
and when the similarity is larger than a preset threshold value, determining that the stored image is the same as the front-end screen capture data.
7. The automated testing method of claim 1, wherein the automated test command is issued based on a timed task or based on a change in the preset database.
8. An automated testing apparatus for a dynamic user interface, comprising:
the front-end data acquisition module is suitable for responding to an automatic test command of the dynamic user interface and acquiring front-end display data corresponding to the front-end user interface at different preset positions at the current moment;
the back-end data acquisition module is suitable for determining a public interface address corresponding to the dynamic user interface and acquiring back-end configuration data returned from the public interface address at the current moment based on the preset position;
and the comparison module is suitable for comparing the back-end configuration data with the front-end display data so as to determine whether the front-end user interface passes the test.
9. A computer device comprising a memory, a processor and a computer program stored on the memory and executable on the processor, characterized in that the steps of the method of any of claims 1 to 7 are implemented by the processor when executing the computer program.
10. A computer-readable storage medium, on which a computer program is stored, which, when being executed by a processor, carries out the steps of the method of any one of claims 1 to 7.
CN202011534407.4A 2020-12-23 2020-12-23 Automatic testing method and testing device for dynamic user interface Pending CN112559362A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011534407.4A CN112559362A (en) 2020-12-23 2020-12-23 Automatic testing method and testing device for dynamic user interface

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011534407.4A CN112559362A (en) 2020-12-23 2020-12-23 Automatic testing method and testing device for dynamic user interface

Publications (1)

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

Family

ID=75032217

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011534407.4A Pending CN112559362A (en) 2020-12-23 2020-12-23 Automatic testing method and testing device for dynamic user interface

Country Status (1)

Country Link
CN (1) CN112559362A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115248585A (en) * 2022-09-20 2022-10-28 平安银行股份有限公司 Automatic test execution method based on controller engine, controller and system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110688297A (en) * 2019-02-25 2020-01-14 上海核工程研究设计院有限公司 Automatic test method for computational logic configuration
CN110798445A (en) * 2019-09-12 2020-02-14 中国平安财产保险股份有限公司 Public gateway interface testing method and device, computer equipment and storage medium
US20200089597A1 (en) * 2018-09-19 2020-03-19 Servicenow, Inc. Automated webpage testing
US20200394054A1 (en) * 2019-06-13 2020-12-17 Atlassian Pty Ltd. User interface interaction optimization system and method to detect and display a correlation between a user interface variation and a user interaction goal

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20200089597A1 (en) * 2018-09-19 2020-03-19 Servicenow, Inc. Automated webpage testing
CN110688297A (en) * 2019-02-25 2020-01-14 上海核工程研究设计院有限公司 Automatic test method for computational logic configuration
US20200394054A1 (en) * 2019-06-13 2020-12-17 Atlassian Pty Ltd. User interface interaction optimization system and method to detect and display a correlation between a user interface variation and a user interaction goal
CN110798445A (en) * 2019-09-12 2020-02-14 中国平安财产保险股份有限公司 Public gateway interface testing method and device, computer equipment and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张鹏: "动态图形设计在用户界面交互设计中的易用性研究", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》, no. 02, pages 138 - 2116 *
黄春豪: "Android用户界面自动化测试辅助工具的开发与应用", 《中国优秀硕士学位论文全文数据库 (信息科技辑)》, no. 02, 15 February 2017 (2017-02-15), pages 138 - 1523 *

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115248585A (en) * 2022-09-20 2022-10-28 平安银行股份有限公司 Automatic test execution method based on controller engine, controller and system

Similar Documents

Publication Publication Date Title
CN110337641B (en) Determining application test results using screen shot primitive data
CN110704297B (en) Code review method, device, computer equipment and storage medium
CN113448862B (en) Software version testing method and device and computer equipment
US10878024B2 (en) Dynamic thumbnails
CN109508189B (en) Layout template processing method and device and computer readable storage medium
CN111144493B (en) Method for automatically identifying algorithm index test, storage medium and electronic terminal
CN113127482B (en) Data quality analysis method, device, computer equipment and storage medium
CN110765015A (en) Method for testing application to be tested and electronic equipment
CN111435367A (en) Knowledge graph construction method, system, equipment and storage medium
CN110580284A (en) Entity disambiguation method and device, computer equipment and storage medium
CN113946510A (en) WEB page testing method, device and equipment and computer storage medium
CN111737443A (en) Answer text processing method and device and key text determining method
CN113342692B (en) Automatic test case generation method and device, electronic equipment and storage medium
CN111966600B (en) Webpage testing method, webpage testing device, computer equipment and computer readable storage medium
CN112559362A (en) Automatic testing method and testing device for dynamic user interface
CN114185791A (en) Method, device and equipment for testing data mapping file and storage medium
CN113051235A (en) Document loading method and device, terminal and storage medium
CN112035605A (en) Topic recommendation method, device, equipment and storage medium
CN109739752B (en) Built-in resource testing method and device, electronic equipment and readable storage medium
CN111124862A (en) Intelligent equipment performance testing method and device and intelligent equipment
CN113642642B (en) Control identification method and device
CN111338941B (en) Information processing method and device, electronic equipment and storage medium
US11397662B2 (en) Method for debugging computer program, device employing method, and storage medium
CN112329854B (en) Method and device for checking picture cutting of advertisement material
WO2021036599A1 (en) Method and apparatus for testing set top box, set top box, 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