CN114936148A - Page testing method and device, electronic equipment and readable storage medium - Google Patents

Page testing method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN114936148A
CN114936148A CN202210438563.3A CN202210438563A CN114936148A CN 114936148 A CN114936148 A CN 114936148A CN 202210438563 A CN202210438563 A CN 202210438563A CN 114936148 A CN114936148 A CN 114936148A
Authority
CN
China
Prior art keywords
page
data set
test
recording
test data
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
CN202210438563.3A
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.)
Weikun Shanghai Technology Service Co Ltd
Original Assignee
Weikun Shanghai Technology Service 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 Weikun Shanghai Technology Service Co Ltd filed Critical Weikun Shanghai Technology Service Co Ltd
Priority to CN202210438563.3A priority Critical patent/CN114936148A/en
Publication of CN114936148A publication Critical patent/CN114936148A/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
    • 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/3692Test management for test results analysis
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The invention relates to an artificial intelligence technology, and discloses a page testing method, which comprises the following steps: the method comprises the steps of obtaining a target page, generating a recording toolbar of the target page by using a preset browser plug-in, receiving a page recording instruction generated by clicking the recording toolbar by a user, recording a test event in the target page based on the page recording instruction to obtain an initial test data set, receiving a data adjusting instruction generated by clicking the recording toolbar by the user, screening the initial test data set based on the data adjusting instruction to obtain a standard test data set, and performing assertion test on the target page by using the standard test data set to obtain a page test result. In addition, the invention also relates to a block chain technology, and the page test result can be stored in a node of the block chain. The invention also provides a page testing device, electronic equipment and a readable storage medium. The invention can solve the problem of low efficiency of page testing.

Description

Page testing method and device, electronic equipment and readable storage medium
Technical Field
The invention relates to the technical field of artificial intelligence, in particular to a page testing method and device, electronic equipment and a readable storage medium.
Background
The page test is to test whether the layout of the functional modules of the page is reasonable, whether the overall style is consistent, whether the placement positions of the controls conform to the use habits of customers, and to test the operation convenience, the navigation simplicity and understandability, the usability of page elements, whether the characters in the interface are correct, and the like. Most of current company internal page tests require testers to manually carry out multi-round tests, and great manpower and energy are required to be invested to complete the test, so that the efficiency is low. However, page functions change frequently with services, and testers do not change continuously, and even if more resources and efforts are invested in page testing, the effect of page testing is often very little, so that a method for automatically and efficiently completing page function testing is urgently needed.
Disclosure of Invention
The invention provides a page testing method, a page testing device, electronic equipment and a readable storage medium, and mainly aims to solve the problem of low page testing efficiency.
In order to achieve the above object, the present invention provides a page testing method, which includes:
acquiring a target page, and generating a recording toolbar of the target page by using a preset browser plug-in;
receiving a page recording instruction generated by clicking the recording toolbar by a user, and recording a test event in the target page based on the page recording instruction to obtain an initial test data set;
receiving a data adjustment instruction generated by clicking the recording toolbar by a user, and screening the initial test data set based on the data adjustment instruction to obtain a standard test data set;
and performing assertion test on the target page by using the standard test data set to obtain a page test result.
Optionally, the recording the test event in the target page based on the page recording instruction to obtain an initial test data set includes:
recording the click events in the target page, and converting the click events into click test scripts;
recording the input events in the target page and converting the input events into input test scripts;
recording the detection events in the target page and converting the detection events into detection test scripts;
and summarizing the clicking test script, the input test script and the detection test script to obtain the initial test data set.
Optionally, before the screening is performed on the initial test data set based on the data adjustment instruction to obtain a standard test data set, the method further includes:
acquiring a click event, an input event and a text generated by a detection event in the target page;
and constructing a text assertion based on the text, and constructing a test assertion according to the click event, the input event and the detection event.
Optionally, the screening the initial test data set based on the data adjustment instruction to obtain a standard test data set includes:
performing primary screening on the initial test data set based on the data adjusting instruction to obtain a primary screening test data set;
and performing secondary screening on the test data in the standard test data set based on the text assertion and the test assertion, and summarizing the test data asserted as true as the standard test data set.
Optionally, after the initial test data set is screened based on the data adjustment instruction to obtain a standard test data set, the method further includes:
judging whether the operation time limit of the standard data set meets a preset time limit requirement or not;
if the operation time limit of the standard data set does not meet the preset time limit requirement, returning to the step of acquiring the target page, and generating a recording toolbar of the target page by using a preset browser plug-in;
and if the operation time limit of the standard data set meets the preset time limit requirement, storing the operation time limit into a preset database.
Optionally, the performing assertion test on the target page by using the standard test data set to obtain a page test result includes:
acquiring the standard test data set by using a preset simulation browser, and executing the test data in the standard test data set one by one in the simulation browser;
if the assertion fails or cannot be executed, determining that the page test result is a page test failure;
and if the test data in the standard test data set are all successfully executed, determining that the page test result is page test failure.
Optionally, the generating a recording toolbar of the target page by using a preset browser plug-in includes: and opening the target page by using a preset browser, loading a recording script according to the browser plug-in, and generating the recording toolbar in the target page based on the recording script.
In order to solve the above problem, the present invention further provides a page testing apparatus, including:
the recording tool generating module is used for acquiring a target page and generating a recording tool bar of the target page by using a preset browser plug-in;
the test data recording module is used for receiving a page recording instruction generated by clicking the recording toolbar by a user, and recording a test event in the target page based on the page recording instruction to obtain an initial test data set;
the test data screening module is used for receiving a data adjusting instruction generated by clicking the recording toolbar by a user, and screening the initial test data set based on the data adjusting instruction to obtain a standard test data set;
and the page testing module is used for carrying out assertion testing on the target page by using the standard testing data set to obtain a page testing result.
In order to solve the above problem, the present invention also provides an electronic device, including:
a memory storing at least one computer program; and
and the processor executes the computer program stored in the memory to realize the page test method.
In order to solve the above problem, the present invention further provides a computer-readable storage medium, in which at least one computer program is stored, and the at least one computer program is executed by a processor in an electronic device to implement the page testing method described above.
According to the invention, the test event in the target page is recorded through the recording toolbar generated by the browser plug-in, an initial test data set can be obtained based on the test event in the target page, a standard test data set is obtained through screening, the target page is subjected to assertion test by using the standard test data set, repeated manual test is not needed, a page test result can be directly obtained, and the efficiency of page test is greatly improved. Therefore, the page testing method, the page testing device, the electronic equipment and the computer readable storage medium can solve the problem of low page testing efficiency.
Drawings
Fig. 1 is a schematic flowchart of a page testing method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart showing a detailed implementation of one of the steps in FIG. 1;
FIG. 3 is a functional block diagram of a page testing apparatus according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of an electronic device implementing the page testing method according to an embodiment of the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
The embodiment of the invention provides a page testing method. The execution subject of the page test method includes, but is not limited to, at least one of electronic devices such as a server and a terminal that can be configured to execute the method provided by the embodiment of the present invention. In other words, the page test method may be performed by software or hardware installed in the terminal device or the server device, and the software may be a block chain platform. The server includes but is not limited to: a single server, a server cluster, a cloud server or a cloud server cluster, and the like. The server may be an independent server, or may be a cloud server that provides basic cloud computing services such as a cloud service, a cloud database, cloud computing, a cloud function, cloud storage, a Network service, cloud communication, a middleware service, a domain name service, a security service, a Content Delivery Network (CDN), a big data and artificial intelligence platform, and the like.
Fig. 1 is a schematic flowchart of a page testing method according to an embodiment of the present invention.
In this embodiment, the page test method includes the following steps S1-S4:
and S1, acquiring a target page, and generating a recording toolbar of the target page by using a preset browser plug-in.
In the embodiment of the present invention, the target page refers to a front end page to be tested, for example, a Web page, an h5 page, and the like. The preset browser plug-in may be a recording plug-in a third-party browser, for example, a recording plug-in a chrome browser.
In detail, the generating of the recording toolbar of the target page by using a preset browser plug-in includes: and opening the target page by using a preset browser, loading a recording script according to the browser plug-in, and generating the recording toolbar in the target page based on the recording script.
In an optional embodiment of the present invention, the preset browser may be a chrome browser, and the browser plug-in may be a screencasting tool, an autoranner tool, and the like. The recording toolbar comprises buttons of start/pause, stop and the like.
In the embodiment of the invention, the target page is opened through the browser, and the recording toolbar is generated through the browser plug-in, so that the recording process of the page test can be controlled, and the accuracy and controllability of the page detection are improved.
And S2, receiving a page recording instruction generated by clicking the recording toolbar by a user, and recording the test event in the target page based on the page recording instruction to obtain an initial test data set.
In the embodiment of the invention, a user clicks a 'start' button in a recording toolbar to send a page recording instruction to start recording. The test event includes a web page click event, an input user event, a triggered request, and the like.
Specifically, referring to fig. 2, the recording the test event in the target page based on the page recording instruction to obtain an initial test data set includes the following steps S20 to S23:
s20, recording the click events in the target page and converting the click events into click test scripts;
s21, recording the input events in the target page and converting the input events into input test scripts;
s22, recording the detection events in the target page and converting the detection events into detection test scripts;
and S23, summarizing the click test script, the input test script and the detection test script to obtain the initial test data set.
In the embodiment of the invention, each component in the page can be detected in the page detection process, including a click event, an input event, a detection event and the like, for example, the click event tests the click condition of each part of the page, including a skipped page, character information and the like, the input event tests the problems of text specification detection and the like by inputting information in a text box, and the detection event is used for detecting whether the sizes of each button, frame and the like in the page are in compliance or not.
In an optional embodiment of the present invention, for example, a certain click event is used to jump from an a page to a B page, and a process of a tester clicking a button on the a page to jump to the B page is recorded by an autoranner tool, so that a test case (i.e., a click test script) "clickControl-test-01" can be directly generated.
In the embodiment of the invention, each test event in the page test can be directly converted into the test script through the screen recording plug-in, so that the automation and the efficiency of the page test are greatly improved.
And S3, receiving a data adjustment instruction generated by clicking the recording toolbar by a user, and screening the initial test data set based on the data adjustment instruction to obtain a standard test data set.
In the embodiment of the invention, the data adjusting instruction is used for classifying, screening, arranging and the like the test scripts in the initial test data set, and the accuracy of page testing can be improved by screening unnecessary test cases.
In detail, before the screening the initial test data set based on the data adjustment instruction to obtain a standard test data set, the method further includes: obtaining texts generated by the click events, the input events and the detection events in the target page, constructing text assertions based on the texts, and constructing test assertions according to the click events, the input events and the detection events.
In one embodiment of the present invention, an assertion (assertion) is a first-order logic (e.g., a logic decision formula with a true or false result) in a program, and is intended to represent a result expected by a software developer, where when the program is executed to a position of the assertion, the corresponding assertion should be true, and if the assertion is not true, the program will stop executing and give an error message.
In an optional embodiment of the present invention, the text assertion refers to a program for determining whether a text is correct, and the test assertion refers to a program for determining whether a click event, an input event, a detection event, and the like are successfully detected.
Specifically, the screening the initial test data set based on the data adjustment instruction to obtain a standard test data set includes: and performing primary screening on the initial test data set based on the data adjusting instruction to obtain a primary screening test data set, performing secondary screening on the test data in the standard test data set based on the text assertion and the test assertion, and summarizing the test data asserted to be true as the standard test data set.
In the embodiment of the invention, the initial test data set is manually and primarily screened through the data adjusting instruction, and then the volume data set is automatically screened in a way of executing assertion, so that the test efficiency is improved.
In another optional embodiment of the present invention, after the screening the initial test data set based on the data adjustment instruction to obtain a standard test data set, the method further includes: and judging whether the operation time limit of the standard data set meets a preset time limit requirement or not, if the operation time limit of the standard data set does not meet the preset time limit requirement, returning to the step of acquiring the target page, and generating a recording toolbar of the target page by using a preset browser plug-in, and if the operation time limit of the standard data set meets the preset time limit requirement, storing the recording toolbar in a preset database.
In the embodiment of the invention, in order to ensure the continuity of the page test, the execution time of the standard test data set needs to be required, for example, if the operation is not performed for 5 minutes, the test data set is discarded.
And S4, performing assertion test on the target page by using the standard test data set to obtain a page test result.
In the embodiment of the present invention, the assertion test is to determine whether the test data in the standard test data can be successfully executed in the page by using assertion.
Further, the performing assertion test on the target page by using the standard test data set to obtain a page test result includes: and acquiring the standard test data set by using a preset simulation browser, executing the test data in the standard test data set one by one in the simulation browser, if assertion fails or cannot be executed, determining that the page test result is page test failure, and if all the test data in the standard test data set are executed successfully, determining that the page test result is page test failure.
In an optional embodiment of the invention, the page automatic test is performed by replaying the test data, that is, according to the stored test data, a simulation browser is opened, and the test case steps are executed one by one until the assertion fails or cannot be executed, that is, the page test fails, and if the page test fails, the page test is judged to be successful if the test is normally executed to the last step. Meanwhile, only one page test is needed manually, and the subsequent page test can be performed through the recorded data, so that the efficiency of the page test is improved.
According to the invention, the test event in the target page is recorded through the recording toolbar generated by the browser plug-in, an initial test data set can be obtained based on the test event in the target page, a standard test data set is obtained through screening, the target page is subjected to assertion test by using the standard test data set, repeated manual test is not needed, a page test result can be directly obtained, and the page test efficiency is greatly improved. Therefore, the page testing method provided by the invention can solve the problem of low page testing efficiency.
Fig. 3 is a functional block diagram of a page testing apparatus according to an embodiment of the present invention.
The page testing device 100 of the present invention can be installed in an electronic device. According to the implemented functions, the page testing apparatus 100 may include a recording tool generating module 101, a test data recording module 102, a test data screening module 103, and a page testing module 104. The module of the present invention, which may also be referred to as a unit, refers to a series of computer program segments that can be executed by a processor of an electronic device and that can perform a fixed function, and that are stored in a memory of the electronic device.
In the present embodiment, the functions regarding the respective modules/units are as follows:
the recording tool generating module 101 is configured to acquire a target page, and generate a recording toolbar of the target page by using a preset browser plug-in;
the test data recording module 102 is configured to receive a page recording instruction generated by a user clicking the recording toolbar, and record a test event in the target page based on the page recording instruction to obtain an initial test data set;
the test data screening module 103 is configured to receive a data adjustment instruction generated by clicking the recording toolbar by a user, and screen the initial test data set based on the data adjustment instruction to obtain a standard test data set;
the page testing module 104 is configured to perform assertion testing on the target page by using the standard test data set, so as to obtain a page testing result.
In detail, the specific implementation of each module of the page testing apparatus 100 is as follows:
the method comprises the steps of firstly, obtaining a target page, and generating a recording toolbar of the target page by utilizing a preset browser plug-in.
In the embodiment of the present invention, the target page refers to a front-end page to be tested, for example, a Web page, an h5 page, and the like. The preset browser plug-in may be a recording plug-in a third-party browser, for example, a recording plug-in a chrome browser.
In detail, the generating of the recording toolbar of the target page by using a preset browser plug-in includes: and opening the target page by using a preset browser, loading a recording script according to the browser plug-in, and generating the recording toolbar in the target page based on the recording script.
In an optional embodiment of the present invention, the preset browser may be a chrome browser, and the browser plug-in may be a screencasting tool, an autoranner tool, and the like. The recording toolbar comprises buttons such as start/pause and stop.
In the embodiment of the invention, the target page is opened through the browser, and the recording toolbar is generated through the browser plug-in, so that the recording process of the page test can be controlled, and the accuracy and controllability of the page detection are improved.
And step two, receiving a page recording instruction generated by clicking the recording toolbar by a user, and recording the test event in the target page based on the page recording instruction to obtain an initial test data set.
In the embodiment of the invention, a user clicks a 'start' button in a recording toolbar to send a page recording instruction to start recording. The test event includes a web page click event, an input user event, a triggered request, and the like.
Specifically, the recording the test event in the target page based on the page recording instruction to obtain an initial test data set includes:
recording the click events in the target page and converting the click events into click test scripts;
recording the input events in the target page and converting the input events into input test scripts;
recording the detection events in the target page and converting the detection events into detection test scripts;
and summarizing the clicking test script, the input test script and the detection test script to obtain the initial test data set.
In the embodiment of the invention, each component in the page is detected in the page detection process, including a click event, an input event, a detection event and the like, for example, the click event tests the click condition of each part of the page, including a skipped page, character information and the like, the input event tests the problems of text specification and the like by inputting information in a text box, and the detection event is used for detecting whether the sizes of each button, frame and the like in the page are in compliance or not.
In an optional embodiment of the present invention, for example, a certain click event is used to jump from an a page to a B page, and a process of a tester clicking a button on the a page to jump to the B page is recorded by an autoranner tool, so that a test case (i.e., a click test script) "clickControl-test-01" can be directly generated.
In the embodiment of the invention, each test event in the page test can be directly converted into the test script through the screen recording plug-in, so that the automation and the efficiency of the page test are greatly improved.
And step three, receiving a data adjustment instruction generated by clicking the recording toolbar by a user, and screening the initial test data set based on the data adjustment instruction to obtain a standard test data set.
In the embodiment of the invention, the data adjusting instruction is used for classifying, screening, arranging and the like the test scripts in the initial test data set, and the accuracy of page testing can be improved by screening unnecessary test cases.
In detail, before the screening the initial test data set based on the data adjustment instruction to obtain a standard test data set, the method further includes: obtaining texts generated by the click events, the input events and the detection events in the target page, constructing text assertions based on the texts, and constructing test assertions according to the click events, the input events and the detection events.
In one embodiment of the present invention, an assertion (assertion) is a first-order logic (e.g., a logic decision formula with a true or false result) in a program, and is intended to represent a result expected by a software developer, where when the program is executed to a position of the assertion, the corresponding assertion should be true, and if the assertion is not true, the program will stop executing and give an error message.
In an optional embodiment of the present invention, the text assertion refers to a program for determining whether a text is correct, and the test assertion refers to a program for determining whether a click event, an input event, a detection event, and the like are successfully detected.
Specifically, the screening the initial test data set based on the data adjustment instruction to obtain a standard test data set includes: and performing primary screening on the initial test data set based on the data adjusting instruction to obtain a primary screening test data set, performing secondary screening on the test data in the standard test data set based on the text assertion and the test assertion, and summarizing the test data asserted to be true as the standard test data set.
In the embodiment of the invention, the initial test data set is manually and primarily screened through the data adjusting instruction, and then the volume data set is automatically screened in a way of executing assertion, so that the test efficiency is improved.
In another optional embodiment of the present invention, after the screening the initial test data set based on the data adjustment instruction to obtain a standard test data set, the method further includes: and judging whether the operation time limit of the standard data set meets a preset time limit requirement or not, if the operation time limit of the standard data set does not meet the preset time limit requirement, returning to the step of acquiring the target page, and generating a recording toolbar of the target page by using a preset browser plug-in, and if the operation time limit of the standard data set meets the preset time limit requirement, storing the recording toolbar in a preset database.
In the embodiment of the invention, in order to ensure the continuity of the page test, the execution time of the standard test data set needs to be required, for example, if the operation is not performed for 5 minutes, the test data set is discarded.
And fourthly, performing assertion test on the target page by using the standard test data set to obtain a page test result.
In the embodiment of the present invention, the assertion test is to determine whether the test data in the standard test data can be successfully executed in the page by using assertion.
Further, the performing assertion test on the target page by using the standard test data set to obtain a page test result includes: and acquiring the standard test data set by using a preset simulation browser, executing the test data in the standard test data set one by one in the simulation browser, if assertion fails or cannot be executed, determining that the page test result is page test failure, and if all the test data in the standard test data set are executed successfully, determining that the page test result is page test failure.
In an optional embodiment of the present invention, the page automatic test is performed by replaying the test data, that is, according to the stored test data, the simulation browser is opened, and the test case steps are executed one by one until the assertion fails or cannot be executed, that is, the page test fails, and if the page test fails in the last step of normal execution, the page test succeeds. Meanwhile, only one page test is needed manually, and the subsequent page test can be performed through the recorded data, so that the efficiency of the page test is improved.
According to the invention, the test event in the target page is recorded through the recording toolbar generated by the browser plug-in, an initial test data set can be obtained based on the test event in the target page, a standard test data set is obtained through screening, the target page is subjected to assertion test by using the standard test data set, repeated manual test is not needed, a page test result can be directly obtained, and the page test efficiency is greatly improved. Therefore, the page testing device provided by the invention can solve the problem of low page testing efficiency.
Fig. 4 is a schematic structural diagram of an electronic device implementing a page testing method according to an embodiment of the present invention.
The electronic device may comprise a processor 10, a memory 11, a communication interface 12 and a bus 13, and may further comprise a computer program, such as a page test program, stored in the memory 11 and executable on the processor 10.
The memory 11 includes at least one type of readable storage medium, which includes flash memory, removable hard disk, multimedia card, card type memory (e.g., SD or DX memory, etc.), magnetic memory, magnetic disk, optical disk, etc. The memory 11 may in some embodiments be an internal storage unit of the electronic device, for example a removable hard disk of the electronic device. The memory 11 may also be an external storage device of the electronic device in other embodiments, such as a plug-in mobile hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like, which are provided on the electronic device. Further, the memory 11 may also include both an internal storage unit and an external storage device of the electronic device. The memory 11 may be used not only to store application software installed in the electronic device and various types of data, such as a code of a page test program, etc., but also to temporarily store data that has been output or is to be output.
The processor 10 may be composed of an integrated circuit in some embodiments, for example, a single packaged integrated circuit, or may be composed of a plurality of integrated circuits packaged with the same or different functions, including one or more Central Processing Units (CPUs), microprocessors, digital Processing chips, graphics processors, and combinations of various control chips. The processor 10 is a Control Unit (Control Unit) of the electronic device, connects various components of the electronic device by using various interfaces and lines, and executes various functions and processes data of the electronic device by running or executing programs or modules (e.g., page test programs, etc.) stored in the memory 11 and calling data stored in the memory 11.
The communication interface 12 is used for communication between the electronic device and other devices, and includes a network interface and a user interface. Optionally, the network interface may include a wired interface and/or a wireless interface (e.g., WI-FI interface, bluetooth interface, etc.), which are typically used to establish a communication connection between the electronic device and other electronic devices. The user interface may be a Display (Display), an input unit such as a Keyboard (Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
The bus 13 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus 13 may be divided into an address bus, a data bus, a control bus, etc. The bus 13 is arranged to enable connection communication between the memory 11 and at least one processor 10 or the like.
Fig. 4 shows only an electronic device having components, and those skilled in the art will appreciate that the structure shown in fig. 4 does not constitute a limitation of the electronic device, and may include fewer or more components than those shown, or some components may be combined, or a different arrangement of components.
For example, although not shown, the electronic device may further include a power supply (such as a battery) for supplying power to each component, and preferably, the power supply may be logically connected to the at least one processor 10 through a power management device, so that functions of charge management, discharge management, power consumption management and the like are realized through the power management device. The power supply may also include any component of one or more dc or ac power sources, recharging devices, power failure detection circuitry, power converters or inverters, power status indicators, and the like. The electronic device may further include various sensors, a bluetooth module, a Wi-Fi module, and the like, which are not described herein again.
Further, the electronic device may further include a network interface, and optionally, the network interface may include a wired interface and/or a wireless interface (such as a WI-FI interface, a bluetooth interface, etc.), which are generally used to establish a communication connection between the electronic device and other electronic devices.
Optionally, the electronic device may further comprise a user interface, which may be a Display (Display), an input unit (such as a Keyboard), and optionally a standard wired interface, a wireless interface. Alternatively, in some embodiments, the display may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, or the like. The display, which may also be referred to as a display screen or display unit, is suitable, among other things, for displaying information processed in the electronic device and for displaying a visualized user interface.
It is to be understood that the described embodiments are for purposes of illustration only and that the scope of the appended claims is not limited to such structures.
The page test program stored in the memory 11 of the electronic device is a combination of a plurality of instructions, and when running in the processor 10, can realize:
acquiring a target page, and generating a recording toolbar of the target page by using a preset browser plug-in;
receiving a page recording instruction generated by clicking the recording toolbar by a user, and recording a test event in the target page based on the page recording instruction to obtain an initial test data set;
receiving a data adjusting instruction generated by clicking the recording toolbar by a user, and screening the initial test data set based on the data adjusting instruction to obtain a standard test data set;
and performing assertion test on the target page by using the standard test data set to obtain a page test result.
Specifically, the specific implementation method of the processor 10 for the instruction may refer to the description of the relevant steps in the embodiment corresponding to the drawing, and is not repeated here.
Further, the electronic device integrated module/unit, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in a computer readable storage medium. The computer readable storage medium may be volatile or non-volatile. For example, the computer-readable medium may include: any entity or device capable of carrying said computer program code, a recording medium, a usb-disk, a removable hard disk, a magnetic diskette, an optical disk, a computer Memory, a Read-Only Memory (ROM).
The present invention also provides a computer-readable storage medium, storing a computer program which, when executed by a processor of an electronic device, may implement:
acquiring a target page, and generating a recording toolbar of the target page by using a preset browser plug-in;
receiving a page recording instruction generated by clicking the recording toolbar by a user, and recording a test event in the target page based on the page recording instruction to obtain an initial test data set;
receiving a data adjustment instruction generated by clicking the recording toolbar by a user, and screening the initial test data set based on the data adjustment instruction to obtain a standard test data set;
and performing assertion test on the target page by using the standard test data set to obtain a page test result.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus, device and method can be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the modules is only one logical functional division, and other divisions may be realized in practice.
The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the present embodiment.
In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional module.
It will be evident to those skilled in the art that the invention is not limited to the details of the foregoing illustrative embodiments, and that the present invention may be embodied in other specific forms without departing from the spirit or essential attributes thereof.
The present embodiments are therefore to be considered in all respects as illustrative and not restrictive, the scope of the invention being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference signs in the claims shall not be construed as limiting the claim concerned.
The embodiment of the invention can acquire and process related data based on an artificial intelligence technology. Among them, Artificial Intelligence (AI) is a theory, method, technique and application system that simulates, extends and expands human Intelligence using a digital computer or a machine controlled by a digital computer, senses the environment, acquires knowledge and uses the knowledge to obtain the best result.
The artificial intelligence infrastructure generally includes technologies such as sensors, dedicated artificial intelligence chips, cloud computing, distributed storage, big data processing technologies, operation/interaction systems, mechatronics, and the like. The artificial intelligence software technology mainly comprises a computer vision technology, a robot technology, a biological recognition technology, a voice processing technology, a natural language processing technology, machine learning/deep learning and the like.
The block chain 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.
Furthermore, it is obvious that the word "comprising" does not exclude other elements or steps, and the singular does not exclude the plural. A plurality of units or means recited in the system claims may also be implemented by one unit or means in software or hardware. The terms second, etc. are used to denote names, but not to denote any particular order.
Finally, it should be noted that the above embodiments are only for illustrating the technical solutions of the present invention and not for limiting, and although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that modifications or equivalent substitutions may be made on the technical solutions of the present invention without departing from the spirit and scope of the technical solutions of the present invention.

Claims (10)

1. A page testing method is characterized by comprising the following steps:
acquiring a target page, and generating a recording toolbar of the target page by using a preset browser plug-in;
receiving a page recording instruction generated by clicking the recording toolbar by a user, and recording a test event in the target page based on the page recording instruction to obtain an initial test data set;
receiving a data adjustment instruction generated by clicking the recording toolbar by a user, and screening the initial test data set based on the data adjustment instruction to obtain a standard test data set;
and performing assertion test on the target page by using the standard test data set to obtain a page test result.
2. The page testing method according to claim 1, wherein said recording the test event in the target page based on the page recording instruction to obtain an initial test data set comprises:
recording the click events in the target page and converting the click events into click test scripts;
recording the input events in the target page and converting the input events into input test scripts;
recording the detection events in the target page and converting the detection events into detection test scripts;
and summarizing the click test script, the input test script and the detection test script to obtain the initial test data set.
3. The page testing method of claim 1, wherein before the screening the initial test data set based on the data adjustment instruction to obtain a standard test data set, the method further comprises:
acquiring a click event, an input event and a text generated by a detection event in the target page;
and constructing text assertions based on the texts, and constructing test assertions according to the clicking events, the inputting events and the detecting events.
4. The page testing method of claim 3, wherein said screening said initial test data set based on said data adjustment instruction to obtain a standard test data set comprises:
performing primary screening on the initial test data set based on the data adjusting instruction to obtain a primary screening test data set;
and performing secondary screening on the test data in the standard test data set based on the text assertion and the test assertion, and summarizing the test data asserted as true as the standard test data set.
5. The page testing method of claim 1, wherein after the screening of the initial test data set based on the data adjustment instruction to obtain a standard test data set, the method further comprises:
judging whether the operation time limit of the standard data set meets a preset time limit requirement or not;
if the operation time limit of the standard data set does not meet the preset time limit requirement, returning to the step of acquiring the target page, and generating a recording toolbar of the target page by using a preset browser plug-in;
and if the operation time limit of the standard data set meets the preset time limit requirement, storing the operation time limit into a preset database.
6. The page testing method according to claim 1, wherein said performing assertion testing on said target page by using said standard test data set to obtain a page test result comprises:
acquiring the standard test data set by using a preset simulation browser, and executing the test data in the standard test data set one by one in the simulation browser;
if the assertion fails or cannot be executed, determining that the page test result is a page test failure;
and if all the test data in the standard test data set are successfully executed, determining that the page test result is a page test failure.
7. The page testing method of claim 1, wherein the generating of the recording toolbar of the target page using a preset browser plug-in comprises: and opening the target page by using a preset browser, loading a recording script according to the browser plug-in, and generating the recording toolbar in the target page based on the recording script.
8. A page testing apparatus, characterized in that the apparatus comprises:
the recording tool generating module is used for acquiring a target page and generating a recording tool bar of the target page by using a preset browser plug-in;
the test data recording module is used for receiving a page recording instruction generated by clicking the recording toolbar by a user, and recording a test event in the target page based on the page recording instruction to obtain an initial test data set;
the test data screening module is used for receiving a data adjusting instruction generated by clicking the recording toolbar by a user, and screening the initial test data set based on the data adjusting instruction to obtain a standard test data set;
and the page testing module is used for carrying out assertion testing on the target page by using the standard testing data set to obtain a page testing result.
9. An electronic device, characterized in that the electronic device comprises:
at least one processor; and the number of the first and second groups,
a memory communicatively coupled to the at least one processor; wherein the content of the first and second substances,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the page testing method of any one of claims 1 to 7.
10. A computer-readable storage medium, in which a computer program is stored which, when being executed by a processor, carries out the page testing method according to any one of claims 1 to 7.
CN202210438563.3A 2022-04-25 2022-04-25 Page testing method and device, electronic equipment and readable storage medium Pending CN114936148A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210438563.3A CN114936148A (en) 2022-04-25 2022-04-25 Page testing method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210438563.3A CN114936148A (en) 2022-04-25 2022-04-25 Page testing method and device, electronic equipment and readable storage medium

Publications (1)

Publication Number Publication Date
CN114936148A true CN114936148A (en) 2022-08-23

Family

ID=82862655

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210438563.3A Pending CN114936148A (en) 2022-04-25 2022-04-25 Page testing method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN114936148A (en)

Similar Documents

Publication Publication Date Title
US9208451B2 (en) Automatic identification of information useful for generation-based functional verification
US7895575B2 (en) Apparatus and method for generating test driver
US20090019427A1 (en) Method and Apparatus for Providing Requirement Driven Static Analysis of Test Coverage for Web-Based, Distributed Processes
CN111858371A (en) Software testing method, system, storage medium and computer equipment
CN110990053A (en) Method for creating and using machine learning scheme template and device
CN113238929B (en) Code testing method and device based on Mock data, electronic equipment and storage medium
Tierno et al. Open issues for the automotive software testing
CN112559355A (en) Test case generation method and device, electronic equipment and storage medium
CN114880238A (en) Mobile terminal interface testing method, device, equipment and storage medium
CN112579475A (en) Code testing method, device, equipment and readable storage medium
CN113342692A (en) Test case automatic generation method and device, electronic equipment and storage medium
CN112631903A (en) Task testing method and device, electronic equipment and storage medium
CN113051171B (en) Interface testing method, device, equipment and storage medium
CN114398282A (en) Test script generation method, device, equipment and storage medium
CN114896164A (en) Interface optimization method and device, electronic equipment and storage medium
CN114936148A (en) Page testing method and device, electronic equipment and readable storage medium
CN114116488A (en) Method, device and equipment for acquiring test coverage rate information and storage medium
CN115033489A (en) Code resource detection method and device, electronic equipment and storage medium
CN111859985B (en) AI customer service model test method and device, electronic equipment and storage medium
CN114546850A (en) Automatic testing method, system and device for embedded point and storage medium
CN111400190A (en) Automatic test flow generation method and device and computer readable storage medium
CN112613257A (en) Verification method, verification device, electronic equipment and computer-readable storage medium
US7277840B2 (en) Method for detecting bus contention from RTL description
CN115328812B (en) UI (user interface) testing method, device, equipment and medium based on web crawler
CN111538770B (en) Data monitoring method and device, electronic equipment and readable storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination