CN109947637B - Automatic testing method, device, equipment and medium for webpage compatibility - Google Patents

Automatic testing method, device, equipment and medium for webpage compatibility Download PDF

Info

Publication number
CN109947637B
CN109947637B CN201711395005.9A CN201711395005A CN109947637B CN 109947637 B CN109947637 B CN 109947637B CN 201711395005 A CN201711395005 A CN 201711395005A CN 109947637 B CN109947637 B CN 109947637B
Authority
CN
China
Prior art keywords
test
module
webpage
compatibility
web 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
CN201711395005.9A
Other languages
Chinese (zh)
Other versions
CN109947637A (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.)
China Mobile Communications Group Co Ltd
China Mobile Group Chongqing Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Group Chongqing 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 China Mobile Communications Group Co Ltd, China Mobile Group Chongqing Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN201711395005.9A priority Critical patent/CN109947637B/en
Publication of CN109947637A publication Critical patent/CN109947637A/en
Application granted granted Critical
Publication of CN109947637B publication Critical patent/CN109947637B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention relates to a method, a device, equipment and a medium for automatically testing webpage compatibility. The automatic test of the webpage compatibility comprises the following steps: configuring test configuration information for testing webpage compatibility; a web page disassembling step of disassembling web page elements and web page module levels of a web page to be tested based on the test configuration information to form a plurality of test units; a rendering step, namely rendering each test unit based on a browser set by the test configuration information, and saving a rendering result screenshot; a compatibility judging step of automatically judging the compatibility of the test unit based on the plurality of screenshots and generating an error record aiming at the incompatible test unit; and an error positioning step of acquiring the codes of the test units judged to be incompatible based on the error records and outputting a test result report containing the test result and the error codes to a user.

Description

Automatic testing method, device, equipment and medium for webpage compatibility
Technical Field
The invention relates to the technical field of automated testing of front-end development of software application systems, in particular to a method, a device, equipment and a medium for automatically testing webpage compatibility
Background
The current application system is based on a B/S (browser/server) architecture. A user browses the information of the server through the browser, the browser downloads information such as html (Hypertext Markup Language), scripts, flash (animation) and pictures from the server, and codes on the server are analyzed and rendered on the user browser according to certain standards so as to assemble an interface which can be browsed by the user.
There are many choices for the type of browser installed in the user's operating system, and the user can choose to install the browser product and version at his or her discretion. At present, the main browser kernels are mainly 4 types, mainly: the Trident kernel represents the product Internet Explorer, also called IE kernel, and is a typesetting engine developed by Microsoft (also called MSHTML); the Gecko kernel represents that the work Mozilla FirefoxGecko is a set of webpage typesetting engines written in C + + and provided with open source codes; the WebKit kernel represents that Safari and Chromewebkit are open source projects, and the WebKit kernel is characterized in that a source code structure is clear, the rendering speed is extremely high, and the defects that compatibility of webpage codes is not high, so that some webpages which are not written in a standard mode cannot be displayed normally; the Presto kernel represents the work Opera Presto, a browser typesetting engine developed by Opera Software for use by Opera 7.0 and above, which replaces the Elektra typesetting engine used by the old versions Opera 4 to 6, including adding dynamic functions, such as web pages or parts thereof that can be re-typeset with events in DOM (Document Object Model) and Script syntax.
Not only do there exist multiple browsers, but even the same product will have multiple versions, which are very different. For example, currently, the most users use the IE browser, the active version has 6 versions from IE6 to IE11, and particularly after the IE8 version, the rendering program of the browser is significantly changed, so that the W3C standard is supported, while the versions below IE8 do not support the W3C standard. Therefore, an application system may not be completely displayed, unreasonably arranged and available in function on different browser products or different versions of products.
In summary, to solve the compatibility problem of the web browser and ensure that the user can normally use the application service in various browsers and versions, except for the familiarity of the developer with rendering of each browser, the web page needs to be comprehensively tested in various browsers and versions, which is undoubtedly a very complex and time-consuming task.
Disclosure of Invention
The embodiment of the invention provides a method, a device, equipment and a medium for automatically testing webpage compatibility. The automatic testing method can be used for efficiently and high-quality automatic testing of webpage compatibility, and the testing efficiency is improved.
In a first aspect, an embodiment of the present invention provides an automated testing method for webpage compatibility, where the method includes: configuring test configuration information for testing the compatibility of the webpage; a web page disassembling step of disassembling web page elements and web page module levels of a web page to be tested based on the test configuration information to form a plurality of test units; a rendering step, namely rendering each test unit based on a browser set by the test configuration information, and saving a rendering result screenshot; a compatibility judging step of automatically judging the compatibility of the test unit based on the plurality of screenshots and generating an error record aiming at the incompatible test unit; and an error positioning step of acquiring the codes of the test units judged to be incompatible based on the error records and outputting a test result report containing the test result and the error codes to a user.
In a second aspect, an embodiment of the present invention provides an automatic testing apparatus for web page compatibility, where the apparatus includes: the configuration module is used for configuring test configuration information for testing the compatibility of the webpage; the webpage disassembling module is used for disassembling webpage elements of the webpage to be tested and the webpage module hierarchy based on the test configuration information to form a plurality of test units; the rendering module is used for rendering each test unit based on the browser set by the test configuration information and saving a rendering result screenshot; the compatibility judging module is used for automatically judging the compatibility of the test unit based on the screenshots and generating an error record aiming at the incompatible test unit; and the error positioning module is used for acquiring codes of the test units which are judged to be incompatible based on the error records and outputting a test result report containing the test results and the error codes to a user.
The embodiment of the invention provides automatic test equipment for webpage compatibility, which comprises: at least one processor, at least one memory, and computer program instructions stored in the memory, which when executed by the processor, implement the method of the first aspect of the embodiments described above.
In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium, on which computer program instructions are stored, which, when executed by a processor, implement the method of the first aspect in the foregoing embodiments.
The method, the device, the equipment and the medium for automatically testing the webpage compatibility improve the efficiency of testing and correcting the webpage compatibility.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required to be used in the embodiments of the present invention will be briefly described below, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart illustrating a method for automated testing of web page compatibility according to an embodiment of the present invention;
FIG. 2 is a block diagram of an automated testing device for web page compatibility according to an embodiment of the present invention;
fig. 3 is a workflow diagram showing an example of the automatic testing apparatus for web page compatibility according to the embodiment of the present invention;
fig. 4 is a schematic diagram illustrating a hardware structure of the web page compatibility automation test device according to the embodiment of the present invention.
Detailed Description
Features and exemplary embodiments of various aspects of the present invention will be described in detail below, and in order to make objects, technical solutions and advantages of the present invention more apparent, the present invention will be further described in detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not to be construed as limiting the invention. It will be apparent to one skilled in the art that the present invention may be practiced without some of these specific details. The following description of the embodiments is merely intended to provide a better understanding of the present invention by illustrating examples of the present invention.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising 8230; \8230;" 8230; "does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
The inventor of the present invention finds that, in the webpage compatibility test, because the compatibility of the webpage is relatively complex, the reasons for the compatibility problem generally include the following points: the design language interpretation of each browser to the webpage is inconsistent, so that the displayed display interfaces are inconsistent; the difference between the browsers is not considered by developers, and possibly, due to insufficient experience of the developers, the developers do not perform differential processing aiming at the special attribute of each browser; the page syntax has errors. Some browsers have good tolerance and can ignore the errors, while some browsers have poor tolerance and cannot better handle the errors to cause application exception.
At present, two main testing methods for performing compatibility testing are available.
One way of testing is manual testing. For some small and medium-sized application systems, a manual testing method is mainly adopted. And manually opening the same webpage in multiple browsers at the same time, and observing differences of the display of the compared pages, such as whether the layout is disordered or not, whether the code has errors or not, and the like. The other test mode is an image comparison technology, wherein the same webpage is opened on a plurality of browsers, the whole webpage is subjected to screenshot, then the difference of each image is compared through the image comparison technology, so that the probability of the difference of the images is roughly calculated, and then a compatibility result is obtained.
However, the inventors of the present invention have also found that: when a manual testing mode is adopted, the testing web pages are opened one by one on the browser to be tested, and the compatibility conditions of the web pages are compared manually, so that the workload is large and the efficiency is low. Meanwhile, if the problem of incompatibility occurs, the module and the level of the specific compatibility problem cannot be judged, and only developers can check and modify the modules one by one, so that the modification efficiency is low. When the test mode of the image comparison technology is adopted, only the whole webpage can be intercepted, and the intercepted graph of the whole webpage is compared with the reference image. The general webpage has multiple elements, modules and layers, the graph of the whole webpage is compared, the accuracy rate is low, false alarm is easy to occur, and when compatibility has problems, which specific module has problems cannot be known, and the problem cannot be located.
The invention provides a method and a device for automatically testing webpage compatibility, aiming at solving the problems and making up the defects, the device is used as independent software or a module to independently operate, only a webpage address to be tested needs to be input, and all elements, all built-in rows, div (division) and combined div in the webpage and the whole of the webpage can be tested, and meanwhile, the specific position with compatibility problems is positioned, so that the efficiency and the accuracy of testing and problem positioning can be greatly improved.
The following describes the method for automatically testing web page compatibility according to the embodiment of the present invention in detail with reference to fig. 1. Fig. 1 shows a flowchart of an automated testing method for web page compatibility according to an embodiment of the present invention. The automatic testing method for webpage compatibility comprises a configuration step S1, a webpage disassembling step S2, a rendering step S3, a compatibility judging step S4 and an error positioning step S5. And when receiving a web site of the webpage to be tested from the outside, starting to execute all the steps of the automatic testing method for the compatibility of the webpage. The respective steps will be described in detail below.
Step S1, configuring step, configuring test configuration information for testing webpage compatibility.
The test configuration information may also indicate which browsers, and which versions, compatibility tests need to be performed on.
In addition, the test configuration information may also indicate a benchmark browser and version to use for benchmark comparison at the time of subsequent testing.
In addition, the test configuration information may also indicate configurations of whether web page elements are compared, such as whether to test pictures in a web page, whether to test font sizes, whether to test font types, whether to test background colors, and the like, and different configurations have different test efficiencies. Here, the web page element refers to a basic element constituting the content of the web page, such as a text, a picture, a table, a flash, a button, and the like.
The test configuration information may also indicate a fault tolerance threshold of the compatibility test, such as how much the webpage module or level displacement exceeds, at which error level the element is in, and the like, so that the webpage compatibility can be accepted within a certain error range when the webpage compatibility test is performed.
Here, the web page module and hierarchy are, for example, div (block level element), span (inline element), body (content element), and the module or hierarchy may be understood as a container for placing a web page element in the container and controlling the layout, display effect, and the like of the container element. Such as container text centered display, picture size, etc. Modules or hierarchies can be embedded and combined, for example, modules or hierarchies can be embedded in modules, and a module can also be combined by a plurality of modules or hierarchies.
Step S2: and a web page disassembling step of disassembling web page elements and web page module levels of the web page to be tested based on the test configuration information to form a plurality of test units.
Firstly, the test configuration information set in step S1 is obtained, the test configuration information indicates which parts are subjected to the compatibility test, and the parts that need to be subjected to the compatibility test are disassembled to form each test unit.
The webpage disassembling step comprises an element disassembling step and a webpage module level disassembling step.
And in the element disassembling step, according to the test content indicated by the test configuration information, disassembling the webpage elements needing to be tested into independent elements. Each element constitutes a test unit.
In addition, the webpage module and the hierarchy are disassembled in the webpage module hierarchy disassembling step.
Optionally, when an embedded mode is adopted in the web page module hierarchy, recursive disassembling is performed in the web page disassembling step, where the recursive disassembling mode is: and disassembling the innermost module to form a test unit, and expanding the superposed modules layer by layer outwards, wherein each time of superposition forms a test unit. For example, a module or hierarchy is embedded in one module or hierarchy, denoted in sequence from the upper (outer module) to the lower (inner module) as: the test units formed after disassembly and superposition are 1 layer, 1+2 layer, and 1+2+3 layer respectively.
In addition, optionally, when the web page module adopts a combination mode, parallel parsing is performed in the web page parsing step, where the parallel parsing is: and respectively disassembling the combined modules into independent test units, and externally expanding the combined modules layer by layer to superpose the modules, wherein each time of superposition forms one test unit. For example, two parallel modules (1 layer and 1 layer) are combined under one module (2 layers) and are 2 layers, 1 layer and 1 layer, and the test units formed after disassembly and superposition are 1 layer, 1 layer and 1+2 layers.
In addition, optionally, a page description language of an original webpage is added to the test unit disassembled to form a fully functional sub-web for testing. For example, for the disassembled test units, web page description languages such as css (Cascading Style Sheets) and javascript (an transliterated script language) of the original web page are added to form an independent subnet page with complete functions, that is, a complete test unit.
And step S3: and a rendering step, namely rendering each test unit based on the browser set by the test configuration information, and saving a rendering result screenshot.
When performing web page testing, testing needs to be performed in multiple browsers. And according to the test configuration information, determining the browser, the version and the like to be tested, and rendering the test unit in the plurality of browsers specified by the test configuration information. And rendering each test unit in the required test browser of each configuration, and screenshot and storing a rendering result.
In addition, the test configuration information indicates a reference browser and version based on which rendering is performed as a reference for comparison.
And step S4: and a compatibility judging step of automatically judging the compatibility of the test unit based on the plurality of screenshots and generating an error record aiming at the incompatible test unit.
In the compatibility determination step, the compatibility may be determined by comparing the screenshots of the same test unit generated in each browser with the screenshots generated in the reference browser using a graph comparison method.
Optionally, the compatibility judging step includes a graph displacement comparing step and an element comparing step.
In the step of comparing the displacement of the graph, comparing the screenshot of the test unit formed by the webpage module or the hierarchy with the screenshot generated in the reference browser, and judging whether the relative displacement of the image in the screenshot is wrong or not based on the comparison result and the displacement error allowable threshold value indicated by the test configuration information. Here, the reference browser is specified in advance by testing the configuration information. For example, indicating module displacement in the test configuration information is allowed to be within 10px pixels, in which case the error list in the test report is not included for minor deviations. When the module displacement is greater than 10px pixels, an error record is formed.
Through the displacement graph comparison step, whether the layout of the module or the hierarchy is abnormal or misplaced can be judged. Since the displacement error allowance threshold value of the compatibility test is indicated in the test configuration information, if it is determined to be an error, the test result is recorded in the error record.
In the element comparison step, the screenshot of the test unit formed by the webpage element is compared with the screenshot generated in the reference-based browser, and whether the webpage element is normally displayed is judged based on the comparison result and the displacement error allowance threshold value indicated by the test configuration information.
In the element comparison step, the rendering result of each test unit is compared with the image generated by the reference browser based on the test content in the test configuration information, for example, the size, the text content, the background color, the picture content, and the like of each element are compared, so as to determine whether the elements are normally displayed.
Step S5: and an error positioning step of acquiring codes of the test units judged to be incompatible based on the error records and outputting a test result report containing the test results and the error codes to a user.
In the error locating step, the original code forming the test unit is found and marked according to the error record of the test. And finally, forming a test result report according to the test result and the identified error code, and providing the test result report for the user.
According to the automatic testing method for the webpage compatibility, the webpage compatibility is tested automatically, and the testing efficiency is improved. In addition, comprehensive testing can be performed according to multiple dimensions such as elements, modules, layers, integrity and the like. For compatibility problems, the element, the module or the hierarchy can be accurately positioned for a developer to modify and analyze, and the correction efficiency is improved.
Fig. 2 is a block diagram illustrating an automated testing apparatus for web page compatibility according to an embodiment of the present invention, which executes the automated testing method for web page compatibility. Fig. 3 is a workflow diagram illustrating an example of the automatic testing apparatus for web page compatibility according to the embodiment of the present invention. This is explained in detail below with reference to fig. 2 and 3.
The web page compatibility automatic testing device 1 comprises a configuration module 10, a web page disassembling module 11, a rendering module 12, a compatibility judging module 13 and an error positioning module 14.
First, a web address to be automatically tested is input to the web compatibility automatic test apparatus 1. The configuration module 10 configures test configuration information for testing compatibility of web pages, which is described in the foregoing description of the automated testing method for web page compatibility and will not be described herein again.
The web page disassembling module 11 reads the test configuration information from the configuration module 10, and disassembles the web page elements and the web page module hierarchy of the web page to be tested based on the test configuration information to form a plurality of test units. The test configuration information indicates which parts are subjected to compatibility test, and the parts which need to be subjected to the compatibility test are disassembled to form each test unit.
The web page disassembling module 11 includes an element disassembling module and a web page module level disassembling module, and submits each disassembled test unit to the rendering module.
And the element disassembling module disassembles the webpage elements to be tested according to the test content indicated by the test configuration information and disassembles the webpage elements into independent elements. Each element constitutes a test unit.
In addition, the webpage module level disassembling module disassembles the module and the level of the webpage.
Optionally, when the web page module hierarchy adopts an embedded manner, performing recursive disassembling in a web page module hierarchy disassembling module of the web page disassembling module, where the recursive disassembling manner is: and disassembling the innermost module to form a test unit, and expanding the superposed modules layer by layer outwards, wherein each time of superposition forms a test unit. For example, a module or hierarchy embeds modules or hierarchies, denoted sequentially from the upper layer (outer module) to the lower layer (inner module): 3 layers, 2 layers and 1 layer, the test units formed after disassembly and superposition are 1 layer, 1+2 layer and 1+2+3 layer respectively.
In addition, optionally, when the web page module adopts a combination mode, parallel parsing is performed in a web page module level parsing module of the web page parsing module, where the parallel parsing is: and respectively disassembling the combined modules into independent test units, and externally expanding the combined modules layer by layer to superpose the modules, wherein each time of superposition forms one test unit. For example, two parallel modules (1 layer and 1 layer) are combined under one module (2 layers) and are 2 layers, 1 layer and 1 layer, and the test units formed after disassembly and superposition are 1 layer, 1 layer and 1+2 layers.
In addition, optionally, the web page disassembling module adds a page description language of the original web page to the disassembled test unit to form a functionally complete sub-web page for testing. For example, for the disassembled test units, web page description languages such as css (Cascading Style Sheets) and javascript (an transliterated script language) of the original web page are added to form an independent subnet page with complete functions, that is, a complete test unit.
The rendering module 12 renders each test unit based on the browser set by the test configuration information, and saves a rendering result screenshot.
When performing web page testing, testing needs to be performed in multiple browsers. The web page compatible automatic test apparatus 1 is equipped with a plurality of browsers, and the rendering module 12 acquires test configuration information from the configuration module 10, specifies a browser to be tested, a version, and the like, and renders a test unit in the plurality of browsers specified by the test configuration information. And rendering each test unit in the required test browser of each configuration, and screenshot and storing a rendering result.
In addition, the test configuration information indicates a reference browser and version based on which rendering is performed as a reference for later comparison.
The compatibility judging module 13 automatically judges the compatibility of each test unit based on the plurality of screenshots, and generates an error record for the incompatible test units.
The compatibility determination module may compare the screenshots of the same test unit generated in each browser with the screenshots generated in the reference browser by using a graph comparison method to determine compatibility.
Optionally, the compatibility determining module includes a graph displacement comparing module and an element comparing module.
In the graph displacement comparison module, comparing the screenshot of the test unit formed by the webpage module hierarchy with the screenshot generated in the reference browser, and judging whether the relative displacement of the image in the screenshot is wrong or not based on the comparison result and the displacement error allowable threshold value indicated by the test configuration information. Here, the reference browser is previously designated by the test configuration information. The pattern displacement comparison module reads the test configuration information from the configuration module 10. For example, indicating module displacement in test configuration information is allowed to be within 10px of pixels, in which case the error list of the test report is not included for minor deviations. When the module displacement is greater than 10px pixels, an error code for error logging and localization is formed and output to the error localization module 16.
Through the displacement graph comparison module, whether the layout of the module or the hierarchy is abnormal or misplaced can be judged. Since the displacement error allowable threshold value of the compatibility test is indicated in the test configuration information, if it is determined that the test result is an error, the test result is recorded in an error record and sent to the error locating module 14.
In the element comparison module, comparing a screenshot of a test unit formed by the webpage element with a screenshot generated in a reference-based browser, and judging whether the webpage element is normally displayed or not based on a comparison result and a displacement error allowance threshold value indicated by the test configuration information.
The element comparison module reads the element comparison configuration information in the test configuration information from the configuration module 10, compares the rendering result of each test unit with the image generated by the reference browser based on the test content in the test configuration information, for example, compares the size, text content, background color, picture content, and the like of each element, thereby determining whether the element is normally displayed.
And judging whether the webpage element is normally displayed or not based on the comparison result and the element error allowance threshold value indicated by the test configuration information. If it is determined that the display is not normally displayed, the error is recorded in the error log and sent to the error locating module 14.
The error locating module 14 obtains the codes of the test units judged to be incompatible based on the error records, and outputs a test result report containing the test results and the error codes to the user.
In the error location module, the original code forming the test unit is found and marked according to the error record of the test. And finally, forming a test report according to the test result and the identified error code, and providing the test report to a user.
According to the automatic testing device for the webpage compatibility, provided by the embodiment of the invention, the webpage compatibility is fully automatically tested, and the testing efficiency is improved. In addition, comprehensive testing can be performed according to multiple dimensions such as elements, modules, layers, integrity and the like. For compatibility problems, the element, the module or the hierarchy can be accurately positioned for a developer to modify and analyze, and the correction efficiency is improved.
In addition, the web page compatibility automation test method described in the embodiment of the present invention with reference to fig. 1 may be implemented by web page compatibility automation test equipment. Fig. 4 is a schematic diagram illustrating a hardware structure of the web page compatibility automation test equipment according to the embodiment of the present invention.
The web page compatibility automation test equipment may include a processor 401 and a memory 402 storing computer program instructions.
Specifically, the processor 401 may include a Central Processing Unit (CPU), or an Application Specific Integrated Circuit (ASIC), or may be configured as one or more Integrated circuits implementing embodiments of the present invention.
Memory 402 may include mass storage for data or instructions. By way of example, and not limitation, memory 402 may include a Hard Disk Drive (HDD), floppy Disk Drive, flash memory, optical Disk, magneto-optical Disk, tape, or Universal Serial Bus (USB) Drive or a combination of two or more of these. Memory 402 may include removable or non-removable (or fixed) media, where appropriate. The memory 402 may be internal or external to the data processing apparatus, where appropriate. In a particular embodiment, the memory 402 is a non-volatile solid-state memory. In certain embodiments, memory 402 comprises Read Only Memory (ROM). Where appropriate, the ROM may be mask-programmed ROM, programmable ROM (PROM), erasable PROM (EPROM), electrically Erasable PROM (EEPROM), electrically rewritable ROM (EAROM), or flash memory, or a combination of two or more of these.
The processor 401 reads and executes the computer program instructions stored in the memory 402 to implement any one of the web page compatibility automation test methods in the above embodiments.
In one example, the web page compatibility automation test equipment may also include a communication interface 403 and a bus 410. As shown in fig. 4, the processor 401, the memory 402, and the communication interface 403 are connected via a bus 410 to complete communication therebetween.
The communication interface 403 is mainly used for implementing communication between modules, apparatuses, units and/or devices in the embodiments of the present invention.
The bus 410 includes hardware, software, or both to couple the components of the web page compatible automated test equipment to one another. By way of example, and not limitation, a bus may include an Accelerated Graphics Port (AGP) or other graphics bus, an Enhanced Industrial Standard Architecture (EISA) bus, a Front Side Bus (FSB), a Hyper Transport (HT) interconnect, an Industrial Standard Architecture (ISA) bus, an infiniband interconnect, a Low Pin Count (LPC) bus, a memory bus, a Micro Channel Architecture (MCA) bus, a Peripheral Component Interconnect (PCI) bus, a PCI-Express (PCI-X) bus, a Serial Advanced Technology Attachment (SATA) bus, a video electronics standards association local (VLB) bus, or other suitable bus or a combination of two or more of these. Bus 410 may include one or more buses, where appropriate. Although specific buses have been described and shown in the embodiments of the invention, any suitable buses or interconnects are contemplated by the invention.
In addition, in combination with the automatic testing method for webpage compatibility in the above embodiments, embodiments of the present invention may provide a computer-readable storage medium to implement the method. The computer readable storage medium having stored thereon computer program instructions; the computer program instructions, when executed by a processor, implement any one of the above-described embodiments of the web page compatibility automated testing method.
It is to be understood that the invention is not limited to the specific arrangements and instrumentality described above and shown in the drawings. A detailed description of known methods is omitted herein for the sake of brevity. In the above embodiments, several specific steps are described and shown as examples. However, the method processes of the present invention are not limited to the specific steps described and illustrated, and those skilled in the art can make various changes, modifications and additions or change the order between the steps after comprehending the spirit of the present invention.
The functional blocks shown in the above-described structural block diagrams may be implemented as hardware, software, firmware, or a combination thereof. When implemented in hardware, it may be, for example, an electronic circuit, an Application Specific Integrated Circuit (ASIC), suitable firmware, plug-in, function card, or the like. When implemented in software, the elements of the invention are the programs or code segments used to perform the required tasks. The program or code segments may be stored in a machine-readable medium or transmitted by a data signal carried in a carrier wave over a transmission medium or a communication link. A "machine-readable medium" may include any medium that can store or transfer information. Examples of a machine-readable medium include an electronic circuit, a semiconductor memory device, a ROM, a flash memory, an Erasable ROM (EROM), a floppy disk, a CD-ROM, an optical disk, a hard disk, an optical fiber medium, a Radio Frequency (RF) link, and so forth. The code segments may be downloaded via computer networks such as the internet, intranet, etc.
It should also be noted that the exemplary embodiments mentioned in this patent describe some methods or systems based on a series of steps or devices. However, the present invention is not limited to the order of the above-described steps, that is, the steps may be performed in the order mentioned in the embodiments, may be performed in an order different from the order in the embodiments, or may be performed simultaneously.
As described above, only the specific embodiments of the present invention are provided, and it can be clearly understood by those skilled in the art that, for convenience and brevity of description, 5 specific working processes of the system, the module and the unit described above may refer to corresponding processes in the foregoing method embodiments, and are not described herein again. It should be understood that the scope of the present invention is not limited thereto, and any person skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the present invention, and these modifications or substitutions should be covered within the scope of the present invention.

Claims (10)

1. A method for automatically testing webpage compatibility is characterized by comprising the following steps:
configuring test configuration information for testing webpage compatibility;
a web page disassembling step of disassembling web page elements and web page module levels of a web page to be tested based on the test configuration information to form a plurality of test units;
a rendering step, namely rendering each test unit based on a browser set by the test configuration information, and saving a rendering result screenshot;
a compatibility judging step of automatically judging the compatibility of the test unit based on the plurality of screenshots and generating an error record aiming at the incompatible test unit; and
an error positioning step of acquiring codes of the test units judged to be incompatible based on the error records and outputting a test result report containing a test result and an error code to a user;
the compatibility judging step comprises:
a graphic displacement comparison step of comparing the screenshot of the test unit composed of the web page module hierarchy with the screenshot generated in a reference browser, and judging whether the relative displacement of the image in the screenshot is wrong or not based on the comparison result and a displacement error allowable threshold value indicated by the test configuration information, wherein the reference browser is pre-specified through the test configuration information;
and an element comparison step of comparing the screenshot of the test unit formed by the webpage element with the screenshot generated in the reference browser, and judging whether the webpage element is normally displayed or not based on the comparison result and an element error allowance threshold value indicated by the test configuration information.
2. The method of claim 1, further comprising:
when the webpage module level adopts an embedded mode, recursive disassembly is carried out in the webpage disassembly step, wherein the recursive disassembly is as follows: and disassembling the innermost module to form a test unit, and expanding the superposed modules layer by layer outwards, wherein each time the superposed modules are superposed to form one test unit.
3. The method of claim 1, further comprising:
when the webpage module hierarchy adopts a combination mode, parallel disassembling is carried out in the webpage disassembling step, and the parallel disassembling is as follows: and respectively disassembling the combined modules into independent test units, and externally expanding the combined modules layer by layer to superpose the modules, wherein each time of superposition forms one test unit.
4. The method according to any one of claims 1 to 3,
in the step of disassembling the web page, the disassembled test unit is added with the page description language of the original web page to form a subnet page with complete functions for testing.
5. An automated testing apparatus for web page compatibility, the apparatus comprising:
the configuration module is used for configuring test configuration information for testing the compatibility of the webpage;
the webpage disassembling module is used for disassembling webpage elements of the webpage to be tested and the webpage module level based on the test configuration information to form a plurality of test units;
the rendering module is used for rendering each test unit based on the browser set by the test configuration information and saving a rendering result screenshot;
the compatibility judging module is used for automatically judging the compatibility of the test unit based on the screenshots and generating an error record aiming at the incompatible test unit; and
the error positioning module is used for acquiring codes of the test units judged to be incompatible based on the error records and outputting a test result report containing a test result and an error code to a user;
the compatibility judging module comprises:
a graphic displacement comparison module, which compares the screenshot of the test unit composed of the webpage module hierarchy with the screenshot generated in a reference browser, and judges whether the relative displacement of the image in the screenshot is wrong or not based on the comparison result and a displacement error allowable threshold value indicated by the test configuration information, wherein the reference browser is pre-specified through the test configuration information;
and the element comparison module is used for comparing the screenshot of the test unit formed by the webpage element with the screenshot generated in the reference browser and judging whether the webpage element is normally displayed or not based on the comparison result and an element error allowance threshold value indicated by the test configuration information.
6. The apparatus of claim 5, further comprising:
when the webpage module level adopts an embedded mode, carrying out recursive disassembly in the webpage disassembly module, wherein the recursive disassembly is as follows: and disassembling the innermost module to form a test unit, and expanding the superposed modules layer by layer outwards, wherein each time the superposed modules are superposed to form one test unit.
7. The apparatus of claim 5, further comprising:
when the webpage module hierarchy adopts a combination mode, parallel disassembly is carried out in the webpage disassembly module, wherein the parallel disassembly is as follows: and respectively disassembling the combined modules into independent test units, and externally expanding the combined modules layer by layer to superpose the modules, wherein each time of superposition forms one test unit.
8. The apparatus according to any one of claims 5 to 7,
and the web page disassembling module is used for adding the disassembled test unit with the page description language of the original web page to form a subnet page with complete functions for testing.
9. An automated testing device for web page compatibility, comprising: at least one processor, at least one memory, and computer program instructions stored in the memory that, when executed by the processor, implement the method of any of claims 1-4.
10. A computer-readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1-4.
CN201711395005.9A 2017-12-21 2017-12-21 Automatic testing method, device, equipment and medium for webpage compatibility Active CN109947637B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711395005.9A CN109947637B (en) 2017-12-21 2017-12-21 Automatic testing method, device, equipment and medium for webpage compatibility

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711395005.9A CN109947637B (en) 2017-12-21 2017-12-21 Automatic testing method, device, equipment and medium for webpage compatibility

Publications (2)

Publication Number Publication Date
CN109947637A CN109947637A (en) 2019-06-28
CN109947637B true CN109947637B (en) 2022-10-14

Family

ID=67005963

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711395005.9A Active CN109947637B (en) 2017-12-21 2017-12-21 Automatic testing method, device, equipment and medium for webpage compatibility

Country Status (1)

Country Link
CN (1) CN109947637B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111026638A (en) * 2019-10-29 2020-04-17 贝壳技术有限公司 Webpage automatic testing method and device, electronic equipment and storage medium
CN111737105A (en) * 2020-02-17 2020-10-02 北京京东尚科信息技术有限公司 Display interface compatibility testing method and device, electronic equipment and medium
CN113268407A (en) * 2020-02-17 2021-08-17 北京沃东天骏信息技术有限公司 Page testing method and device, computer storage medium and electronic equipment
CN111431767B (en) * 2020-03-26 2023-03-07 深圳壹账通智能科技有限公司 Multi-browser resource synchronization method and device, computer equipment and storage medium
CN112306793A (en) * 2020-04-07 2021-02-02 北京沃东天骏信息技术有限公司 Method and device for monitoring webpage
CN111666204A (en) * 2020-04-17 2020-09-15 北京新意互动数字技术有限公司 Method and equipment for constructing webpage incompatible code knowledge base
CN115470127B (en) * 2022-09-06 2023-08-15 北京海泰方圆科技股份有限公司 Page compatibility processing method, device, computer equipment and storage medium

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103729285B (en) * 2012-10-11 2018-06-05 腾讯科技(深圳)有限公司 A kind of webpage test method, equipment and system
RU2611961C2 (en) * 2014-11-14 2017-03-01 Общество С Ограниченной Ответственностью "Яндекс" Method and system of regression testing of web page functionality, machine-readable data storage media
CN104636251B (en) * 2014-12-30 2017-12-08 佛山市蠢材科技有限公司 A kind of more browser compatibility method of testings and system
CN106326091B (en) * 2015-06-24 2020-12-11 深圳市腾讯计算机系统有限公司 Method and system for detecting browser webpage compatibility

Also Published As

Publication number Publication date
CN109947637A (en) 2019-06-28

Similar Documents

Publication Publication Date Title
CN109947637B (en) Automatic testing method, device, equipment and medium for webpage compatibility
US10713149B2 (en) Processing automation scripts of software
US10613971B1 (en) Autonomous testing of web-based applications
Choudhary et al. WEBDIFF: Automated identification of cross-browser issues in web applications
US9836385B2 (en) Cross-browser web application testing tool
US9507698B2 (en) Test code generation based on test documentation
US9983984B2 (en) Automated modularization of graphical user interface test cases
US20170132119A1 (en) Method and device for retrieving test case based on code coverage
CN105868096B (en) For showing the method, device and equipment of web page test result in a browser
CN110704304B (en) Application program testing method and device, storage medium and server
JP2004362000A (en) Web application development support device, component call monitoring device, data processing method and program
JP6440895B2 (en) Software analysis apparatus and software analysis method
CN103167016B (en) The method and apparatus that a kind of browser crash data is uploaded and processed
CN117370203A (en) Automatic test method, system, electronic equipment and storage medium
CN112241370A (en) Verification method, system and device for API (application program interface) interface class
CN113934617A (en) Data processing method, device, equipment and storage medium
CN110908907A (en) Web page testing method, device, equipment and storage medium
TW202303388A (en) Device and method for identifying errors in a software application
CN106557379B (en) Method and device for generating silent installation package
CN113238953A (en) UI automation test method and device, electronic equipment and storage medium
CN110008116B (en) Wechat webapp debugging method and device
US10296449B2 (en) Recording an application test
US20150199183A1 (en) Program analysis apparatus and program analysis method
US20230109433A1 (en) Test support method and information processing apparatus
CN106202319B (en) Abnormal URL (Uniform resource locator) verification method and system

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