CN114625667A - Page testing method, device, equipment, storage medium and program product - Google Patents

Page testing method, device, equipment, storage medium and program product Download PDF

Info

Publication number
CN114625667A
CN114625667A CN202210327778.8A CN202210327778A CN114625667A CN 114625667 A CN114625667 A CN 114625667A CN 202210327778 A CN202210327778 A CN 202210327778A CN 114625667 A CN114625667 A CN 114625667A
Authority
CN
China
Prior art keywords
page
control
information
text vector
image information
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
CN202210327778.8A
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.)
Industrial and Commercial Bank of China Ltd ICBC
Original Assignee
Industrial and Commercial Bank of China Ltd ICBC
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 Industrial and Commercial Bank of China Ltd ICBC filed Critical Industrial and Commercial Bank of China Ltd ICBC
Priority to CN202210327778.8A priority Critical patent/CN114625667A/en
Publication of CN114625667A publication Critical patent/CN114625667A/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/362Software debugging
    • G06F11/3644Software debugging by instrumenting at runtime
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F3/00Input arrangements for transferring data to be processed into a form capable of being handled by the computer; Output arrangements for transferring data from processing unit to output unit, e.g. interface arrangements
    • G06F3/01Input arrangements or combined input and output arrangements for interaction between user and computer
    • G06F3/048Interaction techniques based on graphical user interfaces [GUI]
    • G06F3/0484Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range
    • G06F3/04845Interaction techniques based on graphical user interfaces [GUI] for the control of specific functions or operations, e.g. selecting or manipulating an object, an image or a displayed text element, setting a parameter value or selecting a range for image manipulation, e.g. dragging, rotation, expansion or change of colour

Landscapes

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

Abstract

The disclosure provides a page testing method which can be applied to the financial field. The page testing method comprises the following steps: responding to the skip operation of the page, and performing screenshot operation on the page to acquire initial page image information; processing the initial page image information to determine target page image information, wherein the target page image information only comprises control object information; determining a target text vector according to the control object information; comparing the target text vector with a reference text vector to obtain a comparison result, wherein the reference text vector is determined according to historical running information of a test script of the page; and determining a page test result according to the comparison result. The disclosure also provides a page testing apparatus, a device, a storage medium and a program product.

Description

Page testing method, device, equipment, storage medium and program product
Technical Field
The present disclosure relates to the field of software testing technologies, and in particular, to the field of interface testing technologies, and more particularly, to a page testing method, apparatus, device, storage medium, and program product.
Background
In the end-to-end testing process of the page UI (User Interface, UI), an automated test is usually performed by using a principle of identifying the object attribute based on the page control, and compared with other principles, for example, a test is performed based on an image identification principle or a Windows handle identification principle, the method of identifying the object attribute based on the page control has the advantages of high identification accuracy, high operating efficiency and simple automatic script preservation and maintenance.
However, although the automatic testing mode based on the browser page control attribute identification is used, functional verification can be efficiently and quickly completed on the tested business process, and functions such as verification of the check point can be realized, compared with manual testing, the method has a great limitation, the accuracy judgment cannot be carried out on the visual effect displayed by each control element in the system page in the browser, namely the problem that the page control display pairing error cannot be found in time, the automatic verification of the testing target cannot be realized in the automatic testing process, and the testing efficiency is further reduced.
It is noted that the information disclosed in the above background section is only for enhancement of understanding of the background of the present disclosure and therefore may include information that does not constitute prior art that is already known to a person of ordinary skill in the art.
Disclosure of Invention
In view of the above, the present disclosure provides a page testing method, apparatus, device, storage medium, and program product.
According to a first aspect of the present disclosure, there is provided a page testing method, including:
responding to the skip operation of the page, and performing screenshot operation on the page to acquire initial page image information;
processing the initial page image information to determine target page image information, wherein the target page image information only comprises control object information;
determining a target text vector according to the control object information;
comparing the target text vector with a reference text vector to obtain a comparison result, wherein the reference text vector is determined according to historical running information of a test script of the page; and
and determining a page test result according to the comparison result.
According to an embodiment of the present disclosure, the control object information includes control name information and control position information, and the determining a target text vector according to the control object information includes:
determining the position information of the control corresponding to the input box according to the position information of the control;
determining control name position information according to the position information of the input box; and
and generating a target text vector according to the control name position information.
According to an embodiment of the present disclosure, the generating a target text vector according to the control name position information includes:
determining the name of the control according to the name and position information of the control; and
and traversing the control names according to the position information of the control names and the preset sequence to obtain a target text vector.
According to an embodiment of the present disclosure, the processing the initial page image information to determine the target page image information includes:
determining control object information of a page according to the initial page image information; and
and deleting the initial page image information according to the control object information to determine target page image information.
According to an embodiment of the present disclosure, the determining control object information of a page according to the initial page image information includes:
identifying display characteristics of a control according to characteristics of input items, wherein the input items comprise a text input box, a radio box, a selection box, a date input box and a text field; and
and determining control name information and control position information according to the control display characteristics.
According to an embodiment of the present disclosure, the deleting the initial page image information according to the control object information to determine the target page image information includes:
determining control position information;
deleting interface information except the control name information and the control position information;
and generating target page image information.
According to an embodiment of the present disclosure, the comparing the target text vector with the reference text vector to obtain a comparison result includes:
acquiring a reference text vector according to the script of the page; and
and comparing the control names in the reference text vector with the control names in the target text vector one by one in sequence to generate a comparison result.
According to an embodiment of the present disclosure, further comprising:
and when the test script of the page is determined to be run for the first time, storing the target text vector as a reference text vector.
According to a second aspect of the present disclosure, there is provided a page testing apparatus, comprising:
the screenshot module is used for responding to the skip operation of the page and performing screenshot operation on the page to acquire initial page image information;
the image processing module is used for processing the initial page image information to determine target page image information, and the target page image information only comprises control object information;
the first determining module is used for determining a target text vector according to the control object information;
the comparison module is used for comparing the target text vector with a reference text vector to obtain a comparison result, wherein the reference text vector is determined according to historical running information of the test script of the page; and
and the second determining module is used for determining a page test result according to the comparison result.
According to an embodiment of the present disclosure, further comprising:
and the third determining module is used for saving the target text vector as a reference text vector when the test script of the page is determined to be in initial operation.
A third aspect of the present disclosure provides an electronic device, comprising: one or more processors; a memory for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the page test method described above.
A fourth aspect of the present disclosure also provides a computer-readable storage medium having stored thereon executable instructions that, when executed by a processor, cause the processor to perform the above-described page testing method.
A fifth aspect of the present disclosure also provides a computer program product comprising a computer program which, when executed by a processor, implements the above-described page testing method.
According to the page testing method provided by the disclosure, screenshot operation is carried out on a page to be tested through a testing script of an operating page, initial page image information is obtained, and in order to improve image processing efficiency and image identification accuracy, the initial page image information is processed to determine target page image information; the method comprises the steps of obtaining traversal path information of a page control name based on a target page image, storing the traversal path information as a target text vector, comparing the target text vector with a reference text vector, and finding out the problem of control display dislocation in time.
Drawings
The foregoing and other objects, features and advantages of the disclosure will be apparent from the following description of embodiments of the disclosure, which proceeds with reference to the accompanying drawings, in which:
FIG. 1 schematically illustrates an application scenario diagram of a page testing method, apparatus, device, storage medium and program product according to embodiments of the disclosure;
FIG. 2 schematically shows a flow diagram of a page testing method according to an embodiment of the present disclosure;
FIG. 3 schematically illustrates a flow chart of a method of page testing in accordance with an embodiment of the present disclosure;
FIG. 4a schematically shows one of the flow diagrams of the processing of an initial page image according to an embodiment of the disclosure;
FIG. 4b schematically illustrates a second flowchart of processing an initial page image according to an embodiment of the disclosure;
FIG. 5 schematically shows a flow diagram of a target text vector generation method according to an embodiment of the present disclosure;
FIG. 6 schematically illustrates a flow chart of a target text vector versus a reference text vector according to an embodiment of the present disclosure;
FIG. 7a is a block diagram schematically illustrating the structure of a page test apparatus according to an embodiment of the present disclosure;
FIG. 7b schematically shows a block diagram of an image processing module according to an embodiment of the present disclosure;
FIG. 7c schematically shows a block diagram of a first determination module according to an embodiment of the present disclosure; and
FIG. 8 schematically shows a block diagram of an electronic device suitable for implementing a page test method according to an embodiment of the disclosure.
Detailed Description
Hereinafter, embodiments of the present disclosure will be described with reference to the accompanying drawings. It should be understood that the description is illustrative only and is not intended to limit the scope of the present disclosure. In the following detailed description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the embodiments of the disclosure. It may be evident, however, that one or more embodiments may be practiced without these specific details. Moreover, in the following description, descriptions of well-known structures and techniques are omitted so as to not unnecessarily obscure the concepts of the present disclosure.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the disclosure. The terms "comprises," "comprising," and the like, as used herein, specify the presence of stated features, steps, operations, and/or components, but do not preclude the presence or addition of one or more other features, steps, operations, or components.
All terms (including technical and scientific terms) used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this invention belongs, unless otherwise defined. It is noted that the terms used herein should be interpreted as having a meaning that is consistent with the context of this specification and should not be interpreted in an idealized or overly formal sense.
Where a convention analogous to "at least one of A, B and C, etc." is used, in general such a construction is intended in the sense one having skill in the art would understand the convention (e.g., "a system having at least one of A, B and C" would include but not be limited to systems that have a alone, B alone, C alone, a and B together, a and C together, B and C together, and/or A, B, C together, etc.).
The automated testing technology is applied to various software research and development processes more and more widely at present, and the concept of layered testing is also applied more and more widely, such as unit testing verification code coverage rate, interface testing verification function correctness, correctness of a transaction link after serial connection of a verification testing verification function and the like.
In the process of carrying out automatic test in an end-to-end mode of an interface UI, a plurality of automatic test tools for realizing the principle are available, the principle of identifying the attribute of a browser page control is adopted, the principle of identifying the page image based on an OCR principle is adopted, and the principle of identifying a Windows handle is also adopted. However, verification of test execution is a very rigorous work, because the identification is inaccurate in the image identification process, and an automation tool identified based on the Windows handle principle can be applied to a narrow range, so that compared with other modes for carrying out automatic tests by using principles such as image identification, the mode based on the attribute identification of the page control object has the advantages of high identification accuracy, high operation efficiency, simplicity in automatic script preservation and maintenance, and the like, and is selected by increasingly wider enterprises, such as an automatic test framework of selenium, and the like.
However, although the automatic testing mode based on the attribute identification of the browser page control is used, functional verification can be efficiently and quickly completed on the tested business process, and the attribute values of the page control can be conveniently obtained for comparison, so as to realize the functions of verifying the check point and the like, compared with manual testing, the method has a great limitation, the correctness judgment can not be carried out on the visual effect displayed by each control element in the system page in the browser, and the automatic verification on the testing target can not be realized in the automatic testing process.
In one example, a page has five input items, namely a user name, a user character, a user unit address, a user address and a user attribute, and an automatic test is performed by using a browser page control attribute identification principle, wherein an input item name exists in front of each input item in the page, an input item control corresponds to the back of each input item, and in the process of writing an automatic script by using an object identification attribute, an object operated by the automatic test script is a specific input item control.
Based on the above technical problem, an embodiment of the present disclosure provides a page testing method, including: responding to the skip operation of the page, and performing screenshot operation on the page to acquire initial page image information; processing the initial page image information to determine target page image information, wherein the target page image information only comprises control object information; determining a target text vector according to the control object information; comparing the target text vector with a reference text vector to obtain a comparison result, wherein the reference text vector is determined according to historical running information of a test script of the page; and determining a page test result according to the comparison result.
Fig. 1 schematically illustrates an application scenario diagram of a page testing method, apparatus, device, storage medium and program product according to an embodiment of the present disclosure.
As shown in FIG. 1, an application scenario 100 according to this embodiment may include a page test scenario. The network 104 serves as a medium for providing communication links between the terminal devices 101, 102, 103 and the server 105. Network 104 may include various connection types, such as wired, wireless communication links, or fiber optic cables, to name a few.
The user may use the terminal devices 101, 102, 103 to interact with the server 105 via the network 104 to receive or send messages or the like. The terminal devices 101, 102, 103 may have installed thereon various communication client applications, such as shopping-like applications, web browser applications, search-like applications, instant messaging tools, mailbox clients, social platform software, etc. (by way of example only).
The terminal devices 101, 102, 103 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop portable computers, desktop computers, and the like. The terminal devices 101, 102, 103 are pre-installed with an automated test script, which may also be deployed on the server 105.
The server 105 may be a server providing various services, such as a test server (for example only) that processes data generated by a user running a script deployed with the terminal devices 101, 102, 103. The test server may perform processing such as analysis according to the currently received test data, for example, may determine a test result by performing processing comparison according to the page image.
It should be noted that the page testing method provided by the embodiment of the present disclosure may be generally executed by the server 105. Accordingly, the page testing apparatus provided by the embodiment of the present disclosure may be generally disposed in the server 105. The page testing method provided by the embodiment of the present disclosure may also be executed by a server or a server cluster that is different from the server 105 and is capable of communicating with the terminal devices 101, 102, 103 and/or the server 105. Accordingly, the page testing apparatus provided by the embodiment of the present disclosure may also be disposed in a server or a server cluster different from the server 105 and capable of communicating with the terminal devices 101, 102, 103 and/or the server 105.
It should be understood that the number of terminal devices, networks, and servers in fig. 1 is merely illustrative. There may be any number of terminal devices, networks, and servers, as desired for implementation.
It should be noted that the page testing method and apparatus provided in the embodiment of the present disclosure may be applied to software testing in the financial field, and may also be applied to any field other than the financial field.
FIG. 2 schematically shows a flow chart of a page testing method according to an embodiment of the present disclosure. As shown in fig. 2, an automatic test script collects screenshots of a page during a test process, performs noise reduction on the obtained screenshots, performs Character recognition on processed image information through an OCR (Optical Character recognition) technique, obtains a control traversal path in an image, and compares the control traversal path, specifically, first determines whether the test script has an effective historical traversal path, and if not, stores the obtained control traversal path in a database to wait for a next test. If the control traversal path exists, the newly acquired control traversal path is compared with the control traversal path stored in the database, and the comparison result is displayed to a tester.
The page test method of the disclosed embodiment will be described in detail below with reference to fig. 3 to 6 based on the scenario described in fig. 1.
FIG. 3 schematically shows a flow chart of a page testing method according to an embodiment of the present disclosure.
As shown in fig. 3, the page test method of this embodiment includes operations S210 to S250. The page testing method of the embodiments of the present disclosure may be executed by a server or a computing device. In this embodiment, the process of the page test is implemented by the corresponding automation script, and the page test method provided by the present disclosure is executed in the process of running the test script. Because the disclosure relates to the test of the UI end of the page, different test scripts are pre-written based on different business processes and business scenes, for example, in the business scene of transferring money and remitting money of a user, the first business process can be user login, account inquiry and transfer money, and the second business process can be user login and transfer money. And developing an automatic test script to perform interface UI test according to the service frequency of the service flow from the perspective of a user by a developer in combination with the specific service flow.
In operation S210, in response to a jump operation of a page, a screenshot operation is performed on the page to obtain initial page image information.
In one example, in the process of executing a test by an automatic test script, performing screenshot operation when a Page displayed by a system jumps, specifically, taking WEB system operation as an example, automatically performing screenshot on a current system interface before executing operation on each statement containing a click submission 'click' keyword in the automatic script, then judging whether a browser object attribute value of a current browser changes, if the Page object attribute value does not change, indicating that no Page jump behavior occurs on the current Page, and discarding screenshot information; if the property value of the Page object changes, judging that the Page jump action currently occurs, reserving the latest screenshot, and naming all the reserved system screenshots orderly, for example, a third system interface is named as 3-XXX. The system screenshot reserved by the screenshot operation is initial page image information, and the initial page image information is a page under the user view angle at the moment and comprises a control name, various input items, values in the input items, picture information of buttons and other title menu information.
In operation S220, the initial page image information is processed to determine target page image information.
According to the embodiment of the disclosure, the target page image information only includes control object information.
In one example, in order to improve the processing efficiency of page identification and the accuracy of control name identification, noise reduction processing needs to be performed on the initial page image information, invalid information in the initial page image information is removed, and target page image information is obtained, where the target page image information only includes control object information. In the embodiment of the present disclosure, since whether the display of the control name in the page is matched is tested, the image information of the initial page is invalid except for the control object information. Determining the number of input items in the initial page image through an algorithm, identifying the display characteristics of the control according to the characteristics of different input items, retaining the control object information of the current page, and deleting other useless interface information. For a specific noise reduction process, refer to operations S221 to S222 described in fig. 4, which are not described herein again.
In operation S230, a target text vector is determined according to the control object information.
In one example, the control names are traversed according to the target page image information obtained in operation S220 in a preset order, preferably, for example, the control names may be traversed according to a normal reading habit of a user, that is, a position of each control name is obtained from left to right and from top to bottom, and each control name is obtained in an OCR recognition manner, so as to generate a 1xM text matrix vector, where M is the number of the current page controls, and the text matrix vector is the target text vector. The generation process of the target text vector refers to operations S231 to S233 shown in fig. 5, which are not described herein again.
In operation S240, the target text vector is compared with the reference text vector to obtain a comparison result.
According to the embodiment of the disclosure, the reference text vector is determined according to the historical running information of the test script of the page.
According to the embodiment of the disclosure, when the test script of the page is determined to be run for the first time, the target text vector is saved as a reference text vector.
In one example, after a target text vector is generated, the target text vector needs to be compared with a reference text vector, the reference text vector corresponds to test scripts of a page one to one, that is, each test script uniquely corresponds to one reference text vector as a comparison baseline, the reference text vector is determined according to historical running information of the test scripts, and as a preference, for example, after the test scripts are executed successfully for the first time, the obtained target text vector is stored as the reference text vector; extensible, the tester can update and adjust the reference text vector according to the historical database, and compares the two text vectors to obtain a comparison result.
In operation S250, a page test result is determined according to the comparison result.
In one example, when all statements of the automated test script are successfully executed and the text vector comparison is successful, it is proved that the system function tested by the automated test script is normal, and the condition that the control name and the corresponding control content are mistakenly modified does not occur. In the actual test process, part of the flow is longer, so that the test efficiency can be improved, when the sentence of the automatic test script is successfully executed, the text vector corresponding to the sentence of the successfully executed part is checked to verify whether the text vector is normal, and error information of the failed execution is recorded in the automatic script execution result information for a subsequent system to display the result.
According to the page testing method provided by the disclosure, screenshot operation is carried out on a page to be tested through a testing script of an operating page, initial page image information is obtained, and in order to improve image processing efficiency and image identification accuracy, the initial page image information is processed to determine target page image information; the method comprises the steps of obtaining traversal path information of a page control name based on a target page image, storing the traversal path information as a target text vector, comparing the target text vector with a reference text vector, and finding out the problem of control display dislocation in time.
The initial page image processing procedure will be described in detail with reference to fig. 4a to 4 b.
Fig. 4a schematically shows one of the flowcharts for processing the initial page image according to the embodiment of the present disclosure, and fig. 4b schematically shows the second flowchart for processing the initial page image according to the embodiment of the present disclosure. As shown in fig. 4a, operation S220 includes operations S221 through S222.
In operation S221, control object information of a page is determined according to the initial page image information. In operation S222, the initial page image information is deleted according to the control object information, so as to determine target page image information.
In one example, to determine the position of the control and exclude invalid information in the page, control object information of the page is first identified according to the initial page image information, where the control object information includes a control name and control position information, where the control position information is position information of a corresponding input item in the control, and after the control object information of the initial page is obtained, page information other than the control object information is removed to obtain target page image information, and the specific process may refer to operation S310 to operation S350 described in fig. 4 b.
As shown in fig. 4b, the image noise reduction processing operation includes operations S310 to S350.
In operation S310, a control display feature is recognized according to an entry feature.
In operation S320, control name information and control position information are determined according to the control display characteristics.
In operation S330, control position information is determined.
In operation S340, interface information other than the control name information and the control position information is deleted.
In operation S350, target page image information is generated.
According to an embodiment of the present disclosure, the entry includes a text entry box, a radio box, a selection box, a date entry box, and a text field.
In one example, the number of input items contained in the initial page image information is judged through an intelligent algorithm, corresponding control display characteristics are specifically identified according to different input item characteristics, and then control name information and control position information are further determined according to the control display characteristics.
Optionally, for example, for a title format and a content format which are left and right, taking a text input box and a radio box as an example, selecting an image area with characteristics as characteristics of the input box, that is, image fields on the left and right sides, respectively, then taking a value of text content in front of a display field as a name of the control, removing original titles, buttons and other information on a page, and only keeping invalid information such as the page control, the button, the page title and the like in a processed result.
For example, for a selection box, a date input box and a text field with specific characteristics, the selection box is provided with an input box at the beginning and a pull-down arrow at the end; the head of the date input box is an input box, and the tail of the date input box is provided with a special calendar picture; the method comprises the steps that a wider input box is arranged at the beginning of a text field, two arrows in opposite directions are arranged at the end of the text field, position information of a control is determined according to the characteristics, and then name information of the control is determined according to pixel changes before and after the position of the control. And removing other invalid information in the page to obtain target page image information, wherein the target page image information only comprises control object information.
After the initial page is denoised to obtain the target page image, ocr text extraction is performed on the target page image to obtain a target text vector, and the generation process of the target text vector will be described in detail below with reference to fig. 5.
Fig. 5 schematically shows a flowchart of a target text vector generation method according to an embodiment of the present disclosure, and as shown in fig. 5, operation S230 includes operations S231 to S233.
In operation S231, the position information of the input frame corresponding to the control is determined according to the position information of the control.
In operation S232, control name location information is determined according to the location information of the input box.
In operation S233, a target text vector is generated according to the control name location information.
According to the embodiment of the disclosure, determining the name of the control according to the name and position information of the control; and traversing the control names according to the position information of the control names and the preset sequence to obtain a target text vector.
In one example, the position of each entry is obtained according to the position of the control from left to right and from top to bottom, and the corresponding position of the input box and the control name is found according to the position. And extracting the control object name in an OCR (optical character recognition) mode, shielding the value in the input box, and forming a control name traversal path of the current page from left to right and from top to bottom. If the control traversal path formed by the user information page is 3-1, the project name; 3-2, item type; 3-3, project principal; 3-4, project testing department of responsibility room; 3-5, belonging to a product line; 3-6, product manager; 3-7, testing starting time; 3-8, testing end time; 3-9, standing time; 3-10, a demand proposing department; 3-11, remarking the traversal path, and storing the traversal path in the form of a text vector, namely the target text vector.
Fig. 6 schematically illustrates a flow diagram of a target text vector versus a reference text vector according to an embodiment of the present disclosure. As shown in fig. 6, the operation S240 includes operations S241 to S242.
In operation S241, a reference text vector is obtained according to the script of the page.
In operation S242, the control names in the reference text vector and the control names in the target text vector are sequentially compared one by one to generate a comparison result.
In one example, assuming that a developer of a certain version carelessly changes the labels of the standing time and the test starting time when modifying the version, that is, the display sequence of the two control names of the "standing time" and the "test starting time" is not matched, the test path of this time is calculated to be "3-1" and the project name according to the method for obtaining the target text vector of the page; 3-2, item type; 3-3, project principal; 3-4, project testing department of responsibility room; 3-5, belonging to a product line; 3-6, product manager; 3-7, standing time; 3-8, testing end time; 3-9, test start time; 3-10, demand proposing department; 3-11, remarks ".
And acquiring a reference text vector in the database according to the test script identifier, comparing the text vector with the control names in the reference text vector one by one, and if the two texts are inconsistent, the comparison is not passed. Showing that the foreground system interface displays problems, and comparing and executing the scripts to obtain the following results: the control traversal path is checked to fail, and the check passing part is as follows: "3-1, project name; 3-2, item type; 3-3, project principal; 3-4, project testing department of responsibility room; 3-5, belonging to a product line; 3-6, a product manager; the part of the check fail is' 3-7, item time; 3-9, test start time; ".
Based on the page testing method, the disclosure also provides a page testing device. The apparatus will be described in detail below with reference to fig. 7a to 7 c.
Fig. 7a schematically shows a block diagram of a structure of a page testing apparatus according to an embodiment of the present disclosure. Fig. 7b schematically shows a block diagram of the structure of an image processing module according to an embodiment of the present disclosure. Fig. 7c schematically shows a block diagram of the first determination module according to an embodiment of the present disclosure.
As shown in fig. 7a, the page testing apparatus 800 of this embodiment includes a screenshot module 810, an image processing module 820, a first determining module 830, a comparison module 840, a second determining module 850, and a third determining module 860.
The screenshot module 810 is configured to perform screenshot operation on a page in response to a jump operation of the page, so as to obtain initial page image information. In an embodiment, the screenshot module 810 may be configured to perform the operation S210 described above, which is not described herein again.
The image processing module 820 is configured to process the initial page image information to determine target page image information, where the target page image information only includes control object information. In an embodiment, the image processing module 820 may be configured to perform the operation S220 described above, which is not described herein again.
The first determining module 830 is configured to determine a target text vector according to the control object information. In an embodiment, the first determining module 830 may be configured to perform the operation S230 described above, and is not described herein again.
The comparison module 840 is configured to compare the target text vector with a reference text vector to obtain a comparison result, where the reference text vector is determined according to historical operation information of the test script of the page. In an embodiment, the comparing module 840 may be configured to perform the operation S240 described above, which is not described herein again.
The second determining module 850 is configured to determine a page test result according to the comparison result. In an embodiment, the second determining module 850 may be configured to perform the operation S250 described above, which is not described herein again.
The third determining module 860 is configured to save the target text vector as a reference text vector when the test script of the page is determined to be run for the first time. In an embodiment, the third determining module 860 may be configured to perform the operation S240 described above, which is not described herein again.
As shown in fig. 7b, the image processing module 820 includes a first determination sub-module 821 and a second determination sub-module 822.
The first determining sub-module 821 is used for determining control object information of a page according to the initial page image information. In an embodiment, the first determining sub-module 821 may be configured to perform the operation S221 described above, and will not be described herein again.
The second determining submodule 822 is configured to delete the initial page image information according to the control object information to determine target page image information. In an embodiment, the second determining submodule 822 may be configured to perform the operation S222 described above, and will not be described herein again.
According to an embodiment of the present disclosure, the first determination submodule 821 includes an identification unit 8211 and a first determination unit 8212.
The recognition unit 8211 is used for recognizing the display characteristics of the control according to the characteristics of the input item. In an embodiment, the identifying unit 8211 may be configured to perform the operation S310 described above, which is not described herein again.
The first determining unit 8212 is configured to determine control name information and control position information according to the control display feature. In an embodiment, the first determining unit 8212 may be configured to perform the operation S320 described above, which is not described herein again.
The second determination submodule 822 includes a second determination unit 8221, a deletion unit 8222, and a generation unit 8223 according to the embodiment of the present disclosure.
The second determination unit 8221 is used for determining control position information. In an embodiment, the second determining unit 8221 may be configured to perform the operation S330 described above, which is not described herein again.
A deleting unit 8222 is configured to delete interface information other than the control name information and the control position information. In an embodiment, the deleting unit 8222 may be configured to perform the operation S340 described above, which is not described herein again.
The generation unit 8223 is used for generating target page image information. In an embodiment, the generating unit 8223 may be configured to perform the operation S350 described above, which is not described herein again.
As shown in fig. 7c, the first determination module 830 includes a third determination submodule 831, a fourth determination submodule 832, and a generation submodule 833.
The third determining submodule 831 is configured to determine the position information of the input box corresponding to the control according to the control position information. In an embodiment, the third determining sub-module 831 may be configured to perform the operation S231 described above, and will not be described herein again.
The fourth determining sub-module 832 is configured to determine control name location information according to the location information of the input box. In an embodiment, the fourth determining submodule 832 may be configured to perform the operation S232 described above, and will not be described herein again.
The generating submodule 833 is configured to generate a target text vector according to the control name position information. In an embodiment, the generating sub-module 833 may be configured to perform the operation S233 described above, and is not described herein again.
According to an embodiment of the present disclosure, the comparison module 840 includes an obtaining sub-module 841 and a comparison sub-module 842.
The obtaining sub-module 841 is configured to obtain a reference text vector according to the script of the page. In an embodiment, the obtaining sub-module 841 may be configured to perform the operation S241 described above, which is not described herein again.
The comparison sub-module 842 is configured to sequentially compare the control names in the reference text vector with the control names in the target text vector one by one to generate a comparison result. In an embodiment, the comparing sub-module 842 may be configured to perform the operation S242 described above, which is not described herein again.
Any of the screenshot module 810, the image processing module 820, the first determination module 830, the comparison module 840, the second determination module 850, and the third determination module 860 may be combined in one module or any one of them may be split into a plurality of modules according to an embodiment of the present disclosure. Alternatively, at least part of the functionality of one or more of these modules may be combined with at least part of the functionality of the other modules and implemented in one module. According to an embodiment of the disclosure, at least one of the screenshot module 810, the image processing module 820, the first determining module 830, the comparing module 840, the second determining module 850, and the third determining module 860 may be implemented at least partially as a hardware circuit, such as a Field Programmable Gate Array (FPGA), a Programmable Logic Array (PLA), a system on a chip, a system on a substrate, a system on a package, an Application Specific Integrated Circuit (ASIC), or by hardware or firmware in any other reasonable way of integrating or packaging a circuit, or by any one of three implementations of software, hardware, and firmware, or by a suitable combination of any of them. Alternatively, at least one of the screenshot module 810, the image processing module 820, the first determination module 830, the comparison module 840, the second determination module 850, and the third determination module 860 may be at least partially implemented as a computer program module that, when executed, may perform a corresponding function.
FIG. 8 schematically shows a block diagram of an electronic device suitable for implementing a page test method according to an embodiment of the disclosure.
As shown in fig. 8, an electronic apparatus 900 according to an embodiment of the present disclosure includes a processor 901 which can perform various appropriate actions and processes in accordance with a program stored in a Read Only Memory (ROM)902 or a program loaded from a storage portion 908 into a Random Access Memory (RAM) 903. Processor 901 may comprise, for example, a general purpose microprocessor (e.g., a CPU), an instruction set processor and/or associated chipset, and/or a special purpose microprocessor (e.g., an Application Specific Integrated Circuit (ASIC)), among others. The processor 901 may also include on-board memory for caching purposes. The processor 901 may comprise a single processing unit or a plurality of processing units for performing the different actions of the method flows according to embodiments of the present disclosure.
In the RAM 903, various programs and data necessary for the operation of the electronic apparatus 900 are stored. The processor 901, the ROM 902, and the RAM 903 are connected to each other through a bus 904. The processor 901 performs various operations of the method flows according to the embodiments of the present disclosure by executing programs in the ROM 902 and/or the RAM 903. Note that the programs may also be stored in one or more memories other than the ROM 902 and the RAM 903. The processor 901 may also perform various operations of the method flows according to embodiments of the present disclosure by executing programs stored in the one or more memories.
Electronic device 900 may also include input/output (I/O) interface 905, input/output (I/O) interface 905 also connected to bus 904, according to an embodiment of the present disclosure. The electronic device 900 may also include one or more of the following components connected to the I/O interface 905: an input portion 906 including a keyboard, a mouse, and the like; an output section 907 including components such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage portion 908 including a hard disk and the like; and a communication section 909 including a network interface card such as a LAN card, a modem, or the like. The communication section 909 performs communication processing via a network such as the internet. The drive 910 is also connected to the I/O interface 905 as necessary. A removable medium 911 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 910 as necessary so that a computer program read out therefrom is mounted into the storage section 908 as necessary.
The present disclosure also provides a computer-readable storage medium, which may be contained in the apparatus/device/system described in the above embodiments; or may exist separately and not be assembled into the device/apparatus/system. The computer-readable storage medium carries one or more programs which, when executed, implement a page testing method according to an embodiment of the present disclosure.
According to embodiments of the present disclosure, the computer-readable storage medium may be a non-volatile computer-readable storage medium, which may include, for example but is not limited to: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present disclosure, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. For example, according to embodiments of the present disclosure, a computer-readable storage medium may include the ROM 902 and/or the RAM 903 described above and/or one or more memories other than the ROM 902 and the RAM 903.
Embodiments of the present disclosure also include a computer program product comprising a computer program containing program code for performing the method illustrated in the flow chart. When the computer program product runs in a computer system, the program code is used for causing the computer system to realize the page test method provided by the embodiment of the disclosure.
The computer program performs the above-described functions defined in the system/apparatus of the embodiments of the present disclosure when executed by the processor 901. The above described systems, devices, modules, units, etc. may be implemented by computer program modules according to embodiments of the present disclosure.
In one embodiment, the computer program may be hosted on a tangible storage medium such as an optical storage device, a magnetic storage device, or the like. In another embodiment, the computer program may also be transmitted, distributed in the form of a signal on a network medium, and downloaded and installed through the communication section 909 and/or installed from the removable medium 911. The computer program containing program code may be transmitted using any suitable network medium, including but not limited to: wireless, wired, etc., or any suitable combination of the foregoing.
In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 909, and/or installed from the removable medium 911. The computer program, when executed by the processor 901, performs the above-described functions defined in the system of the embodiment of the present disclosure. The systems, devices, apparatuses, modules, units, etc. described above may be implemented by computer program modules according to embodiments of the present disclosure.
In accordance with embodiments of the present disclosure, program code for executing computer programs provided by embodiments of the present disclosure may be written in any combination of one or more programming languages, and in particular, these computer programs may be implemented using high level procedural and/or object oriented programming languages, and/or assembly/machine languages. The programming language includes, but is not limited to, programming languages such as Java, C + +, python, the "C" language, or the like. The program code may execute entirely on the user computing device, partly on the user device, partly on a remote computing device, or entirely on the remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams or flowchart illustration, and combinations of blocks in the block diagrams or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
Those skilled in the art will appreciate that various combinations and/or combinations of features recited in the various embodiments and/or claims of the present disclosure can be made, even if such combinations or combinations are not expressly recited in the present disclosure. In particular, various combinations and/or combinations of the features recited in the various embodiments of the present disclosure and/or the claims may be made without departing from the spirit and teachings of the present disclosure. All such combinations and/or associations are within the scope of the present disclosure.
The embodiments of the present disclosure have been described above. However, these examples are for illustrative purposes only and are not intended to limit the scope of the present disclosure. Although the embodiments are described separately above, this does not mean that the measures in the embodiments cannot be used in advantageous combination. The scope of the disclosure is defined by the appended claims and equivalents thereof. Various alternatives and modifications can be devised by those skilled in the art without departing from the scope of the present disclosure, and such alternatives and modifications are intended to be within the scope of the present disclosure.

Claims (13)

1. A page testing method is characterized by comprising the following steps:
responding to the skip operation of the page, and performing screenshot operation on the page to acquire initial page image information;
processing the initial page image information to determine target page image information, wherein the target page image information only comprises control object information;
determining a target text vector according to the control object information;
comparing the target text vector with a reference text vector to obtain a comparison result, wherein the reference text vector is determined according to historical running information of a test script of the page; and
and determining a page test result according to the comparison result.
2. The method of claim 1, wherein the control object information includes control name information and control location information, and wherein determining the target text vector from the control object information comprises:
determining the position information of the control corresponding to the input box according to the position information of the control;
determining control name position information according to the position information of the input box; and
and generating a target text vector according to the control name position information.
3. The method of claim 2, wherein generating a target text vector according to the control name location information comprises:
determining the name of the control according to the name and position information of the control; and
and traversing the control names according to the position information of the control names and the preset sequence to obtain a target text vector.
4. The method of claim 1, wherein processing the initial page image information to determine target page image information comprises:
determining control object information of a page according to the initial page image information; and
and deleting the initial page image information according to the control object information to determine target page image information.
5. The method of claim 4, wherein determining control object information for a page from the initial page image information comprises:
identifying display characteristics of a control according to characteristics of input items, wherein the input items comprise a text input box, a radio box, a selection box, a date input box and a text field; and
and determining control name information and control position information according to the control display characteristics.
6. The method of claim 4, wherein the deleting the initial page image information according to the control object information to determine target page image information comprises:
determining control position information;
deleting interface information except the control name information and the control position information;
and generating target page image information.
7. The method of claim 1, wherein comparing the target text vector with a reference text vector to obtain a comparison result comprises:
acquiring a reference text vector according to the script of the page; and
and comparing the control names in the reference text vector with the control names in the target text vector one by one in sequence to generate a comparison result.
8. The method of claim 1, further comprising:
and when the test script of the page is determined to be run for the first time, storing the target text vector as a reference text vector.
9. A page testing apparatus, comprising:
the screenshot module is used for responding to the skip operation of the page and performing screenshot operation on the page to acquire initial page image information;
the image processing module is used for processing the initial page image information to determine target page image information, and the target page image information only comprises control object information;
the first determining module is used for determining a target text vector according to the control object information;
the comparison module is used for comparing the target text vector with a reference text vector to obtain a comparison result, wherein the reference text vector is determined according to historical running information of the test script of the page; and
and the second determining module is used for determining a page test result according to the comparison result.
10. The page testing apparatus according to claim 9, further comprising:
and the third determining module is used for saving the target text vector as a reference text vector when the test script of the page is determined to be in initial operation.
11. An electronic device, comprising:
one or more processors;
a storage device for storing one or more programs,
wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to perform the method of any of claims 1-8.
12. A computer readable storage medium having stored thereon executable instructions which, when executed by a processor, cause the processor to perform the method of any one of claims 1 to 8.
13. A computer program product comprising a computer program which, when executed by a processor, implements a method according to any one of claims 1 to 8.
CN202210327778.8A 2022-03-29 2022-03-29 Page testing method, device, equipment, storage medium and program product Pending CN114625667A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210327778.8A CN114625667A (en) 2022-03-29 2022-03-29 Page testing method, device, equipment, storage medium and program product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210327778.8A CN114625667A (en) 2022-03-29 2022-03-29 Page testing method, device, equipment, storage medium and program product

Publications (1)

Publication Number Publication Date
CN114625667A true CN114625667A (en) 2022-06-14

Family

ID=81904791

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210327778.8A Pending CN114625667A (en) 2022-03-29 2022-03-29 Page testing method, device, equipment, storage medium and program product

Country Status (1)

Country Link
CN (1) CN114625667A (en)

Similar Documents

Publication Publication Date Title
US9672012B2 (en) Code validation using content assist
US9015666B2 (en) Updating product documentation using automated test scripts
CN113032264A (en) Method and device for detecting page view control
CN113535577B (en) Application testing method and device based on knowledge graph, electronic equipment and medium
CN114495103B (en) Text recognition method and device, electronic equipment and medium
US20230316792A1 (en) Automated generation of training data comprising document images and associated label data
CN113918864A (en) Website page testing method, testing system, testing device, electronic equipment and medium
CN111930629A (en) Page testing method and device, electronic equipment and storage medium
CN110990264A (en) Element identification method, device and equipment for UI automation test and storage medium
CN115080433A (en) Testing method and device based on flow playback
CN115756461A (en) Annotation template generation method, image identification method and device and electronic equipment
CN114625667A (en) Page testing method, device, equipment, storage medium and program product
US20140067854A1 (en) Crawling of generated server-side content
CN113448578A (en) Page data processing method, processing system, electronic device and readable storage medium
CN115269285A (en) Test method and device, equipment and computer readable storage medium
US11119761B2 (en) Identifying implicit dependencies between code artifacts
CN114115628A (en) U shield display information acquisition method, device, equipment, medium and program product applied to U shield test
CN112084114A (en) Method and apparatus for testing an interface
CN116880899B (en) Task information association method, device, electronic equipment and computer readable medium
CN116560819B (en) RPA-based batch automatic operation method, system, equipment and storage medium
CN112651942B (en) Layout detection method and device
US20230196009A1 (en) Systems and methods for browser rendering
CN116594886A (en) Test script generation method and device, electronic equipment and storage medium
CN116401170A (en) Buried point management method, buried point management device, electronic equipment, medium and computer program product
CN113392014A (en) Test case generation method and device, electronic equipment and 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