CN112306893A - UI page testing method and device, computer equipment and storage medium - Google Patents

UI page testing method and device, computer equipment and storage medium Download PDF

Info

Publication number
CN112306893A
CN112306893A CN202011355977.7A CN202011355977A CN112306893A CN 112306893 A CN112306893 A CN 112306893A CN 202011355977 A CN202011355977 A CN 202011355977A CN 112306893 A CN112306893 A CN 112306893A
Authority
CN
China
Prior art keywords
page
test
screenshot
script
pages
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
CN202011355977.7A
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 Puhui Enterprise Management Co Ltd
Original Assignee
Ping An Puhui Enterprise Management 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 Puhui Enterprise Management Co Ltd filed Critical Ping An Puhui Enterprise Management Co Ltd
Priority to CN202011355977.7A priority Critical patent/CN112306893A/en
Publication of CN112306893A publication Critical patent/CN112306893A/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/3684Test management for test design, e.g. generating new test cases
    • 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

Landscapes

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

Abstract

The invention discloses a method and a device for testing a UI page, computer equipment and a storage medium, belonging to the field of artificial intelligence and relating to the field of block chains, wherein the method comprises the following steps: determining a plurality of UI pages to be tested according to a test service flow, determining a page sequence of the plurality of UI pages, acquiring a unique page identifier of each UI page, acquiring a page script corresponding to each UI page in a UI page database according to the page identifier, wherein the page script is a pre-compiled UI page script stored in the page database, and forming the page scripts of the plurality of UI pages into a test case according to the page sequence so as to execute the test case and acquire a test result; according to the UI page-based test unit, the tester does not need to have a script language basis, only needs to select the required UI page according to the service flow, and can automatically complete the automatic test of the UI page, the test process is simple and convenient, the tester does not need to pay extra learning cost, and the test efficiency is improved.

Description

UI page testing method and device, computer equipment and storage medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a UI page testing method and device, computer equipment and a storage medium.
Background
With the popularization of automated testing technology, testing of User Interfaces (UI) of devices gradually shifts from manual testing to UI automated testing. And UI automatic test, namely, a machine simulates the operation of a user aiming at the UI page, so that the performance of the UI page in different scenes is automatically tested.
In the existing UI page test, functions to be realized are often used as a test unit, a tester designs a whole set of UI pages according to operation steps capable of realizing the functions, that is, a plurality of UI pages are designed according to requirements of an actual service scene, then a whole set of page scripts are compiled according to specific sequences of the plurality of UI pages in the whole set of UI pages, and finally a test case composed of the page scripts of the whole set of UI pages is tested to test whether the whole set of UI pages meets the requirements of the service scene. However, in a product, UI pages required by different service scenarios are different, and the ordering of different UI pages is also different, and at this time, a previously written page script needs to be adjusted according to the actual service scenario, and then testing and maintenance are performed according to the adjusted page script, so as to adapt to different service and scenario requirements. Therefore, the script needs to be adjusted and maintained according to different service scenarios by taking the function to be realized as the test unit, and the tester needs to be familiar with both the service flow and the script language, so that the learning cost of the tester is increased, and the test efficiency is low.
Disclosure of Invention
The invention provides a UI page testing method, a UI page testing device, computer equipment and a storage medium, and aims to solve the problem that in the prior art, functions required to be realized are taken as testing units, so that testers need to be familiar with a service flow and a script language, and the testing efficiency is low.
A UI page test method comprises the following steps:
determining a plurality of UI pages to be tested according to a test service flow, and determining a page sequence of the UI pages, wherein the page sequence is a display arrangement sequence of the UI pages;
acquiring a unique page identifier of each UI page;
acquiring a page script corresponding to the UI page in a UI page database according to the page identifier, wherein the page script is a pre-written UI page script stored in the page database;
and forming the page scripts of the plurality of UI pages into a test case according to the page sequence so as to execute the test case and obtain a test result.
A UI page testing apparatus, comprising:
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a plurality of UI pages to be tested according to a test service flow and determining a page sequence of the UI pages, and the page sequence is a display arrangement sequence of the UI pages;
the first acquisition module is used for acquiring a unique page identifier of each UI page;
the second obtaining module is used for obtaining a page script corresponding to the UI page in a UI page database according to the page identifier, wherein the page script is a pre-written UI page script stored in the page database;
and the execution module is used for forming the page scripts of the UI pages into test cases according to the page sequence so as to execute the test cases and obtain test results.
A computer device comprising a memory, a processor and a computer program stored in said memory and executable on said processor, said processor implementing the steps of the above UI page test method when executing said computer program.
A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the above-mentioned UI page testing method.
In one scheme provided by the UI page testing method, the UI page testing device, the computer equipment and the storage medium, a plurality of UI pages to be tested are determined according to a testing service flow, and page sequences of the UI pages are determined, wherein the page sequences are display arrangement sequences of the UI pages, then a unique page identifier of each UI page is obtained, then a page script corresponding to the UI page is obtained in a UI page database according to the page identifiers, the page script is a pre-compiled UI page script stored in the page database, and finally the page scripts of the UI pages are combined into a test case according to the page sequences so as to execute the test case and obtain a test result; according to the invention, the UI page-based test unit establishes the unique identifier by numbering each UI page, and after a tester self-selects the required UI page according to the test service flow, an executable UI automation script can be automatically generated according to the page identifier of the selected UI page, and then an integrated test case is automatically generated according to the page sequence of the selected UI page so as to finish the UI page test.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings needed to be used in the description of the embodiments of the present invention will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to these drawings without inventive labor.
FIG. 1 is a schematic diagram of an application environment of a UI page test method according to an embodiment of the invention;
FIG. 2 is a flow chart of a UI page test method according to an embodiment of the invention;
FIG. 3 is a flowchart illustrating an implementation of step S40 in FIG. 2;
FIG. 4 is a flowchart illustrating an implementation of step S44 in FIG. 3;
FIG. 5 is a flowchart illustrating an implementation of step S443 in FIG. 4;
FIG. 6 is another flowchart illustrating a UI page test method according to an embodiment of the invention;
FIG. 7 is a schematic flow chart illustrating a UI page test method according to an embodiment of the invention;
FIG. 8 is a schematic structural diagram of an apparatus for testing UI pages according to an embodiment of the invention;
fig. 9 is a schematic structural diagram of a computer device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are some, not all, embodiments of the present 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 UI page testing method provided by the embodiment of the invention can be applied to the application environment shown in figure 1, wherein the terminal equipment is communicated with the server through a network. The method comprises the steps that a server determines a plurality of UI pages to be tested according to a test service flow transmitted by a tester through terminal equipment, and determines page sequences of the UI pages, wherein the page sequences are display arrangement sequences of the UI pages, then unique page identification of each UI page is obtained, page scripts corresponding to the UI pages are obtained in a UI page database according to the page identifications, the page scripts are UI page scripts which are written in advance and stored in the page database, and finally the page scripts of the UI pages form test cases according to the page sequences so as to execute the test cases and obtain test results; the testing personnel do not need to have a scripting language basis, only need to select the required UI page according to the business process, the automatic testing of the UI page can be automatically completed, the testing process is simple and convenient, the testing personnel do not need to pay extra learning cost, and the testing efficiency is improved.
The terminal device may be, but is not limited to, various personal computers, notebook computers, smart phones, tablet computers, and portable wearable devices. The server may be implemented as a stand-alone server or as a server cluster consisting of a plurality of servers.
In an embodiment, as shown in fig. 2, a UI page testing method is provided, which is described by taking the method as an example applied to the server in fig. 1, and includes the following steps:
s10: and determining a plurality of UI pages to be tested according to the test service flow, and determining a page sequence of the plurality of UI pages, wherein the page sequence is a display arrangement sequence of the plurality of UI pages.
When there is a test requirement, a user (tester) may determine a plurality of UI pages to be tested according to a test service flow, and at the same time, determine an arrangement order of the plurality of UI pages according to the test service flow. The page sequence is a display arrangement sequence of a plurality of UI pages.
The test service process is determined by a user, the user selects UI pages in the terminal equipment according to the requirements of the test service process after determining the test service process according to the test task, the server determines a plurality of UI pages according to the selection of the user, and the display arrangement sequence of the UI pages in the test process is determined according to the selection of the user.
For example, a user needs to test a registration login process, which includes 1. registration; 2. real-name authentication; 3. and logging in, wherein the user selects the three UI pages in the terminal equipment, the server determines the registration UI page, the real-name authentication UI page and the login UI page as the UI pages needing to be tested after receiving the UI pages selected by the user, and the arrangement and the sequencing of the UI pages, namely the page sequence, are determined according to the sequence of the three UI pages.
S20: and acquiring the unique page identifier of each UI page.
After determining a plurality of UI pages and page sequences needing to be tested, acquiring a page identifier of each UI page, wherein the page identifier is a unique page identifier of the UI page, namely a page ID.
S30: and acquiring a page script corresponding to the UI page in a UI page database according to the page identifier, wherein the page script is a pre-written UI page script stored in the page database.
And after determining the page identifier of each UI page, acquiring a page script corresponding to the UI page in a UI page database according to the page identifier, wherein the page script is a pre-written UI page script stored in the page database. All designed UI pages are stored in the UI page database, each UI page comprises a respective page script, and the page scripts are recorded through script recording pages in advance. After the scripts of the UI pages are written, the UI pages, the corresponding page identifications and the page scripts are uniformly bound and stored in a UI page database, and when a user selects one UI page, the system acquires the corresponding script from the database.
The UI page database in this embodiment is stored in the blockchain network, and is used to store data used and generated in the method for implementing UI page testing, such as data of a UI page, a page identifier corresponding to the UI page, a page script, and the like. The block chain referred by the application is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like. The UI page database is deployed in the blockchain, so that the safety of data storage can be improved.
S40: and forming the page scripts of the multiple UI pages into a test case according to the page sequence so as to execute the test case and obtain a test result.
After the page scripts corresponding to the multiple UI pages are obtained, the page scripts of the multiple UI pages are combined into a test case according to the determined page sequence, namely according to the sequence of the multiple UI pages, so that the test equipment is controlled to execute the test case, and therefore the test result of the executed test case is obtained. Wherein, the test equipment can be a smart phone.
In the embodiment, a single UI page is used as a basic test element, a tester can select a needed UI page according to the requirement of a test task and randomly assemble the page sequence of a plurality of UI pages, so that a test case is automatically combined according to the page sequence of the plurality of UI pages, an automatic test is executed to obtain an execution result of the execution test case, namely a test result, the tester does not need to adjust, maintain and execute scripts of the UI page and only needs to pay attention to the test result, the artificial intelligence of the UI page test is realized, the test operation of a user and the learning cost of the user are reduced, and the test efficiency is improved.
According to the method, a plurality of UI pages to be tested are determined according to a test service flow, a page sequence is determined, the page sequence is a display arrangement sequence of the UI pages, then a unique page identifier of each UI page is obtained, a page script corresponding to the UI page is obtained in a UI page database according to the page identifier, the page script is a pre-compiled UI page script stored in the page database, and finally the page scripts of the UI pages form a test case according to the page sequence to obtain a test result; in the embodiment, the UI page-based test unit numbers each UI page to establish a unique identifier, after a tester self-selects a required UI page according to a test service flow, an executable UI automation script can be automatically generated according to the page identifier of the selected UI page, and then an integrated test case is automatically generated according to the page sequence of the selected UI page to complete the UI page test.
In an embodiment, as shown in fig. 3, in step S40, forming a test case from page scripts of multiple UI pages according to a page sequence to execute the test case and obtain a test result, specifically including the following steps:
s41: and arranging and packaging the page scripts of the multiple UI pages according to the page sequence to obtain the test case conforming to the test service flow.
After the page scripts corresponding to the multiple UI pages are obtained, the system arranges and packages the page scripts of the multiple UI pages according to the page sequence to obtain the test case conforming to the test service flow.
For example, the page sequence of three UI pages is: 1. registering; 2. real-name authentication; 3. and logging in, the system arranges page scripts corresponding to the three UI pages in the database together according to the sequence of the numerical labels, and finally forms a test case for registering the real-name authentication login process after packaging, so that the safety of the scripts in the test case is ensured, and the normal execution of the subsequent test case is ensured.
S42: and sending the test case to the test equipment so that the test equipment executes the test case.
And after the test case which accords with the test service flow is obtained, the test case is issued to the test equipment so that the test equipment executes the test case, thereby obtaining the execution result of the test case.
S43: and acquiring a test page screenshot of the test case, wherein the test page screenshot is a page screenshot generated after the execution of each page script is completed.
In the process of executing the test case by the test equipment, after the page script of each UI page is executed, a corresponding test page is generated, at this time, the generated test page needs to be subjected to screenshot, the screenshot of each test page is stored to obtain the test page screenshot of the test case, and the test page screenshot of the test case is transmitted to the server, so that the server determines the execution result of the test case executed by the test equipment through the test page screenshot.
S44: and determining a test result according to the screenshot of the test page.
After the test page screenshot of the test case is obtained, whether the execution of the test case meets the test expectation or not can be judged according to the test page screenshot, so that a test result is obtained, namely whether the test passes or not is determined, and the judgment mode is visual and simple.
In the process of UI automatic test, a corresponding screenshot can be generated every time a UI page is tested, so that a user can conveniently check whether the execution of the whole test case is correct or not according to the screenshot in the follow-up process, if the execution result of the test case is not in accordance with the expectation, the user can quickly position and search the UI page which is not in accordance with the screenshot generated in the execution process, and the problem is analyzed. The problem can be solved by modifying the script corresponding to the UI page.
In the embodiment, the page scripts of the multiple UI pages are arranged and packaged according to the page sequence to obtain the test cases which accord with the test service flow, the test cases are issued to the test equipment to enable the test equipment to execute the test cases and obtain the test page screenshots of the test cases, wherein the test page screenshots are page screenshots generated after the execution of each page script is completed, the test result is determined according to the test page screenshots, the step of executing the page scripts of the multiple UI pages according to the page sequence to obtain the test result is refined, the test result is determined according to the test page screenshots, and the screenshot mode is more intuitive, so that the test result is clear, the test convenience is improved, and the test efficiency is further improved.
In addition, a single UI page is used as a basic test element, a tester can select a needed UI page according to the requirement of a test task and randomly assemble the page sequence of a plurality of UI pages, the system combines corresponding page scripts according to the page sequence of the plurality of UI pages, so that the test cases are packaged and combined, the generation of the test cases is as flexible as building blocks, the whole process of packaging and combining the test cases is automatically completed in a server, the intervention of the tester is not needed, the tester only needs to care about the final execution result (namely, the test result) of the test cases, the test convenience is improved, and the test efficiency is improved.
In an embodiment, as shown in fig. 4, in step S44, determining a test result according to the screenshot of the test page specifically includes the following steps:
s441: and acquiring an original page screenshot corresponding to the UI page in a UI page database according to the page identifier.
And the original page screenshot corresponding to the UI page is also stored in the UI page database, and is the UI page screenshot generated after the script is written. After the test page screenshot of the test case is obtained, an original page screenshot corresponding to the UI page is also obtained in the UI page database according to the page identifier, so as to determine a test result according to the two screenshots.
S442: and displaying the test page screenshot of the test case and the original page screenshot of the UI page to obtain the judgment condition of the user according to the screenshot input by the display.
After the test page screenshots of the test cases and the original page screenshots corresponding to the multiple UI pages are obtained, the test page screenshots of the test cases and the original page screenshots of the multiple UI pages are displayed, so that a user can judge according to the two displayed screenshots, and screenshot judging conditions are obtained.
S443: and determining a test result according to the screenshot judgment condition input by the user.
After acquiring the screenshot judgment condition input by the user, determining the test result according to the screenshot judgment condition input by the user, namely determining whether the test is passed or not.
For example, whether the screenshot of the test page of the whole test case is consistent with the screenshot of the original page can be judged according to the displayed screenshot, if so, the judgment condition of the screenshot input by the user is consistent, and the test result is that the test is passed; if the screenshot input by the user is inconsistent, judging that the screenshot input by the user is inconsistent, and judging that the test result is not passed.
In the embodiment, the original page screenshot corresponding to the UI page is obtained in the UI page database according to the page identifier, the test page screenshot of the test case and the original page screenshot of the UI page are displayed to obtain the screenshot judgment condition input by the user, the test result is determined according to the screenshot judgment condition input by the user according to the display, the test result determined according to the test page screenshot is refined, the original screenshot of the UI page is compared with the test page screenshot in the test process, so that the accurate test result is obtained, and the UI page with problems can be quickly found and updated.
In an embodiment, as shown in fig. 5, in step S443, determining a test result according to a screenshot judgment condition input by a user specifically includes the following steps:
s4431: and judging whether the screenshot content and the screenshot sequence in the test page screenshot of the test case and the original page screenshot are completely consistent.
After the test page screenshot of the test case and the original page screenshot of the UI page are displayed, the user may judge the screenshot according to the displayed screenshot to input a screenshot judgment condition, and it is necessary to determine whether the content and the sequence of the screenshot in the test page screenshot of the test case and the original page screenshot are completely consistent according to the screenshot judgment condition.
That is, the complete consistency at this time includes consistency of screenshot contents and consistency of screenshot sequences, that is, it is necessary to determine whether the test page screenshots of the test case are consistent with the arrangement sequence of the corresponding original page screenshots, and determine whether the content of each test page screenshot is consistent with the content of the corresponding original page screenshot.
Because the page script is executed according to the sequence, the page screenshots generated after the test case is executed are also stored according to the sequence, and the judgment condition of the screenshots input by the user is as follows: if the test page screenshot arrangement sequence of the test case is inconsistent with the page sequence and/or the test page screenshot of the test case is inconsistent with the content of the corresponding original page screenshot, determining that the test page screenshot of the test case is not completely consistent with the corresponding original page screenshot, and if the screenshot judgment condition input by the user is: and if the arrangement sequence of the test page screenshots of the test cases is consistent with the page sequence and the content of the test page screenshots of the test cases is consistent with that of the corresponding original page screenshots, the test page screenshots of the test cases are determined to be completely consistent with the corresponding original page screenshots.
S4432: if the screenshot content and the screenshot sequence in the test page screenshot of the test case and the original page screenshot are completely consistent, the test result is that the test is passed.
If the screenshot content and the screenshot sequence in the test page of the test case and the corresponding screenshot in the original page are completely consistent, that is, the test page of the test case is consistent with the arrangement sequence of the corresponding screenshot in the original page, and each screenshot in the test page is consistent with the content of the corresponding screenshot in the original page, it means that the execution process of the test case is correct, the test expectation is met, and the test result is that the test is passed.
S4433: if the screenshot content and the screenshot sequence in the test page of the test case and the corresponding screenshot in the original page are not completely consistent, the test result is that the test fails.
If the test page screenshots of the test cases are not completely consistent with the corresponding original page screenshots, namely the arrangement sequence of the test page screenshots of the test cases and the corresponding original page screenshots and/or the situation that the screenshot contents are inconsistent, the situation that the execution process of the test cases has problems and is not in line with the test expectation is shown, and the test result is that the test fails.
In the embodiment, whether the screenshot content and the screenshot sequence in the test page screenshot of the test case and the original page screenshot are completely consistent or not is judged, if the screenshot content and the screenshot sequence in the test page screenshot of the test case and the screenshot sequence in the original page screenshot are completely consistent, the test result is passed, if the screenshot content and the screenshot sequence in the test page screenshot of the test case and the screenshot sequence in the original page screenshot are not completely consistent, the test result is failed, the step of determining the test result according to the screenshot judgment condition input by a user is refined, and the determination process of the test result is clarified.
In an embodiment, as shown in fig. 6, before step S10, that is, before determining a plurality of UI pages to be tested according to a business process, the method further includes the following steps:
s01: and uniquely numbering the existing UI pages to acquire the page identifiers of the UI pages.
And the UI page database stores the manufactured UI pages, and the existing UI pages in the UI page database are uniquely numbered to obtain page identifications of all the UI pages.
S02: and generating a script of the UI page on the script recording page according to the user operation so as to obtain the page script of the UI page.
And after the page identification of each UI page is determined, generating a script of the UI page on the script recording page according to the user operation so as to obtain the page script of each UI page. And the user operation corresponds to the function to be completed according to the UI page.
For example, the UI page needs to have a function of a clickable page, and for the UI page, a user clicks a certain button in a script recording page to generate a script related to the click action as a page script of part or all of the UI page.
S03: and acquiring a page screenshot generated after the page script of the UI page is executed, and taking the generated page screenshot as an original page screenshot of the UI page.
The method comprises the steps of executing a page script of a UI page after the page script of the UI page is written in advance, automatically generating a page after the page script of the UI page is executed, carrying out screenshot on the page to generate a page screenshot and storing the page screenshot, and taking the generated page screenshot as an original page screenshot of the UI page.
S04: and binding and storing the page identifier, the page script and the original page screenshot of the UI page to a UI page database.
After the page identification, the page script and the original page screenshot of the UI page are obtained, the page identification, the page script and the original page screenshot of the UI page are packaged and bound and stored in a UI page database together, so that a subsequent user can use the UI page database when executing a test task.
In the embodiment, the unique number is carried out on the existing UI page to obtain the page identifier of the UI page, the script of the UI page is generated on the script recording page according to the user operation to obtain the page script of the UI page, the page screenshot generated after the page script of the UI page is executed is obtained, the generated page screenshot is used as the original page screenshot of the UI page, the page identifier, the page script and the original page screenshot of the UI page are bound and stored in the UI page database, the obtaining mode of the page identifier, the page script and the original page screenshot of the UI page is clarified, and the page identifier, the page script and the original page screenshot of the UI page are bound and stored in the UI page database, so that a foundation is provided for the subsequent UI page test.
In an embodiment, as shown in fig. 7, after step S04, that is, after the page identifier, the page script, and the original page screenshot of the UI page are bound and stored in the UI page database, the method further includes the following steps:
s001: it is determined whether a new UI page needs to be added.
S002: and if a new UI page needs to be added, acquiring the existing page identification in the UI page database.
S003: and determining the page identifier of the new UI page according to the existing page identifier in the UI page database.
S004: and generating a page script of the new UI page, and acquiring the original page screenshot of the new UI page after the execution of the page script is finished.
S005: and binding and storing the original page screenshot, the page script and the page identifier of the new UI page to a UI page database.
After the page identification, the page script and the original page screenshot of the UI page are bound and stored in the UI page database, whether a new UI page needs to be added or not is determined according to business requirements. If the new UI page is determined to be added, acquiring a page identifier of the existing UI page from a UI page database, determining the page identifier of the new UI page according to the existing page identifier in the UI page database, then generating a page script of the new UI page according to the design of the new UI page, acquiring an original page screenshot of the new UI page after the execution of the page script of the new UI page is completed, and binding and storing the original page screenshot, the page script and the page identifier of the new UI page to the UI page database so as to test the new UI page in the subsequent stage.
In the embodiment, whether a new UI page needs to be added or not is determined, if the new UI page needs to be added, the existing page identification in the UI page database is obtained, the page identification of the new UI page is determined according to the existing page identification in the UI page database, the page script of the new UI page is generated, the original page screenshot of the new UI page after the execution of the page script of the new UI page is completed is obtained, the original screenshot page, the page script and the page identification of the new UI page are bound and stored in the UI page database, the obtaining process of the test data of the new UI page is added, a foundation is provided for the subsequent test of the new UI page, the possibility of using the original page identification when the UI page is newly added is avoided, and the uniqueness of each UI page identification in the UI page database is ensured.
It should be understood that, the sequence numbers of the steps in the foregoing embodiments do not imply an execution sequence, and the execution sequence of each process should be determined by its function and inherent logic, and should not constitute any limitation to the implementation process of the embodiments of the present invention.
In an embodiment, a UI page testing apparatus is provided, where the UI page testing apparatus corresponds to the UI page testing method in the foregoing embodiment one to one. As shown in fig. 8, the UI page testing apparatus includes a determination module 801, a first acquisition module 802, a second acquisition module 803, and an execution module 804. The functional modules are explained in detail as follows:
a determining module 801, configured to determine, according to a test service flow, multiple UI pages to be tested, and determine a page sequence of the multiple UI pages, where the page sequence is a display arrangement sequence of the multiple UI pages;
a first obtaining module 802, configured to obtain a unique page identifier for each UI page;
a second obtaining module 803, configured to obtain, according to the page identifier, a page script corresponding to the UI page in a UI page database, where the page script is a UI page script that is written in advance and stored in the page database;
and the execution module 804 is configured to compose the page scripts of the multiple UI pages into a test case according to the page sequence, so as to execute the test case and obtain a test result.
Further, the executing module 804 is specifically configured to:
arranging and packaging the page scripts of the UI pages according to the page sequence to obtain a test case which accords with the test service flow;
issuing the test case to test equipment so that the test equipment executes the test case;
acquiring a test page screenshot of the test case, wherein the test page screenshot is a page screenshot generated after the execution of each page script is completed;
and determining the test result according to the test page screenshot.
Further, the executing module 804 is specifically further configured to:
acquiring an original page screenshot corresponding to the UI page in the UI page database according to the page identifier;
displaying the test page screenshot of the test case and the original page screenshot of the UI page to obtain the judgment condition of the user according to the screenshot input by the display;
and determining the test result according to the screenshot judgment condition input by the user.
Further, the executing module 804 is specifically further configured to:
judging whether the test page screenshot of the test case is completely consistent with the screenshot content and screenshot sequence in the original page screenshot;
if the screenshot content and the screenshot sequence in the test page screenshot of the test case and the original page screenshot are completely consistent, the test result is that the test is passed;
and if the screenshot content and the screenshot sequence in the test page screenshot of the test case and the original page screenshot are not completely consistent, the test result is that the test fails.
Further, the UI page testing apparatus further includes a generating module 805, where the generating module 805 is specifically configured to:
uniquely numbering an existing UI page to acquire a page identifier of the UI page;
generating a script of the UI page on a script recording page according to user operation so as to obtain a page script of the UI page;
acquiring a page screenshot generated after the page script of the UI page is executed, and taking the generated page screenshot as an original page screenshot of the UI page;
and binding and storing the page identifier of the UI page, the page script and the original page screenshot into the UI page database.
Further, the generating module 805 is further specifically configured to:
determining whether a new UI page needs to be added;
if the new UI page needs to be added, acquiring an existing page identifier in the UI page database;
determining the page identifier of the new UI page according to the existing page identifier in the UI page database;
generating a page script of the new UI page, and acquiring an original page screenshot of the new UI page after the execution of the page script is finished;
and binding and storing the original page screenshot, the page script and the page identifier of the new UI page to the UI page database.
For the specific definition of the UI page testing device, reference may be made to the above definition of the UI page testing method, which is not described herein again. All or part of each module in the UI page testing apparatus can be implemented by software, hardware, and a combination thereof. The modules can be embedded in a hardware form or independent from a processor in the computer device, and can also be stored in a memory in the computer device in a software form, so that the processor can call and execute operations corresponding to the modules.
In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as shown in fig. 9. The computer device includes a processor, a memory, a network interface, and a database connected by a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used for storing screenshot judging conditions, test results, UI pages, corresponding page identifications, page scripts, original page screenshots and other data. The network interface of the computer device is used for connecting and communicating with an external terminal device through a network. The computer program is executed by a processor to implement a UI page test method.
In one embodiment, a computer device is provided, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
determining a plurality of UI pages to be tested according to a test service flow, and determining a page sequence of the UI pages, wherein the page sequence is a display arrangement sequence of the UI pages;
acquiring a unique page identifier of each UI page;
acquiring a page script corresponding to the UI page in a UI page database according to the page identifier, wherein the page script is a pre-written UI page script stored in the page database;
and forming the page scripts of the plurality of UI pages into a test case according to the page sequence so as to execute the test case and obtain a test result.
In one embodiment, a computer-readable storage medium is provided, having a computer program stored thereon, which when executed by a processor, performs the steps of:
determining a plurality of UI pages to be tested according to a test service flow, and determining a page sequence of the UI pages, wherein the page sequence is a display arrangement sequence of the UI pages;
acquiring a unique page identifier of each UI page;
acquiring a page script corresponding to the UI page in a UI page database according to the page identifier, wherein the page script is a pre-written UI page script stored in the page database;
and forming the page scripts of the plurality of UI pages into a test case according to the page sequence so as to execute the test case and obtain a test result.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware related to instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
It will be apparent to those skilled in the art that, for convenience and brevity of description, only the above-mentioned division of the functional units and modules is illustrated, and in practical applications, the above-mentioned function distribution may be performed by different functional units and modules according to needs, that is, the internal structure of the apparatus is divided into different functional units or modules, so as to perform all or part of the functions described above.
The above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (10)

1. A UI page test method is characterized by comprising the following steps:
determining a plurality of UI pages to be tested according to a test service flow, and determining a page sequence of the UI pages, wherein the page sequence is a display arrangement sequence of the UI pages;
acquiring a unique page identifier of each UI page;
acquiring a page script corresponding to the UI page in a UI page database according to the page identifier, wherein the page script is a pre-written UI page script stored in the page database;
and forming the page scripts of the plurality of UI pages into a test case according to the page sequence so as to execute the test case and obtain a test result.
2. The method for testing the UI page according to claim 1, wherein the step of composing the page scripts of the UI pages into test cases according to the page sequence to execute the test cases and obtain test results comprises the steps of:
arranging and packaging the page scripts of the UI pages according to the page sequence to obtain a test case which accords with the test service flow;
issuing the test case to test equipment so that the test equipment executes the test case;
acquiring a test page screenshot of the test case, wherein the test page screenshot is a page screenshot generated after the execution of each page script is completed;
and determining the test result according to the test page screenshot.
3. The UI page testing method of claim 2, wherein the determining the test result from the test page screenshot comprises:
acquiring an original page screenshot corresponding to the UI page in the UI page database according to the page identifier;
displaying the test page screenshot of the test case and the original page screenshot of the UI page to obtain the judgment condition of the user according to the screenshot input by the display;
and determining the test result according to the screenshot judgment condition input by the user.
4. The UI page testing method of claim 3, wherein the determining the test result according to the screenshot judgment condition input by the user according to the presentation comprises:
judging whether the test page screenshot of the test case is completely consistent with the screenshot content and screenshot sequence in the original page screenshot;
if the screenshot content and the screenshot sequence in the test page screenshot of the test case and the original page screenshot are completely consistent, the test result is that the test is passed;
and if the screenshot content and the screenshot sequence in the test page screenshot of the test case and the original page screenshot are not completely consistent, the test result is that the test fails.
5. The UI page testing method of any of claims 1-4, wherein before determining the plurality of UI pages that need to be tested according to the business process, the method further comprises:
uniquely numbering an existing UI page to acquire a page identifier of the UI page;
generating a script of the UI page on a script recording page according to user operation so as to obtain a page script of the UI page;
acquiring a page screenshot generated after the page script of the UI page is executed, and taking the generated page screenshot as an original page screenshot of the UI page;
and binding and storing the page identifier of the UI page, the page script and the original page screenshot into the UI page database.
6. The method for UI page testing as claimed in claim 5, wherein after saving the page identification of the UI page, the page script and the original page screenshot binding to the UI page database, the method further comprises:
determining whether a new UI page needs to be added;
if the new UI page needs to be added, acquiring an existing page identifier in the UI page database;
determining the page identifier of the new UI page according to the existing page identifier in the UI page database;
generating a page script of the new UI page, and acquiring an original page screenshot of the new UI page after the execution of the page script is finished;
and binding and storing the original page screenshot, the page script and the page identifier of the new UI page to the UI page database.
7. A UI page test apparatus, comprising:
the system comprises a determining module, a judging module and a judging module, wherein the determining module is used for determining a plurality of UI pages to be tested according to a test service flow and determining a page sequence of the UI pages, and the page sequence is a display arrangement sequence of the UI pages;
the first acquisition module is used for acquiring a unique page identifier of each UI page;
the second obtaining module is used for obtaining a page script corresponding to the UI page in a UI page database according to the page identifier, wherein the page script is a pre-written UI page script stored in the page database;
and the execution module is used for forming the page scripts of the UI pages into test cases according to the page sequence so as to execute the test cases and obtain test results.
8. The UI page testing apparatus of claim 7, wherein the execution module is specifically configured to:
arranging and packaging the page scripts of the UI pages according to the page sequence to obtain a test case which accords with the test service flow;
issuing the test case to test equipment, and executing the test case on the test equipment;
acquiring a test page screenshot of the test case, wherein the test page screenshot is a page screenshot generated after the execution of each page script is completed;
and determining the test result according to the test page screenshot.
9. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, characterized in that the processor implements the steps of the UI page testing method according to any of the claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the steps of the UI page testing method according to any one of claims 1 to 6.
CN202011355977.7A 2020-11-27 2020-11-27 UI page testing method and device, computer equipment and storage medium Pending CN112306893A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011355977.7A CN112306893A (en) 2020-11-27 2020-11-27 UI page testing method and device, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011355977.7A CN112306893A (en) 2020-11-27 2020-11-27 UI page testing method and device, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112306893A true CN112306893A (en) 2021-02-02

Family

ID=74486823

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011355977.7A Pending CN112306893A (en) 2020-11-27 2020-11-27 UI page testing method and device, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112306893A (en)

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112819554A (en) * 2021-02-24 2021-05-18 招联消费金融有限公司 Business processing method and device based on page operation and computer equipment
CN112835803A (en) * 2021-02-23 2021-05-25 北京联创信安科技股份有限公司 Tool generation method, test data construction method, device, equipment and medium
CN113127354A (en) * 2021-04-21 2021-07-16 武汉思普崚技术有限公司 Automatic testing method, device and equipment based on Web UI and storage medium
CN113157581A (en) * 2021-04-27 2021-07-23 网易(杭州)网络有限公司 Method and device for automatically triggering service, electronic equipment and storage medium
CN113254337A (en) * 2021-05-24 2021-08-13 北京创源微致软件有限公司 Software function testing system, method and server
CN113467859A (en) * 2021-06-15 2021-10-01 惠州市德赛西威汽车电子股份有限公司 Dynamic execution method based on action script and storage medium
CN113468076A (en) * 2021-08-19 2021-10-01 平安普惠企业管理有限公司 Application program exception testing method, device, equipment and storage medium
CN113672453A (en) * 2021-07-27 2021-11-19 北京达佳互联信息技术有限公司 Display page monitoring method and device, electronic equipment and storage medium
CN115827499A (en) * 2023-02-22 2023-03-21 江苏北弓智能科技有限公司 UI automation test method

Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102306122A (en) * 2011-09-14 2012-01-04 北京星网锐捷网络技术有限公司 Automated testing method and equipment
CN103412820A (en) * 2013-08-30 2013-11-27 曙光信息产业(北京)有限公司 Test method and tester for pages in Web system
CN104461855A (en) * 2013-09-22 2015-03-25 腾讯科技(北京)有限公司 Automatic Web testing method, system and device
CN106326121A (en) * 2016-08-22 2017-01-11 上海亿账通互联网科技有限公司 Method for automatically generating test script and terminal
CN106649106A (en) * 2016-12-09 2017-05-10 北京锐安科技有限公司 Test case generation method and device
CN107015903A (en) * 2016-01-27 2017-08-04 阿里巴巴集团控股有限公司 A kind of generation method, device and the electronic equipment of interface detection program
US20170277624A1 (en) * 2016-03-22 2017-09-28 Tata Consultancy Services Limited Method and system for automated user interface (ui) testing through model driven techniques
CN107643981A (en) * 2017-08-29 2018-01-30 顺丰科技有限公司 A kind of automatic test platform and operation method of polynary operation flow
CN107908542A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Test case creation method, apparatus, computer equipment and storage medium
CN108268377A (en) * 2018-01-23 2018-07-10 郑州云海信息技术有限公司 A kind of service test method of server, device and medium
CN108459957A (en) * 2017-11-29 2018-08-28 平安科技(深圳)有限公司 Test method, device, equipment and the storage medium of fund system test case
CN108536593A (en) * 2018-04-02 2018-09-14 泰华智慧产业集团股份有限公司 CS Framework Softwares automated testing method based on UI and system
CN109815128A (en) * 2018-12-21 2019-05-28 北京奇艺世纪科技有限公司 Execution method, apparatus, terminal and the computer readable storage medium of test case
CN110321281A (en) * 2019-05-24 2019-10-11 中国工程物理研究院计算机应用研究所 Web test platform and test method based on mixing automated test frame
CN110554962A (en) * 2019-08-14 2019-12-10 平安普惠企业管理有限公司 Regression testing process covering method, server and computer readable storage medium
CN111177009A (en) * 2019-12-31 2020-05-19 五八有限公司 Script generation method and device, electronic equipment and storage medium
CN111444077A (en) * 2019-01-16 2020-07-24 北京京东尚科信息技术有限公司 Method and device for generating flow node test data
CN111782317A (en) * 2020-06-12 2020-10-16 京东数字科技控股有限公司 Page testing method and device, storage medium and electronic device
CN111881042A (en) * 2020-07-27 2020-11-03 云账户技术(天津)有限公司 Automatic test script generation method and device and electronic equipment

Patent Citations (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102306122A (en) * 2011-09-14 2012-01-04 北京星网锐捷网络技术有限公司 Automated testing method and equipment
CN103412820A (en) * 2013-08-30 2013-11-27 曙光信息产业(北京)有限公司 Test method and tester for pages in Web system
CN104461855A (en) * 2013-09-22 2015-03-25 腾讯科技(北京)有限公司 Automatic Web testing method, system and device
CN107015903A (en) * 2016-01-27 2017-08-04 阿里巴巴集团控股有限公司 A kind of generation method, device and the electronic equipment of interface detection program
US20170277624A1 (en) * 2016-03-22 2017-09-28 Tata Consultancy Services Limited Method and system for automated user interface (ui) testing through model driven techniques
CN106326121A (en) * 2016-08-22 2017-01-11 上海亿账通互联网科技有限公司 Method for automatically generating test script and terminal
CN106649106A (en) * 2016-12-09 2017-05-10 北京锐安科技有限公司 Test case generation method and device
CN107908542A (en) * 2017-07-26 2018-04-13 平安壹钱包电子商务有限公司 Test case creation method, apparatus, computer equipment and storage medium
CN107643981A (en) * 2017-08-29 2018-01-30 顺丰科技有限公司 A kind of automatic test platform and operation method of polynary operation flow
CN108459957A (en) * 2017-11-29 2018-08-28 平安科技(深圳)有限公司 Test method, device, equipment and the storage medium of fund system test case
CN108268377A (en) * 2018-01-23 2018-07-10 郑州云海信息技术有限公司 A kind of service test method of server, device and medium
CN108536593A (en) * 2018-04-02 2018-09-14 泰华智慧产业集团股份有限公司 CS Framework Softwares automated testing method based on UI and system
CN109815128A (en) * 2018-12-21 2019-05-28 北京奇艺世纪科技有限公司 Execution method, apparatus, terminal and the computer readable storage medium of test case
CN111444077A (en) * 2019-01-16 2020-07-24 北京京东尚科信息技术有限公司 Method and device for generating flow node test data
CN110321281A (en) * 2019-05-24 2019-10-11 中国工程物理研究院计算机应用研究所 Web test platform and test method based on mixing automated test frame
CN110554962A (en) * 2019-08-14 2019-12-10 平安普惠企业管理有限公司 Regression testing process covering method, server and computer readable storage medium
CN111177009A (en) * 2019-12-31 2020-05-19 五八有限公司 Script generation method and device, electronic equipment and storage medium
CN111782317A (en) * 2020-06-12 2020-10-16 京东数字科技控股有限公司 Page testing method and device, storage medium and electronic device
CN111881042A (en) * 2020-07-27 2020-11-03 云账户技术(天津)有限公司 Automatic test script generation method and device and electronic equipment

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112835803A (en) * 2021-02-23 2021-05-25 北京联创信安科技股份有限公司 Tool generation method, test data construction method, device, equipment and medium
CN112835803B (en) * 2021-02-23 2024-02-23 北京联创信安科技股份有限公司 Tool generation method, test data construction method, device, equipment and medium
CN112819554A (en) * 2021-02-24 2021-05-18 招联消费金融有限公司 Business processing method and device based on page operation and computer equipment
CN112819554B (en) * 2021-02-24 2023-12-29 招联消费金融有限公司 Service processing method and device based on page operation and computer equipment
CN113127354B (en) * 2021-04-21 2023-08-11 武汉思普崚技术有限公司 Automatic test method, device, equipment and storage medium based on Web UI
CN113127354A (en) * 2021-04-21 2021-07-16 武汉思普崚技术有限公司 Automatic testing method, device and equipment based on Web UI and storage medium
CN113157581A (en) * 2021-04-27 2021-07-23 网易(杭州)网络有限公司 Method and device for automatically triggering service, electronic equipment and storage medium
CN113254337A (en) * 2021-05-24 2021-08-13 北京创源微致软件有限公司 Software function testing system, method and server
CN113467859A (en) * 2021-06-15 2021-10-01 惠州市德赛西威汽车电子股份有限公司 Dynamic execution method based on action script and storage medium
CN113467859B (en) * 2021-06-15 2024-04-09 惠州市德赛西威汽车电子股份有限公司 Dynamic execution method based on action script and storage medium
CN113672453A (en) * 2021-07-27 2021-11-19 北京达佳互联信息技术有限公司 Display page monitoring method and device, electronic equipment and storage medium
CN113468076A (en) * 2021-08-19 2021-10-01 平安普惠企业管理有限公司 Application program exception testing method, device, equipment and storage medium
CN115827499A (en) * 2023-02-22 2023-03-21 江苏北弓智能科技有限公司 UI automation test method

Similar Documents

Publication Publication Date Title
CN112306893A (en) UI page testing method and device, computer equipment and storage medium
EP3992800A1 (en) Program test method and apparatus, computer device, and storage medium
CN109726134B (en) Interface test method and system
CN109889377B (en) Method and device for deploying VNF in NFV system based on Openstack
CN112433944A (en) Service testing method, device, computer equipment and storage medium
CN109683982A (en) MES system control method, device, computer equipment and storage medium
US20200379748A1 (en) Upgrading method and apparatus
CN111552535A (en) Interface picture replacing method and device, computer equipment and storage medium
CN110334303A (en) Form validation method, device, computer equipment and storage medium
CN113296823A (en) Method, device, equipment and storage medium for generating resource configuration file
WO2020006911A1 (en) Hybrid app interface calling method and device, and computer-readable storage medium
CN107783867B (en) Gesture testing method and device, computer equipment and storage medium
CN113778878A (en) Interface testing method and device, electronic equipment and storage medium
CN111159025B (en) Application program interface testing method and device, computer equipment and storage medium
CN109815127B (en) Automatic script conversion method and device, computer equipment and storage medium
CN110309057B (en) Automatic script-based flow project testing method and related equipment
CN115934129A (en) Software project updating method and device, computer equipment and storage medium
CN116049000A (en) Environment parameter configuration method, device, equipment, storage medium and product
CN115168232A (en) Testing method and device based on AUTOSAR platform, electronic equipment and storage medium
CN108776601A (en) Loading method, device, equipment and the storage medium of the Android H5 pages
CN112149951A (en) Risk control method and device, computer equipment and storage medium
CN110245075A (en) Test data configuration method, device, computer equipment and storage medium
CN111367816B (en) Mobile test method and device, computer equipment and storage medium
CN112699023B (en) Project interface testing method and device, computer equipment and storage medium
CN114996249A (en) Data processing method and device, electronic equipment, storage medium and product

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