Disclosure of Invention
The invention provides a page compatibility test method and a device, which are used for automatically obtaining pages to be tested in different styles according to a plurality of setting items after the plurality of setting items of the pages to be tested are obtained, and then determining the compatibility test result of the pages to be tested according to whether the pages to be tested in different styles reach the standard or not, so that the compatibility test efficiency is improved, and the compatibility test can be carried out on different styles and versions of the pages to be tested obtained by the setting items.
The invention provides a page compatibility testing method, which comprises the following steps:
acquiring a plurality of setting items of a page to be tested;
acquiring pages to be tested in different styles according to the plurality of setting items;
and determining the compatibility test result of the page to be tested according to whether the pages to be tested in different styles respectively reach the corresponding display standards.
In one embodiment, the obtaining of pages to be tested in different styles according to the plurality of setting items includes:
traversing a plurality of different setting parameters of each setting item in the plurality of setting items;
combining a plurality of different setting parameters of each setting item with a plurality of different setting parameters of other setting items in the plurality of setting items to obtain different setting parameter combinations, wherein the number of the setting parameters in each setting parameter combination in the different setting parameter combinations is the same as that of the plurality of setting items;
and respectively acquiring the pages to be tested with the styles corresponding to the different setting parameter combinations.
In one embodiment, the obtaining of pages to be tested in different styles according to the plurality of setting items includes:
starting a preset browser installed in a current operating system;
controlling the preset browser to carry out page loading based on the plurality of setting items;
and in the process of loading the page by the preset browser based on the plurality of setting items, screen capturing is carried out to obtain pages to be tested in different styles.
In an embodiment, the capturing a screen to obtain different styles of pages to be tested in the process of loading the page by the preset browser based on the plurality of setting items includes:
and in the process of loading the page by the preset browser based on the plurality of setting items, respectively carrying out screen capturing on the loaded pages to be tested in different styles, and correspondingly storing the screen captures of the pages to be tested in different styles and the identifications thereof.
In an embodiment, the determining the compatibility test result of the page to be tested according to whether the pages to be tested in the different styles respectively meet the corresponding display standards includes:
respectively carrying out image comparison on the pages to be tested in different styles and preset reference pages with the same styles so as to determine compatibility test results of the pages to be tested;
or
And displaying the pages to be tested in different styles in sequence, and prompting a user to input a feedback result so as to determine a compatibility test result of the pages to be tested according to the feedback result, wherein the feedback result is used for indicating whether the pages to be tested in different styles meet corresponding display standards.
The invention also provides a page compatibility testing device, which comprises:
the first acquisition module is used for acquiring a plurality of setting items of a page to be tested;
the second acquisition module is used for acquiring pages to be tested in different styles according to the plurality of setting items;
and the determining module is used for determining the compatibility test result of the page to be tested according to whether the pages to be tested in different styles respectively reach the corresponding display standards.
In one embodiment, the second obtaining module comprises:
the traversing submodule is used for traversing a plurality of different setting parameters of each setting item in the plurality of setting items;
a first obtaining sub-module, configured to combine a plurality of different setting parameters of each setting item with a plurality of different setting parameters of other setting items in the plurality of setting items, respectively, to obtain different setting parameter combinations, where the number of setting parameters in each setting parameter combination in the different setting parameter combinations is the same as the number of the plurality of setting items;
and the second obtaining submodule is used for respectively obtaining the pages to be tested with the styles corresponding to the different setting parameter combinations.
In one embodiment, the second obtaining module comprises:
the starting module is used for starting a preset browser installed in the current operating system;
the control sub-module is used for controlling the preset browser to load the page based on the plurality of setting items;
and the screen capture sub-module is used for capturing the screen in the process that the preset browser loads the page based on the plurality of setting items so as to obtain the pages to be tested in different styles.
In one embodiment, the screen capture submodule includes:
and the storage unit is used for respectively carrying out screen capturing on the loaded pages to be tested in different styles and correspondingly storing the screen captures of the pages to be tested in different styles and the identifiers of the pages to be tested in different styles in the process of carrying out page loading on the preset browser based on the plurality of setting items.
In one embodiment, the determining module comprises:
the first determining submodule is used for respectively carrying out image comparison on the pages to be tested in different styles and preset reference pages with the same styles so as to determine the compatibility test result of the pages to be tested;
or
And the second determining submodule is used for sequentially displaying the pages to be tested in different styles and prompting a user to input a feedback result so as to determine a compatibility test result of the pages to be tested according to the feedback result, wherein the feedback result is used for indicating whether the pages to be tested in different styles meet corresponding display standards.
The technical scheme provided by the embodiment of the disclosure can have the following beneficial effects:
after a plurality of setting items of the page to be tested are obtained, the page to be tested with different styles can be automatically obtained according to the plurality of setting items, and then the compatibility test result of the page to be tested is determined according to whether the page to be tested with different styles reaches the standard or not, so that the compatibility test efficiency is improved, the compatibility test can be performed on the pages with different styles and versions obtained by the setting items, the problem that the styles are abnormal and incompatible after the pages are on-line can be greatly reduced, and the test efficiency after each setting item/style adjustment is greatly improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Detailed Description
The preferred embodiments of the present invention will be described in conjunction with the accompanying drawings, and it will be understood that they are described herein for the purpose of illustration and explanation and not limitation.
In order to solve the above technical problem, the embodiment of the present disclosure provides a page compatibility testing method, which is suitable for a page compatibility testing program, system or device, and an execution subject of the method may be a terminal or a server of a mobile phone, a computer, or the like, as shown in fig. 1, the method includes steps S101 to S103,
in step S101, a plurality of setting items of a page to be tested are acquired; the setting items have different parameters, and the styles of the pages to be tested, which are rendered based on the parameters of the setting items, are different.
In step S102, obtaining pages to be tested in different styles according to a plurality of setting items;
the pages to be tested in different styles have the same content, and the pages to be tested in different styles have different contents.
In step S103, a compatibility test result of the page to be tested is determined according to whether the pages to be tested in different styles respectively meet the corresponding display standards.
After a plurality of setting items of the page to be tested are obtained, the page to be tested with different styles can be automatically obtained according to the plurality of setting items, and then the compatibility test result of the page to be tested is determined according to whether the page to be tested with different styles reaches the standard or not, so that the compatibility test efficiency is improved, the compatibility test can be performed on the pages with different styles and versions obtained by the setting items, the problem that the styles are abnormal and incompatible after the pages are on-line can be greatly reduced, and the test efficiency after each setting item/style adjustment is greatly improved.
The above step S103 may be performed as:
when the to-be-tested pages with the display patterns exceeding the preset proportion (such as 50%, 80% and the like) in the to-be-tested pages with different patterns respectively reach the corresponding display standards, the to-be-tested pages can be determined to pass the compatibility test, and if the patterns respectively reaching the corresponding display standards in the to-be-tested pages are lower than the preset proportion, the to-be-tested pages can be determined to have poor compatibility, and a prompt can be given to a user. For example: assuming that the page A to be tested has two setting items, and four types of pages a, b, c and d can be obtained according to the two setting items, at this time, if the preset proportion is 70%, and the page A to be tested in the page A, c type to be tested in the page A, b type to be tested in the a type respectively reaches the corresponding display standards, 75% of the proportion of the page A to be tested reaching the corresponding display standards respectively exceeds 70%, so that the page A to be tested can be determined to pass the compatibility test, and the compatibility is good; correspondingly, if the preset proportion is 100%, it is determined that the page a to be tested passes the compatibility test only if the four style pages respectively reach the corresponding display standards (for example, the display standards may be that the similarity between the style pages and the standard pages with the same style reaches 80%), and the compatibility is relatively good.
As shown in fig. 2, in an embodiment, the step S102 shown in fig. 1, namely acquiring pages to be tested in different styles according to a plurality of setting items, may include:
in step a1, traversing a plurality of different setting parameters of each setting item in a plurality of setting items;
a plurality of different setting parameters of each setting item, namely different values of each setting item are particularly desirable.
And the plurality of setting items include, but are not limited to, font size of the page, font type, skin of the page, how much content can be displayed in the page, style of the page (e.g., parent-child style, white-collar style, etc.), and the like.
In step a2, mutually combining a plurality of different setting parameters of each setting item with a plurality of different setting parameters of other setting items in the plurality of setting items respectively to obtain different setting parameter combinations, wherein the number of the setting parameters in each setting parameter combination in the different setting parameter combinations is the same as the number of the plurality of setting items;
for example: when the setting item has 3, and the setting item 1 may have M different setting parameters, the setting item 2 may have N different setting parameters, and the setting item 3 may have P different setting parameters, the number of the setting parameter combinations is M × N × P, and each setting parameter combination of the M × N × P setting parameter combinations has 3 setting parameters, which are respectively from one of the setting parameters of the setting item 1, one of the setting parameters of the setting item 2, and one of the setting parameters of the setting item 3, that is, the M different setting parameters of the setting item 1 are respectively combined with the N different setting parameters of the setting item 2 and the P different setting parameters of the setting item 3.
In step a3, the pages to be tested are obtained in the styles corresponding to different sets of parameters.
Different setting parameter combinations can be automatically obtained by traversing a plurality of different setting parameters of each setting item, and then the page to be tested of the pattern corresponding to each setting parameter combination is respectively obtained, namely, because the setting parameters contained in each setting parameter combination are different from the setting parameters contained in other setting parameter combinations, the pattern of the page to be tested obtained according to each setting parameter combination is possibly different, thus, the page to be tested with all patterns which can be obtained by the setting parameters of the setting items can be automatically obtained based on all the setting items of the page to be tested, thereby carrying out compatibility test on the page to be tested with different pattern versions, thus being beneficial to improving the accuracy rate of the compatibility test of the page to be tested and effectively improving the efficiency of the compatibility test of the page to be tested, through the page regression test of the various style combination classes, the compatibility test efficiency of the page can be improved by at least 50%.
In an embodiment, the step S102 shown in fig. 1, namely, obtaining pages to be tested in different styles according to a plurality of setting items, may be performed as follows:
starting a preset browser installed in a current operating system;
when the preset browser is automatically started, the preset browser can be automatically started based on the written script, and the current operating system can be an android system, a Microsoft windows operating system, a macOS operating system and the like.
When there are a plurality of preset browsers, any one of the browsers can be started, or each browser can be started separately.
Controlling a preset browser to load a page based on a plurality of setting items;
and in the process of loading the page based on the plurality of setting items by the preset browser, screen capturing is carried out to obtain pages to be tested in different styles.
When the pages to be tested in different styles are obtained, the preset browser installed in the current operating system can be automatically started, then the preset browser is controlled to load the pages based on the plurality of setting items, specifically, the pages are loaded based on the setting parameter combinations of the plurality of setting items, and screen capturing is carried out in the page loading process to obtain the pages to be tested in different styles, so that compatibility testing can be carried out on the pages to be tested in different styles and versions obtained by the setting items, and therefore, the compatibility testing accuracy rate of the pages to be tested is improved, and the compatibility testing efficiency of the pages to be tested is also improved effectively.
In one embodiment, in the process of loading a page based on a plurality of setting items by a preset browser, screen capturing is performed to obtain pages to be tested in different styles, and the method includes:
in the process of loading the page based on the plurality of setting items by the preset browser, the loaded pages to be tested in different styles are respectively subjected to screen capture, and the screenshots of the pages to be tested in different styles and the identifications of the pages to be tested are correspondingly stored.
In the process of loading the page based on the plurality of setting items by the preset browser, the loaded page to be tested in each style can be subjected to screen capture, and the screen capture of the page to be tested in each style and the identification (such as the number, name and the like of the page to be tested in the style) of the page to be tested in the style are correspondingly stored, so that the page to be tested in each style can be clearly stored.
In one embodiment, determining the compatibility test result of the page to be tested according to whether the pages to be tested in different styles respectively reach the corresponding display standards includes:
respectively carrying out image comparison on the pages to be tested with different styles and the preset reference pages with the same styles so as to determine the compatibility test result of the pages to be tested;
or
Displaying the pages to be tested in different styles in sequence, and prompting a user to input a feedback result so as to determine a compatibility test result of the pages to be tested according to the feedback result, wherein the feedback result is used for indicating whether the pages to be tested in different styles meet corresponding display standards.
When the compatibility test result of the page to be tested is determined, the page to be tested in different styles can be respectively subjected to image comparison with the preset reference page with the same style, so that the compatibility test result of the page to be tested is automatically determined, wherein the preset reference page with the same style refers to a display page of the page to be tested in the same style when the page to be tested is compatible, and of course, the more styles of the page to be tested are matched with the images of the preset reference pages, the better the compatibility of the page to be tested is. Or
When the compatibility test result of the page to be tested is determined, the user can be prompted to input the feedback result of the page to be tested in different styles, so that the compatibility test result of the page to be tested is determined according to the feedback result, and certainly, if the feedback result indicates that most of the styles of the page to be tested reach the corresponding display standard, the page to be tested can be determined to have better compatibility, and the compatibility test is passed.
As shown in fig. 3, the present invention further provides a page compatibility testing apparatus, including:
a first obtainingmodule 301 configured to obtain a plurality of setting items of a page to be tested;
the second obtainingmodule 302 is configured to obtain pages to be tested in different styles according to the plurality of setting items;
the determiningmodule 303 is configured to determine a compatibility test result of the page to be tested according to whether the pages to be tested in different styles respectively meet the corresponding display standards.
As shown in fig. 4, in one embodiment, the second obtainingmodule 302 may include:
atraversal submodule 3021 configured to traverse a plurality of different setting parameters of each of the plurality of setting items;
a first obtaining sub-module 3022 configured to combine a plurality of different setting parameters of each setting item with a plurality of different setting parameters of other setting items in the plurality of setting items, respectively, to obtain different setting parameter combinations, where the number of the setting parameters in each setting parameter combination in the different setting parameter combinations is the same as the number of the plurality of setting items;
the second obtaining sub-module 3023 is configured to obtain the pages to be tested in the styles corresponding to the different setting parameter combinations, respectively.
In one embodiment, the second obtaining module includes:
the starting sub-module is configured to start a preset browser installed in a current operating system;
the control sub-module is configured to control a preset browser to carry out page loading based on a plurality of setting items;
the screen capture sub-module is configured to capture a screen in the process that the preset browser loads the page based on the plurality of setting items so as to obtain pages to be tested in different styles.
In one embodiment, the screen capture submodule includes:
and the storage unit is configured to respectively capture the loaded pages to be tested in different styles and correspondingly store the screenshots and the identifications of the pages to be tested in different styles in the process of loading the pages based on the plurality of setting items by the preset browser.
In one embodiment, the determining module includes:
the first determining submodule is configured to perform image comparison on the pages to be tested in different styles and preset reference pages in the same style as the pages to be tested respectively so as to determine a compatibility test result of the pages to be tested;
or
And the second determining submodule is configured to sequentially display the pages to be tested in different styles, prompt a user to input a feedback result and determine a compatibility test result of the pages to be tested according to the feedback result, wherein the feedback result is configured to indicate whether the pages to be tested in different styles meet corresponding display standards.
With regard to the apparatus in the above-described embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Finally, the page compatibility testing device is suitable for terminal equipment. For example, it may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, an exercise device, a personal digital assistant, etc.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.