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

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

Info

Publication number
CN110362488B
CN110362488B CN201910628860.2A CN201910628860A CN110362488B CN 110362488 B CN110362488 B CN 110362488B CN 201910628860 A CN201910628860 A CN 201910628860A CN 110362488 B CN110362488 B CN 110362488B
Authority
CN
China
Prior art keywords
test
browser
page
target
target page
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.)
Active
Application number
CN201910628860.2A
Other languages
Chinese (zh)
Other versions
CN110362488A (en
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.)
Beijing ByteDance Network Technology Co Ltd
Original Assignee
Beijing ByteDance Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing ByteDance Network Technology Co Ltd filed Critical Beijing ByteDance Network Technology Co Ltd
Priority to CN201910628860.2A priority Critical patent/CN110362488B/en
Publication of CN110362488A publication Critical patent/CN110362488A/en
Application granted granted Critical
Publication of CN110362488B publication Critical patent/CN110362488B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • 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 discloses a page testing method, a page testing device, electronic equipment and a storage medium; the method comprises the following steps: acquiring a test browser set matched with a target page to be tested and a smoking test item set; starting at least one target test browser in the test browser set, and executing the operation of loading the target page in the target test browser; and carrying out smoking test on the target page in the at least one target test browser by adopting each smoking test item included in the smoking test item set. According to the technical scheme, the test browser set and the smoking test item set matched with the target page are obtained, so that the target page is opened by using a plurality of browsers respectively to perform smoking tests, the tests of a plurality of smoking test items are completed in one smoking test, and the test efficiency of the smoking test is improved.

Description

Page testing method and device, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the technical field of networks, in particular to a page testing method, a page testing device, electronic equipment and a storage medium.
Background
With the rapid development of network technology, the internet coverage crowd is wider and wider, and web pages are used as the most basic information display modes, so that wide functional services are provided for users, and the functional test of the web pages is becoming more and more important.
The smoking test is used as one of the webpage tests, and aims to confirm that the basic functions of the webpage run normally, avoid defects in the webpage, and not require each function in the webpage to be tested in detail, but the coverage area of the test is as large as possible, so that more webpage functions are tested.
In implementing the present disclosure, the inventors have found that the prior art has the following drawbacks: because the smoke test requires a test range as large as possible, multiple tests are often required for one webpage to find loopholes of various functions, but such a test mode requires a lot of time, manpower resources and test resources, and the test efficiency is too low.
Disclosure of Invention
The invention provides a page test method, a page test device, electronic equipment and a storage medium, which are used for completing the test of a plurality of smoking test items in one smoking test.
In a first aspect, an embodiment of the present invention provides a page testing method, including:
acquiring a test browser set matched with a target page to be tested and a smoking test item set;
starting at least one target test browser in the test browser set, and executing the operation of loading the target page in the target test browser;
and carrying out smoking test on the target page in the at least one target test browser by adopting each smoking test item included in the smoking test item set.
In a second aspect, an embodiment of the present invention provides a page testing apparatus, including:
the test set acquisition module is used for acquiring a test browser set matched with a target page to be tested and a smoking test item set;
the target page loading module is used for starting at least one target test browser in the test browser set and executing the operation of loading the target page in the target test browser;
and the smoking test execution module is used for carrying out smoking test on the target page in the at least one target test browser by adopting each smoking test item included in the smoking test item set.
In a third aspect, an embodiment of the present invention provides an electronic device, including a memory, a processing device, and a computer program stored in the memory and capable of running on the processing device, where the processing device implements the page testing method according to any embodiment of the present disclosure when the processing device executes the program.
In a fourth aspect, embodiments of the present invention provide a storage medium containing computer-executable instructions, which when executed by a computer processor, are used to perform the page testing method of any of the embodiments of the present disclosure.
According to the invention, through acquiring the test browser set and the smoking test item set matched with the target pages, and carrying out smoking test according to each smoking test item included in the smoking test item set after loading the target webpage in at least one target test browser, not only is the smoking test carried out by respectively opening the target webpage by using a plurality of browsers simultaneously, but also the test of a plurality of smoking test items is completed in one smoking test, and the test efficiency of the smoking test is improved.
Drawings
The above and other features, advantages, and aspects of embodiments of the present disclosure will become more apparent by reference to the following detailed description when taken in conjunction with the accompanying drawings. The same or similar reference numbers will be used throughout the drawings to refer to the same or like elements. It should be understood that the figures are schematic and that elements and components are not necessarily drawn to scale.
FIG. 1 is a flow chart of a page testing method in accordance with a first embodiment of the present disclosure;
FIG. 2 is a flow chart of a page testing method in a second embodiment of the present disclosure;
FIG. 3 is a block diagram of a page testing apparatus in accordance with a third embodiment of the present disclosure;
fig. 4 is a block diagram of an electronic device in a fourth embodiment of the present disclosure.
Detailed Description
Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While certain embodiments of the present disclosure have been shown in the accompanying drawings, it is to be understood that the present disclosure may be embodied in various forms and should not be construed as limited to the embodiments set forth herein, but are provided to provide a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are for illustration purposes only and are not intended to limit the scope of the present disclosure.
It should be understood that the various steps recited in the method embodiments of the present disclosure may be performed in a different order and/or performed in parallel. Furthermore, method embodiments may include additional steps and/or omit performing the illustrated steps. The scope of the present disclosure is not limited in this respect.
The term "including" and variations thereof as used herein are intended to be open-ended, i.e., including, but not limited to. The term "based on" is based at least in part on. The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments. Related definitions of other terms will be given in the description below.
It should be noted that the terms "first," "second," and the like in this disclosure are merely used to distinguish between different devices, modules, or units and are not used to define an order or interdependence of functions performed by the devices, modules, or units.
It should be noted that references to "one", "a plurality" and "a plurality" in this disclosure are intended to be illustrative rather than limiting, and those of ordinary skill in the art will appreciate that "one or more" is intended to be understood as "one or more" unless the context clearly indicates otherwise.
The names of messages or information interacted between the various devices in the embodiments of the present disclosure are for illustrative purposes only and are not intended to limit the scope of such messages or information.
Example 1
Fig. 1 is a flowchart of a page testing method provided in an embodiment of the present disclosure, where the method may be applied to a case of testing whether a page has a security hole and a defect, and the method may be performed by a page testing device, and the device may be implemented by software and/or hardware and may be generally integrated in a page testing server, and the method specifically includes the following steps:
s110, acquiring a test browser set matched with a target page to be tested and a smoking test item set.
The test browser collection includes one or more test browsers for opening a target page. Since the browser interprets the grammar of the web page and renders the web page through the browser kernel (Rendering Engine), the browser kernel determines how the browser displays the content of the web page and the format information of the web page, and the interpretation of the grammar written by different browser kernels is different, so that the Rendering effect of the same web page in the browsers of different kernels may be different. In order to ensure that the target page can be opened in different browsers, the browsers using different browser kernels can be formed into a test browser set; for example, a Firefox browser using the Gecko kernel, a Chrome browser and a Safari browser using the Webkit kernel, and an IE browser using the Trident kernel make up the test browser set. Optionally, in the embodiment of the present disclosure, the kind and number of the test browsers included in the test browser set are not specifically limited.
Optionally, the test browser set includes a headless browser; headless browser (GUI) refers to a browser without a user graphical interface (Graphical User Interface), controlled by a programming or command line interface, which has all the functions of a conventional browser except that no specific interface is displayed. Compared with the traditional browser, the testing speed of the headless browser is higher, the testing stability is better, the headless browser can run on the testing server without an interface, the external interference is reduced, and meanwhile, a plurality of headless browsers can be simulated and run on one testing server, so that the concurrent testing is facilitated.
In a software program, a smoking test is a process of verifying code changes before the code changes are embedded into a source tree of a product, and after the code is checked, the smoking test can effectively search and repair software defects and can also confirm whether the changes in the code are operated as expected or not, and whether the stability of the whole version is not destroyed. For page testing, the function of smoke testing is to confirm that the basic function of the webpage is normal, and security holes and defects in the webpage are avoided; optionally, in an embodiment of the disclosure, the set of smoking test items includes: compatibility testing, resource request testing, console information testing, and variability testing.
S120, starting at least one target test browser in the test browser set, and executing the operation of loading the target page in the target test browser.
For a target page to be tested, the target page can be opened through one target test browser, and also can be opened through a plurality of target test browsers at the same time; the target test browser reads the program of the target page into the memory, and opens the target page after loading.
Optionally, the target test browser is started through a browser automation test framework; the automated test framework is a tool set composed of functional modules applied to automated testing and comprises one or more of a basic automated test module, an architecture module for providing automated test execution and management functions and an automated test statistics module; in the embodiment of the disclosure, the target test browser is started through a Selenium browser automation test framework, the Selenium can directly run in the browser, and the method has the characteristic of wide coverage range, and supports various browsers running on Windows, linux, macintosh and other systems, such as IE, chrome, firefox and the like; the Selenium can test the compatibility of pages with the browser and also can test system functions, for example, create regression tests, verify software functions and user requirements.
Optionally, before starting at least one target test browser in the test browser set and executing the operation of loading the target page in the target test browser, the method includes: the page test operation is triggered by a mode of timing triggering, tracking Git branch triggering or manual triggering. Git is an open-source distributed version control system for performing version management of the project; the Git branches separate tasks such as testing, new function development, bug repair and the like from a project development main line, so that the main line task is prevented from being influenced, and the stability and safety of the development main line task are ensured; thus, page testing may be triggered by tracking the branching tasks of Git.
S130, carrying out smoking test on the target page in the at least one target test browser by adopting each smoking test item included in the smoking test item set.
Optionally, after performing the smoking test on the target page in the at least one target test browser by using each smoking test item included in the smoking test item set, the method includes: and generating a visual test result and providing the visual test result to a developer matched with the page. And generating a visual test result from the test result of the current smoking test, and providing the visual test result for a developer of the page to view and/or download.
Optionally, after performing the smoking test on the target page in the at least one target test browser by using each smoking test item included in the smoking test item set, the method includes: if the loopholes of the preset type are detected, sending alarm prompts to developers matched with the page so as to prompt the page developers to process in time. Specifically, different alarm modes can be preset for loopholes of different preset types, for example, when a general loophole or defect is detected, if the loading time of the page resource exceeds a preset time threshold, a page developer is notified in a mail mode; when serious loopholes or defects are detected, if malicious implanted scripts or advertisements are detected in the page, the page developer is notified by flashing an indicator light and/or triggering an alarm sound and the like.
According to the technical scheme, the smoking test is carried out according to each smoking test item included in the smoking test item set after the target webpage is loaded in at least one target test browser by acquiring the test browser set and the smoking test item set matched with the target webpage, so that the smoking test is carried out by respectively opening the target webpage by using a plurality of browsers at the same time, the test of a plurality of smoking test items in one smoking test is finished, and the test efficiency of the smoking test is improved.
Example two
Fig. 2 is a flowchart of a page testing method in a second embodiment of the disclosure, which is implemented based on the foregoing embodiment, where the set of smoking test items includes: compatibility testing, resource request testing, console information testing and diversity testing; correspondingly, the method of the embodiment specifically comprises the following operations:
s210, carrying out compatibility test on the target page according to the loading condition of the target test browser on the target page.
Compatibility test (Compatibility Test Suite, CTS for short) is to check whether the software program can run normally on hardware and/or software platform; in the disclosed embodiments, the compatibility test includes a browser compatibility test; browser compatibility, that is, web page compatibility, is a problem of compatibility between a browser and a web page due to inconsistent display effects of the web page on various browsers. Different browsers use different webpage language standards such as kernels and supported HTML, and the same webpage is on different browsers, so that different display effects are often caused, for example, the positions of webpage elements are disordered or misplaced, and the webpage is opened with a white screen, so that the webpage can be normally displayed on different browsers, and the webpage is the most intuitive feeling in user experience.
S220, monitoring resource request information matched with the target page through an external request interface of the test browser.
The webpage comprises one or more elements such as characters, pictures, videos, tables and/or files, and the like, and the elements and descriptive information thereof, such as size, color, position, fonts and the like, jointly form resources in the webpage; monitoring resource request information matched with a target page, including monitoring the display condition of each resource in the target page, for example, whether each resource can be normally displayed, whether each resource loading time is too long, and the like; monitoring resource request information matched with the target page, and monitoring non-self resource information in the target page, for example, whether a maliciously implanted script or advertisement exists in the webpage or not.
S230, acquiring control platform information of a set type matched with the target page from a front-end control platform matched with the test browser.
The Console (Console) is used for displaying log information generated by the browser in the process of loading the webpage; the console information includes network request information, javaScript script information, CSS (Cascading Style Sheets, cascading style sheet) information, security-related error and warning information, and errors, warnings, and related information generated by JavaScript code on the page when running.
S240, intercepting the display information of the target page in the test browser, storing the display information in a version comparison library, and performing differential comparison with the display information stored in the page in the version comparison library.
Each time the target page is opened in the test browser, the displayed information is intercepted and stored in the version comparison library; the version comparison library stores the historical display information of the target page in the previous page test, and can compare the current intercepted display information of the target page with the historical display information opened by using the same test browser, for example, after the target page is opened by an IE browser, the current display information is intercepted, and the display information is compared with the historical display information of the target page which is also opened by the IE browser, and whether the historical display information of the same test browser aiming at the same target page has the difference in time sequence is compared; the method can also compare the differences of the intercepted current display information after the target webpage is opened through different test browsers, for example, the target webpage is opened through an IE browser and a Chrome browser at the same time, the intercepted current display information on the two test browsers is compared, the respectively intercepted current display information on the two test browsers is compared, and whether the display information of the same target webpage has differences in different opening modes is compared; the current intercepted display information of the target webpage can be compared with the historical display information opened by using different test browsers, for example, after the target webpage is opened by an IE browser, the current display information is intercepted, and the display information is compared with the historical display information of the target webpage opened by a Chrome browser, so that whether the current display information of the same target webpage is different from the historical display information in different opening modes and different time sequences is compared. In particular, after the page resource is added, deleted or modified, whether the added, deleted or modified part is valid or not can be determined by comparing the current display information with the historical display information.
According to the technical scheme, multiple functional tests including compatibility tests, resource request tests, console information tests and difference tests are completed in the smoking test of the target page, all basic functions in the front-end test are covered, and the testing efficiency of the smoking test is improved.
Example III
Fig. 3 is a block diagram of a page testing apparatus according to a third embodiment of the present disclosure, which specifically includes: a test set acquisition module 310, a target page loading module 320, and a smoke test execution module 330.
A test set acquisition module 310, configured to acquire a test browser set matched with a target page to be tested, and a smoke test item set;
a target page loading module 320, configured to start at least one target test browser in the test browser set, and perform an operation of loading the target page in the target test browser;
and a smoke test execution module 330, configured to perform a smoke test on the target page in the at least one target test browser using each smoke test item included in the smoke test item set.
According to the technical scheme, the smoking test is carried out according to each smoking test item included in the smoking test item set after the target webpage is loaded in at least one target test browser by acquiring the test browser set and the smoking test item set matched with the target webpage, so that the smoking test is carried out by respectively opening the target webpage by using a plurality of browsers at the same time, the test of a plurality of smoking test items in one smoking test is finished, and the test efficiency of the smoking test is improved.
Optionally, on the basis of the above technical solution, the set of smoking test items includes: compatibility testing, resource request testing, console information testing, and variability testing.
Optionally, based on the above technical solution, the smoke emission test execution module 330 specifically includes:
the compatibility testing unit is used for carrying out compatibility testing on the target page according to the loading condition of the target test browser on the target page;
the resource request testing unit is used for monitoring resource request information matched with the target page through an external request interface of the testing browser;
the control console information testing unit is used for acquiring control console information of a set type matched with the target page from a front-end control console matched with the test browser;
and the difference testing unit is used for intercepting the display information of the target page in the test browser, storing the display information into a version comparison library and carrying out difference comparison with the display information stored in the page in the version comparison library.
Optionally, on the basis of the above technical solution, the page testing device further includes:
and the page test operation triggering module is used for triggering the page test operation in a mode of timing, tracking Git branches or manually.
Optionally, on the basis of the above technical solution, the test browser set includes a headless browser.
Optionally, on the basis of the above technical solution, the page testing device further includes:
and the visual test result acquisition module is used for generating visual test results and providing the visual test results to developers matched with the page.
Optionally, on the basis of the above technical solution, the page testing device further includes:
and the alarm prompt module is used for sending an alarm prompt to a developer matched with the page if the preset type of loopholes are detected.
Optionally, on the basis of the above technical solution, the alarm prompting module is specifically configured to:
if the loopholes of the preset types are detected, an alarm mode matched with the loopholes is obtained, and an alarm prompt is sent to a developer matched with the page through the alarm mode.
The device can execute the page test method provided by any embodiment of the disclosure, and has the corresponding functional modules and beneficial effects of the execution method. Technical details not described in detail in this embodiment may be found in the methods provided by any of the embodiments of the present disclosure.
Example IV
Referring now to fig. 4, a schematic diagram of an electronic device 400 suitable for use in implementing embodiments of the present disclosure is shown. The terminal devices in the embodiments of the present disclosure may include, but are not limited to, mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and stationary terminals such as digital TVs, desktop computers, and the like. The electronic device shown in fig. 4 is merely an example and should not be construed to limit the functionality and scope of use of the disclosed embodiments.
As shown in fig. 4, the electronic device 400 may include a processing means (e.g., a central processing unit, a graphics processor, etc.) 401, which may perform various appropriate actions and processes according to a program stored in a Read Only Memory (ROM) 402 or a program loaded from a storage means 406 into a Random Access Memory (RAM) 403. In the RAM 403, various programs and data necessary for the operation of the electronic device 400 are also stored. The processing device 401, the ROM 402, and the RAM 403 are connected to each other by a bus 404. An input/output (I/O) interface 405 is also connected to bus 404.
In general, the following devices may be connected to the I/O interface 405: input devices 406 including, for example, a touch screen, touchpad, keyboard, mouse, camera, microphone, accelerometer, gyroscope, etc.; an output device 407 including, for example, a Liquid Crystal Display (LCD), a speaker, a vibrator, and the like; storage 406 including, for example, magnetic tape, hard disk, etc.; and a communication device 409. The communication means 409 may allow the electronic device 400 to communicate with other devices wirelessly or by wire to exchange data. While fig. 4 shows an electronic device 400 having various means, it is to be understood that not all of the illustrated means are required to be implemented or provided. More or fewer devices may be implemented or provided instead.
In particular, according to embodiments of the present disclosure, the processes described above with reference to flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a non-transitory computer readable medium, the computer program comprising program code for performing the method shown in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network via communications device 409, or from storage 406, or from ROM 402. The above-described functions defined in the methods of the embodiments of the present disclosure are performed when the computer program is executed by the processing device 401.
It should be noted that the computer readable medium described in the present disclosure may be a computer readable signal medium or a computer readable storage medium, or any combination of the two. The computer readable storage medium can be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples of the computer-readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the context of this disclosure, a computer-readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In the present disclosure, however, the computer-readable signal medium may include a data signal propagated in baseband or as part of a carrier wave, with the computer-readable program code embodied therein. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: electrical wires, fiber optic cables, RF (radio frequency), and the like, or any suitable combination of the foregoing.
In some implementations, the clients, servers may communicate using any currently known or future developed network protocol, such as HTTP (HyperText Transfer Protocol ), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), the internet (e.g., the internet), and peer-to-peer networks (e.g., ad hoc peer-to-peer networks), as well as any currently known or future developed networks.
The computer readable medium may be contained in the electronic device; or may exist alone without being incorporated into the electronic device.
The computer readable medium carries one or more programs which, when executed by the electronic device, cause the electronic device to: acquiring a test browser set matched with a target page to be tested and a smoking test item set; starting at least one target test browser in the test browser set, and executing the operation of loading the target page in the target test browser; and carrying out smoking test on the target page in the at least one target test browser by adopting each smoking test item included in the smoking test item set.
Computer program code for carrying out operations of the present disclosure may be written in one or more programming languages, including, but not limited to, an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
The flowcharts and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units involved in the embodiments of the present disclosure may be implemented by means of software, or may be implemented by means of hardware. The name of the unit is not limited to the unit itself in some cases, for example, the compatibility test module may also be described as "a module for performing compatibility test on the target page according to the loading condition of the target test browser on the target page".
The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: a Field Programmable Gate Array (FPGA), an Application Specific Integrated Circuit (ASIC), an Application Specific Standard Product (ASSP), a system on a chip (SOC), a Complex Programmable Logic Device (CPLD), and the like.
In the context of this disclosure, a machine-readable medium may be a tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. The machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
According to one or more embodiments of the present disclosure, there is provided a page test method [ example 1 ], including:
acquiring a test browser set matched with a target page to be tested and a smoking test item set;
starting at least one target test browser in the test browser set, and executing the operation of loading the target page in the target test browser;
and carrying out smoking test on the target page in the at least one target test browser by adopting each smoking test item included in the smoking test item set.
According to one or more embodiments of the present disclosure, there is provided a method of example 1 [ example 2 ], further comprising:
the set of smoking test items comprises: compatibility testing, resource request testing, console information testing and diversity testing;
and carrying out smoking test on the target page in the at least one target test browser by adopting each smoking test item included in the smoking test item set, wherein the method comprises the following steps:
according to the loading condition of the target test browser on the target page, carrying out compatibility test on the target page;
monitoring resource request information matched with the target page through an external request interface of the test browser;
acquiring control desk information of a set type matched with the target page from a front-end control desk matched with the test browser;
and intercepting the display information of the target page in the test browser, storing the display information into a version comparison library, and carrying out differential comparison with the display information stored in the page in the version comparison library.
According to one or more embodiments of the present disclosure, there is provided a method of example 1 [ example 3 ], further comprising:
the page test operation is triggered by timing, tracking the Git branches, or manually.
According to one or more embodiments of the present disclosure, there is provided a method of example 1 [ example 4 ], further comprising:
the test browser set comprises a headless browser.
According to one or more embodiments of the present disclosure, there is provided a method of example 1 [ example 5 ], further comprising:
and generating a visual test result and providing the visual test result to a developer matched with the page.
According to one or more embodiments of the present disclosure, there is provided a method of example 1 [ example 6 ], further comprising:
and if the loopholes of the preset type are detected, sending an alarm prompt to a developer matched with the page.
According to one or more embodiments of the present disclosure, there is provided the method of example 6 [ example 7 ], further comprising:
if the loopholes of the preset types are detected, an alarm mode matched with the loopholes is obtained, and an alarm prompt is sent to a developer matched with the page through the alarm mode.
According to one or more embodiments of the present disclosure, there is provided a page testing apparatus [ example 8 ], including:
the test set acquisition module is used for acquiring a test browser set matched with a target page to be tested and a smoking test item set;
the target page loading module is used for starting at least one target test browser in the test browser set and executing the operation of loading the target page in the target test browser;
and the smoking test execution module is used for carrying out smoking test on the target page in the at least one target test browser by adopting each smoking test item included in the smoking test item set.
According to one or more embodiments of the present disclosure, there is provided an electronic device [ example 9 ] comprising a memory, a processing means and a computer program stored on the memory and executable on the processing means, characterized in that the processing means implements the page testing method according to any one of examples 1-7 when executing the program.
According to one or more embodiments of the present disclosure, there is provided a storage medium containing computer-executable instructions, which when executed by a computer processor, are for performing the page test method as described in any one of examples 1-7.
The foregoing description is only of the preferred embodiments of the present disclosure and description of the principles of the technology being employed. It will be appreciated by persons skilled in the art that the scope of the disclosure referred to in this disclosure is not limited to the specific combinations of features described above, but also covers other embodiments which may be formed by any combination of features described above or equivalents thereof without departing from the spirit of the disclosure. Such as those described above, are mutually substituted with the technical features having similar functions disclosed in the present disclosure (but not limited thereto).
Moreover, although operations are depicted in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order. In certain circumstances, multitasking and parallel processing may be advantageous. Likewise, while several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the present disclosure. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in multiple embodiments separately or in any suitable subcombination.
Although the subject matter has been described in language specific to structural features and/or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are example forms of implementing the claims.

Claims (9)

1. A method for testing a page, comprising:
acquiring a test browser set matched with a target page to be tested and a smoking test item set;
starting at least one target test browser in the test browser set, and executing the operation of loading the target page in the target test browser;
carrying out smoking test on the target page in the at least one target test browser by adopting each smoking test item included in the smoking test item set;
the set of smoking test items comprises: compatibility testing, resource request testing, console information testing and diversity testing;
and carrying out smoking test on the target page in the at least one target test browser by adopting each smoking test item included in the smoking test item set, wherein the method comprises the following steps:
according to the loading condition of the target test browser on the target page, carrying out compatibility test on the target page;
monitoring resource request information matched with the target page through an external request interface of the test browser;
the monitoring of the resource request information matched with the target page comprises the following steps: monitoring the display condition of each resource in the target page and monitoring the non-self resource information in the target page;
acquiring control desk information of a set type matched with the target page from a front-end control desk matched with the test browser;
intercepting the display information of the target page in the test browser, storing the display information into a version comparison library, and carrying out differential comparison with the display information stored in the page in the version comparison library;
the version comparison library stores historical display information of the target page in a previous page test;
the differential comparison comprises:
the current display information intercepted by the target page in the test browser is subjected to difference comparison with the historical display information opened by using the same test browser;
or, performing differential comparison on the current display information intercepted after the target page is opened through different test browsers;
or comparing the current display information intercepted by the target page in the test browser with the historical display information opened by using different test browsers in a different mode.
2. The method of claim 1, wherein prior to launching at least one target test browser in the set of test browsers and performing the operation of loading the target page in the target test browser, comprising:
the page test operation is triggered by timing, tracking the Git branches, or manually.
3. The method of claim 1, wherein the test browser collection comprises a headless browser.
4. The method of claim 1, wherein after taking a smoking test of the target page in the at least one target test browser using each smoking test item included in the set of smoking test items, comprising:
and generating a visual test result and providing the visual test result to a developer matched with the page.
5. The method of claim 1, wherein after taking a smoking test of the target page in the at least one target test browser using each smoking test item included in the set of smoking test items, comprising:
and if the loopholes of the preset type are detected, sending an alarm prompt to a developer matched with the page.
6. The method of claim 5, wherein the sending an alert prompt to a developer matching the page if a preset type of vulnerability is detected comprises:
if the loopholes of the preset types are detected, an alarm mode matched with the loopholes is obtained, and an alarm prompt is sent to a developer matched with the page through the alarm mode.
7. A page testing apparatus, comprising:
the test set acquisition module is used for acquiring a test browser set matched with a target page to be tested and a smoking test item set;
the set of smoking test items comprises: compatibility testing, resource request testing, console information testing and diversity testing;
the target page loading module is used for starting at least one target test browser in the test browser set and executing the operation of loading the target page in the target test browser;
the smoking test execution module is used for carrying out smoking test on the target page in the at least one target test browser by adopting each smoking test item included in the smoking test item set;
the smoking test execution module specifically comprises:
the compatibility testing unit is used for carrying out compatibility testing on the target page according to the loading condition of the target test browser on the target page;
the resource request testing unit is used for monitoring resource request information matched with the target page through an external request interface of the testing browser;
the monitoring of the resource request information matched with the target page comprises the following steps: monitoring the display condition of each resource in the target page and monitoring the non-self resource information in the target page;
the control console information testing unit is used for acquiring control console information of a set type matched with the target page from a front-end control console matched with the test browser;
the difference testing unit is used for intercepting the display information of the target page in the test browser, storing the display information into a version comparison library and carrying out difference comparison with the display information stored in the page in the version comparison library;
the version comparison library stores historical display information of the target page in a previous page test;
the differential comparison comprises:
the current display information intercepted by the target page in the test browser is subjected to difference comparison with the historical display information opened by using the same test browser;
or, performing differential comparison on the current display information intercepted after the target page is opened through different test browsers;
or comparing the current display information intercepted by the target page in the test browser with the historical display information opened by using different test browsers in a different mode.
8. An electronic device comprising a memory, processing means and a computer program stored on the memory and executable on the processing means, characterized in that the processing means implement the page test method according to any of claims 1-6 when executing the program.
9. A storage medium containing computer executable instructions which, when executed by a computer processor, are for performing the page testing method of any of claims 1-6.
CN201910628860.2A 2019-07-12 2019-07-12 Page testing method and device, electronic equipment and storage medium Active CN110362488B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910628860.2A CN110362488B (en) 2019-07-12 2019-07-12 Page testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910628860.2A CN110362488B (en) 2019-07-12 2019-07-12 Page testing method and device, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN110362488A CN110362488A (en) 2019-10-22
CN110362488B true CN110362488B (en) 2023-08-08

Family

ID=68219138

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910628860.2A Active CN110362488B (en) 2019-07-12 2019-07-12 Page testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN110362488B (en)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114090139A (en) * 2020-07-29 2022-02-25 北京字节跳动网络技术有限公司 Page processing method and device, electronic equipment and computer readable storage medium
CN112100051B (en) * 2020-07-30 2024-03-08 江苏清微智能科技有限公司 Automatic smoking testing system and testing method thereof
CN112286822A (en) * 2020-11-06 2021-01-29 国家电网有限公司 Web automatic test system, test method and test device based on selenium framework
CN112486826B (en) * 2020-11-30 2023-08-01 北京字跳网络技术有限公司 Test method, test device, electronic equipment and computer readable medium
CN113821387B (en) * 2021-08-06 2023-07-18 苏州浪潮智能科技有限公司 KVM function keep-alive test method, device, equipment and medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136094A (en) * 2011-11-25 2013-06-05 阿里巴巴集团控股有限公司 Page testing method and device
CN103927253A (en) * 2013-01-11 2014-07-16 阿里巴巴集团控股有限公司 Multiple browser compatibility testing method and system
CN104102578A (en) * 2014-06-27 2014-10-15 百度在线网络技术(北京)有限公司 Test method and system and operation terminal
CN106326091A (en) * 2015-06-24 2017-01-11 深圳市腾讯计算机系统有限公司 Browser webpage compatibility detection method and system
CN109656643A (en) * 2017-10-10 2019-04-19 武汉斗鱼网络科技有限公司 More browser compatibility test methods, storage medium, electronic equipment and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7231606B2 (en) * 2000-10-31 2007-06-12 Software Research, Inc. Method and system for testing websites
US8996988B2 (en) * 2009-10-19 2015-03-31 Browsera, LLC Automated application compatibility testing

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103136094A (en) * 2011-11-25 2013-06-05 阿里巴巴集团控股有限公司 Page testing method and device
CN103927253A (en) * 2013-01-11 2014-07-16 阿里巴巴集团控股有限公司 Multiple browser compatibility testing method and system
CN104102578A (en) * 2014-06-27 2014-10-15 百度在线网络技术(北京)有限公司 Test method and system and operation terminal
CN106326091A (en) * 2015-06-24 2017-01-11 深圳市腾讯计算机系统有限公司 Browser webpage compatibility detection method and system
CN109656643A (en) * 2017-10-10 2019-04-19 武汉斗鱼网络科技有限公司 More browser compatibility test methods, storage medium, electronic equipment and system

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
Web应用界面跨浏览器兼容性的自动检测方法;王欢欢等;《计算机科学》;20151115;全文 *

Also Published As

Publication number Publication date
CN110362488A (en) 2019-10-22

Similar Documents

Publication Publication Date Title
CN110362488B (en) Page testing method and device, electronic equipment and storage medium
CN110135168B (en) Application program detection method, device and system, terminal equipment and storage medium
CN110046310B (en) Method and device for analyzing jump link in page
US11301313B2 (en) Collaborative application testing
US9747449B2 (en) Method and device for preventing application in an operating system from being uninstalled
US9767003B2 (en) Conditional component breakpoint setting system and method
CN109873735B (en) Performance test method and device for H5 page and computer equipment
CN110781432A (en) Page jump method and device, electronic equipment and computer readable storage medium
CN113806212A (en) Application program exception positioning method and device and electronic equipment
CN111694757B (en) Application program testing method and device, electronic equipment and computer readable storage medium
CN110059064B (en) Log file processing method and device and computer readable storage medium
CN111783010B (en) Webpage blank page monitoring method, device, terminal and storage medium
CN110348226B (en) Engineering file scanning method and device, electronic equipment and storage medium
CN111382058B (en) Service testing method and device, server and storage medium
CN115576805A (en) Log display method and device, readable medium and electronic equipment
CN111258797B (en) Memory leak detection method, device, medium and electronic equipment
CN114153462A (en) Client source code processing method and device, storage medium and electronic equipment
CN111381813B (en) Front-end page debugging method and device, computer equipment and storage medium
CN106775639B (en) Information processing method, information processing apparatus, and computer device
CN110633566A (en) Intrusion detection method, device, terminal equipment and medium
CN111782410B (en) Lock jam monitoring method and device, electronic equipment and computer readable medium
CN111371745B (en) Method and apparatus for determining SSRF vulnerability
CN112486826B (en) Test method, test device, electronic equipment and computer readable medium
CN117493149A (en) Code security detection method, device, apparatus, storage medium, and program
CN112559328A (en) Method, device, equipment and medium for judging instruction simulation engine

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
GR01 Patent grant
GR01 Patent grant