Movatterモバイル変換


[0]ホーム

URL:


CN112306838A - Page layout compatibility testing method, device and equipment and readable storage medium - Google Patents

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

Info

Publication number
CN112306838A
CN112306838ACN201910666184.8ACN201910666184ACN112306838ACN 112306838 ACN112306838 ACN 112306838ACN 201910666184 ACN201910666184 ACN 201910666184ACN 112306838 ACN112306838 ACN 112306838A
Authority
CN
China
Prior art keywords
page
test
scene information
tested
preview area
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201910666184.8A
Other languages
Chinese (zh)
Inventor
黄昊
杨洋
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information Technology Co Ltd
Original Assignee
Beijing Jingdong Century Trading Co Ltd
Beijing Jingdong Shangke Information 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 Jingdong Century Trading Co Ltd, Beijing Jingdong Shangke Information Technology Co LtdfiledCriticalBeijing Jingdong Century Trading Co Ltd
Priority to CN201910666184.8ApriorityCriticalpatent/CN112306838A/en
Publication of CN112306838ApublicationCriticalpatent/CN112306838A/en
Pendinglegal-statusCriticalCurrent

Links

Images

Classifications

Landscapes

Abstract

The invention provides a page layout compatibility testing method, a page layout compatibility testing device, page layout compatibility testing equipment and a readable storage medium. The method of the invention comprises the steps of acquiring adaptation scene information corresponding to a plurality of test scenes in advance, and displaying the adaptation scene information of each test scene on a test interface so that a user can select different test scenes; acquiring a page address and adaptive scene information of a page to be tested; and displaying the page to be tested in the preview area according to the page address and the adaptation scene information, so that the display effect of the page layout of the page to be tested under the corresponding test scene of the adaptation scene information selected by the user can be simulated, an application program to be tested does not need to be installed and deployed on a real machine, the test environment does not need to be configured, the efficiency of the page layout compatibility test is greatly improved, and the test cost is reduced.

Description

Page layout compatibility testing method, device and equipment and readable storage medium
Technical Field
The invention relates to the technical field of software testing, in particular to a page layout compatibility testing method, device and equipment and a readable storage medium.
Background
With the popularization of mobile terminals such as mobile phones and the like all over the world, application programs based on the mobile phones are increasing day by day, and the test requirements matched with the application programs are also increasing. Due to the difference of software and hardware, different browser software is equipped for mobile phones produced by different merchants, and the page layout of the application program has compatibility problem.
At present, for testing the compatibility of page layout of an application program on different mobile phone terminals, the compatibility test is mostly directly performed on real machines of different brands, different machine types and different operating systems. A large number of real machines are needed as test platforms, so that the cost is high; and moreover, the application to be tested needs to be installed on each real machine, and the testing environment is configured, so that the time is consumed, and the testing efficiency is low.
Disclosure of Invention
The invention provides a page layout compatibility testing method, a device, equipment and a readable storage medium, which are used for solving the problems that a large number of genuine machines are required as a testing platform in the prior art, and the cost is high; and moreover, the application to be tested needs to be installed on each real machine, and the testing environment needs to be configured, so that the time is consumed, and the testing efficiency is low.
One aspect of the present invention provides a page layout compatibility testing method, including:
acquiring adaptive scene information corresponding to a plurality of test scenes, and displaying the adaptive scene information of each test scene on a test interface; acquiring a page address and adaptive scene information of a page to be tested; and displaying the page to be tested in a preview area according to the page address and the adaptive scene information.
Further, after the displaying the page to be tested in the preview area according to the page address and the adaptive scene information, the method further includes:
and responding to the received page address refreshing instruction, and refreshing the page displayed in the preview area according to the page address in the page address refreshing instruction.
Further, after the displaying the page to be tested in the preview area according to the page address and the adaptive scene information, the method further includes:
and responding to the received adaptive scene updating instruction, and refreshing the page size displayed in the preview area according to the adaptive scene information in the adaptive scene updating instruction.
Further, the preview area is a display area corresponding to the iframe tag. The displaying the page to be tested in a preview area according to the page address and the adaptive scene information comprises the following steps:
according to the page address, setting the src attribute of the iframe label corresponding to the preview area, and setting the page address as the page displayed by the iframe label corresponding to the preview area; and setting the width and the height of the iframe label corresponding to the preview area according to the adaptive scene information.
Further, the test scenario at least includes: the model and browser type of the mobile terminal; the adaptation scene information corresponding to the test scene comprises: and the size of the page which can be displayed in the test scene.
Further, after the displaying the page to be tested in the preview area according to the page address and the adaptive scene information, the method further includes: in response to the received exit test instruction, the current page address and/or adaptation scenario information is stored. Correspondingly, the acquiring the page address and the adaptive scene information of the page to be tested includes: and in response to the received starting test instruction, acquiring the stored page address and/or the adaptation scene information.
Further, after the displaying the page to be tested in the preview area according to the page address and the adaptive scene information, the method further includes:
responding to the received abnormal recording instruction, and acquiring the image displayed in the preview area; and correspondingly storing the image displayed in the preview area and the current page address with the current adaptive scene information or test scene.
Another aspect of the present invention is to provide a page layout compatibility testing apparatus, including:
the adaptive scene information processing module is used for acquiring adaptive scene information corresponding to a plurality of test scenes and displaying the adaptive scene information of each test scene on a test interface; the test data acquisition module is used for acquiring the page address and the adaptive scene information of the page to be tested; and the compatibility test processing module is used for displaying the page to be tested in the preview area according to the page address and the adaptive scene information.
Another aspect of the present invention is to provide a page layout compatibility test apparatus, including:
a processor, a memory, and a computer program stored on the memory and executable on the processor;
and when the processor runs the computer program, the page layout compatibility test method is realized.
Another aspect of the present invention provides a computer-readable storage medium, in which a computer program is stored, and the computer program, when executed by a processor, implements the page layout compatibility testing method described above.
The page layout compatibility test method, the device, the equipment and the readable storage medium provided by the invention have the advantages that the adaptation scene information corresponding to a plurality of test scenes is obtained in advance, and the adaptation scene information of each test scene is displayed on a test interface so that a user can select different test scenes; acquiring a page address and adaptive scene information of a page to be tested; and displaying the page to be tested in the preview area according to the page address and the adaptation scene information, so that the display effect of the page layout of the page to be tested under the corresponding test scene of the adaptation scene information selected by the user can be simulated, an application program to be tested does not need to be installed and deployed on a real machine, the test environment does not need to be configured, the efficiency of the page layout compatibility test is greatly improved, and the test cost is reduced.
Drawings
Fig. 1 is a flowchart of a page layout compatibility testing method according to an embodiment of the present invention;
FIG. 2 is a schematic diagram of a part of test scenarios and corresponding adaptation scenario information thereof according to an embodiment of the present invention;
FIG. 3 is a schematic diagram of a test interface provided in an embodiment of the present invention;
FIG. 4 is a diagram illustrating the display effect of a test interface according to an embodiment of the present invention;
fig. 5 is a flowchart of a page layout compatibility testing method according to a second embodiment of the present invention;
FIG. 6 is a diagram illustrating an effect of another test interface according to an embodiment of the present invention;
fig. 7 is a schematic structural diagram of a page layout compatibility testing apparatus according to a third embodiment of the present invention;
fig. 8 is a schematic structural diagram of a page layout compatibility test device according to a fifth embodiment of the present invention.
With the above figures, certain embodiments of the invention have been illustrated and described in more detail below. The drawings and the description are not intended to limit the scope of the inventive concept in any way, but rather to illustrate it by those skilled in the art with reference to specific embodiments.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the invention, as detailed in the appended claims.
The terms to which the present invention relates will be explained first:
the size of a mobile phone screen is as follows: the actual size of the physical screen of the mobile phone. When a page is displayed, the size of the mobile phone screen is divided by the top navigation bar, the bottom control bar and the page.
Page size: the size of a page actually displayed by the mobile terminal; the size of the page which can be actually displayed is the size of the page which can be actually displayed after the top navigation bar and the bottom control bar are removed.
Adaptation: the same page can be normally displayed on mobile phone screens with different sizes.
The iframe tag technology: the technology allows one page to be displayed and operated upon another page. The outer page may control the address and size of the inner page.
Key value of the key: the program provides a value when the key is pressed. The key value of each key is unique and fixed, and the key values corresponding to different keys are different and are used for distinguishing which key is pressed.
localStorage technology: the localStorage technology can store data for a long time, and even if a page or a browser is closed, when the page is accessed again next time, the data stored last time can still be acquired.
Furthermore, the terms "first", "second", etc. are used for descriptive purposes only and are not to be construed as indicating or implying relative importance or implicitly indicating the number of technical features indicated. In the description of the following examples, "plurality" means two or more unless specifically limited otherwise.
The page layout compatibility test method provided by the embodiment of the invention is applied to the terminal equipment, and the terminal equipment can be used for the compatibility test of the page layout display of the software application (such as interactive game application) applied to the mobile terminal (such as a smart phone, a shielded computer and the like). The terminal device may be a computer device capable of installing and running a test tool for implementing the page layout compatibility test method, in other embodiments, the method may also be applied to other devices, and this embodiment takes the terminal device as an example for schematic description.
The following describes the technical solutions of the present invention and how to solve the above technical problems with specific embodiments. The following several specific embodiments may be combined with each other, and details of the same or similar concepts or processes may not be repeated in some embodiments. Embodiments of the present invention will be described below with reference to the accompanying drawings.
Example one
Fig. 1 is a flowchart of a page layout compatibility testing method according to an embodiment of the present invention; FIG. 2 is a schematic diagram of a part of test scenarios and corresponding adaptation scenario information thereof according to an embodiment of the present invention; FIG. 3 is a schematic diagram of a test interface provided in an embodiment of the present invention; fig. 4 is a diagram of a display effect of a test interface according to an embodiment of the present invention. Aiming at the problems that a large number of real machines are needed as test platforms in the prior art, the cost is high; and moreover, the application to be tested needs to be installed on each real machine, and the testing environment needs to be configured, so that the problems of time consumption and low testing efficiency are solved, and the page layout compatibility testing method is provided. As shown in fig. 1, the method comprises the following specific steps:
step S101, obtaining adaptive scene information corresponding to a plurality of test scenes, and displaying the adaptive scene information of each test scene on a test interface.
In this embodiment, a method for directly using mobile terminals such as mobile phones of various models to perform real machine testing is abandoned, and corresponding test scenes are set according to the model of the mobile terminal and the difference of software environments during operation, and adaptive scene information related to page layout corresponding to each test scene is acquired. Then, the page layout compatibility test can be performed on the page layout compatibility test equipment by simulating the page layout display effect of each test scene according to the adaptive scene information related to the page layout corresponding to each test scene.
Specifically, the adaptive scene information of each test scene may be obtained by obtaining the size of the actually displayed page on the real machine corresponding to the test scene. For example, the values of the innerHeight and innerWidth attributes of the current display page may be obtained on the real machine corresponding to the test scenario.
Wherein, the test scenario at least includes: the model of the mobile terminal and the browser type. In different test scenarios, at least one of the model of the mobile terminal and the type of the browser used is different.
Further, the adaptation scenario information corresponding to the test scenario at least includes: and testing the size of the page which can be displayed in the scene. For example, it may be the resolution of the page that the test scenario can display. In addition, the adaptation scene information corresponding to the test scene may further include other information that affects the displayed page layout, and this embodiment is not specifically limited herein.
For example, as shown in fig. 2, the test scenario may relate to 14 models of mobile phones (as shown in the first column in fig. 2), the test scenario relates to 11 different types of browsers (as shown in the first row in fig. 2), each permutation and combination of each model and browser type serves as a test scenario, and the resolution of a page that can be displayed in each test scenario is as shown in fig. 2.
Optionally, the adaptation scene information in each test scenario may be obtained by reading the page size of the actually displayed page on the real machine corresponding to the test scenario.
In this embodiment, after the adaptation scene information corresponding to each test scene is acquired, the page layout compatibility test device may display the adaptation scene information of each test scene on the test interface, so that the user may select different test scenes for testing.
For example, the test interface may be as shown in fig. 3, and includes a page address input area, an adaptation scene information display area, and a preview area of a page to be tested. The page address input area is used for a user to input a page address of a page to be tested; the adaptive scene information display area is used for displaying adaptive scene information corresponding to each test scene, as exemplarily illustrated in fig. 3 by taking the resolution of a displayed page as an example; the preview area is used for displaying the page to be tested and simulating the display effect of the page to be tested in the test scene.
Optionally, when the adaptation scene information of each test scene is displayed, the information of the test scene corresponding to the currently selected adaptation scene information may also be displayed. For example, as shown in fig. 3, a model name and a browser type corresponding to the currently selected page resolution may be displayed under the adaptation scenario information.
And S102, acquiring the page address and the adaptive scene information of the page to be tested.
In this embodiment, a user may submit a page address of a current page to be tested and adaptation scenario information of a currently selected test scenario to the page layout compatibility test device through the test page.
Illustratively, based on the test interface shown in fig. 4, a user may input a page address of a page to be tested in a page address input area of the test interface, and submit the page address of the page to be tested to the page layout compatibility test device by clicking "refresh".
Illustratively, based on the test interface shown in fig. 4, the user may submit the selected adaptation scenario information to the page layout compatibility test device by clicking one of the adaptation scenario information display areas.
And S103, displaying the page to be tested in the preview area according to the page address and the adaptive scene information.
After the page address and the adaptive scene information of the page to be tested are obtained, the page layout compatibility testing equipment adjusts the size of the preview area according to the adaptive scene information and displays the page to be tested in the preview area according to the page address, so that the display effect of the page layout of the page to be tested under the test scene corresponding to the adaptive scene information selected by a user is simulated, and a technician can determine whether the page layout compatibility problem exists by checking the display effect of the preview area.
The embodiment of the invention pre-acquires the adaptation scene information corresponding to a plurality of test scenes and displays the adaptation scene information of each test scene on the test interface so that a user can select different test scenes; acquiring a page address and adaptive scene information of a page to be tested; according to the page address and the adaptation scene information, the page to be tested is displayed in the preview area, so that the display effect of the page layout of the page to be tested under the corresponding test scene of the adaptation scene information selected by the user can be simulated, an application program to be tested does not need to be installed and deployed on a real machine, the test environment does not need to be configured, the efficiency of page layout compatibility test is greatly improved, and the test cost is reduced.
Example two
Fig. 5 is a flowchart of a page layout compatibility testing method according to a second embodiment of the present invention; fig. 6 is a diagram illustrating a display effect of another test interface according to an embodiment of the present invention. On the basis of the first embodiment, in this embodiment, the displaying area corresponding to the iframe tag is the preview area, and the displaying of the page to be tested in the preview area according to the page address and the adaptive scene information includes: according to the page address, setting the src attribute of the iframe label corresponding to the preview area, and setting the page address as the page displayed by the iframe label corresponding to the preview area; and setting the width and height of the iframe label corresponding to the preview area according to the adaptive scene information. In addition, after the page to be tested is displayed in the preview area according to the page address and the adaptive scene information, a user can update the test scene of the current page to be tested according to actual needs and update the page address of the page to be tested.
As shown in fig. 5, the method comprises the following specific steps:
step S201, obtaining adaptive scene information corresponding to a plurality of test scenes, and displaying the adaptive scene information of each test scene on a test interface.
In this embodiment, a method for directly using mobile terminals such as mobile phones of various models to perform real machine testing is abandoned, and corresponding test scenes are set according to the model of the mobile terminal and the difference of software environments during operation, and adaptive scene information related to page layout corresponding to each test scene is acquired. Then, the page layout compatibility test can be performed on the page layout compatibility test equipment by simulating the page layout display effect of each test scene according to the adaptive scene information related to the page layout corresponding to each test scene.
Wherein, the test scenario at least includes: the model of the mobile terminal and the browser type. In different test scenarios, at least one of the model of the mobile terminal and the type of the browser used is different.
Further, the adaptation scenario information corresponding to the test scenario at least includes: and testing the size of the page which can be displayed in the scene. For example, it may be the resolution of the page that the test scenario can display. In addition, the adaptation scene information corresponding to the test scene may further include other information that affects the displayed page layout, and this embodiment is not specifically limited herein.
For example, as shown in fig. 2, the test scenario may relate to 14 models of mobile phones (as shown in the first column in fig. 2), the test scenario relates to 11 different types of browsers (as shown in the first row in fig. 2), each permutation and combination of each model and browser type serves as a test scenario, and the resolution of a page that can be displayed in each test scenario is as shown in fig. 2.
Optionally, the adaptation scene information in each test scenario may be obtained by reading the page size of the actually displayed page on the real machine corresponding to the test scenario.
In this embodiment, after the adaptation scene information corresponding to each test scene is acquired, the page layout compatibility test device may display the adaptation scene information of each test scene on the test interface, so that the user may select different test scenes for testing.
For example, the test interface may be as shown in fig. 3, and includes a page address input area, an adaptation scene information display area, and a preview area of a page to be tested. The page address input area is used for a user to input a page address of a page to be tested; the adaptive scene information display area is used for displaying adaptive scene information corresponding to each test scene, as exemplarily illustrated in fig. 3 by taking the resolution of a displayed page as an example; the preview area is used for displaying the page to be tested and simulating the display effect of the page to be tested in the test scene.
Optionally, when the adaptation scene information of each test scene is displayed, the information of the test scene corresponding to the currently selected adaptation scene information may also be displayed. For example, as shown in fig. 3, a model name and a browser type corresponding to the currently selected page resolution may be displayed under the adaptation scenario information.
Optionally, after the adaptation scene information of each test scene is acquired, a plurality of test scenes with the adaptation scene information close to each other may be merged to reduce the number of test scenes and improve the test efficiency. The two pieces of adaptive scene information are close, that is, the difference between the widths of the two pieces of adaptive scene information is smaller than a first difference value, and the difference between the heights of the two pieces of adaptive scene information is smaller than a second difference value.
Specifically, for any two test scenarios: and if the difference of the widths in the adaptive scene information of the first scene and the second scene is smaller than a first difference value and the difference of the heights is smaller than a second difference value, combining the two test scenes into a group.
Wherein the first difference and the second difference may be equal or unequal. For example, the first difference value and the second difference value are both 30 pixels. The first difference and the second difference may be set by a technician according to actual needs and experience, and the embodiment is not specifically limited herein.
Further, the following merging processing is performed on the test scenarios that are not grouped: comparing the adaptive scene information of the test scene with the adaptive scene information of all the groups in sequence; if the adaptive scene information of the test scene is close to the adaptive scene information of a certain packet, adding the test scene into the packet; and if the adaptation scene information of the test scene is not close to the adaptation scene information of all the groups, adding the test scene into a new group, wherein the adaptation scene information of the group is the adaptation scene information of the test scene. And then, the merging processing is carried out on the next test scene which is not grouped until all the test scenes are grouped, so that the groups of the merged test scenes are obtained, and the adaptive scene information of all the test scenes in each group is the same.
Optionally, the compatibility problem of the page layout is more likely to occur on a device with a smaller width and height of the displayed page, and therefore, the width and height of the matching scene information of a group of test scenes obtained by combination are used, and the minimum value of the width and height in the matching scene information of all the test scenes in the group is adopted.
Step S202, acquiring the page address and the adaptive scene information of the page to be tested.
In this embodiment, a user may submit a page address of a current page to be tested and adaptation scenario information of a currently selected test scenario to the page layout compatibility test device through the test page.
Illustratively, based on the test interface shown in fig. 4, a user may input a page address of a page to be tested in a page address input area of the test interface, and submit the page address of the page to be tested to the page layout compatibility test device by clicking "refresh".
Illustratively, based on the test interface shown in fig. 4, the user may submit the selected adaptation scenario information to the page layout compatibility test device by clicking one of the adaptation scenario information display areas.
And S203, displaying the page to be tested in the preview area according to the page address and the adaptive scene information.
After the page address and the adaptive scene information of the page to be tested are obtained, the page layout compatibility testing equipment adjusts the size of the preview area according to the adaptive scene information and displays the page to be tested in the preview area according to the page address, so that the display effect of the page layout of the page to be tested under the test scene corresponding to the adaptive scene information selected by a user is simulated, and a technician can determine whether the page layout compatibility problem exists by checking the display effect of the preview area.
For example, as shown in fig. 4, the button "get ticket immediately" is displayed outside the screen, and thus there is a compatibility problem with the page layout; and the test scene of the compatibility problem can be checked and seen through the corresponding model displayed on the test page, namely the Huazhi Mate10& uc browser. As shown in fig. 6, based on the same page to be tested in fig. 4, a page display effect of the page to be tested without compatibility problem of page layout is given in fig. 6.
In this embodiment, the preview area may be a display area corresponding to an iframe tag embedded in the test page, the page to be tested may be displayed in the preview area in an embedded manner by setting the src attribute of the iframe tag as the page address of the page to be tested, and the page to be tested displayed in the preview area may be replaced by modifying the src attribute of the iframe tag. The size of the page displayed in the preview area can be adjusted by modifying the width and height attributes of the iframe tag, so that the page display effect under different test scenes can be simulated.
Further, the page to be tested is displayed in the preview area according to the page address and the adaptive scene information, which can be specifically realized by adopting the following mode:
according to the page address, setting the src attribute of the iframe label corresponding to the preview area, and setting the page address as the page displayed by the iframe label corresponding to the preview area; and setting the width and height of the iframe label corresponding to the preview area according to the adaptive scene information.
Step S204, responding to the received abnormal recording instruction, and acquiring an image displayed in the current preview area; and storing the image displayed in the current preview area and the current page address corresponding to the current adaptive scene information or the test scene.
In this embodiment, optionally, after the page to be tested is displayed in the preview area according to the page address and the adaptive scene information, if a technician finds that there is a compatibility problem in the display of the page to be tested in the preview area, the technician may submit an abnormal recording instruction to the page layout compatibility test device through the test interface.
After receiving the abnormal recording instruction, the page layout compatibility testing device can acquire the image displayed in the current preview area, and correspondingly store the image displayed in the current preview area and the current page address with the current adaptive scene information or the test scene to generate the compatibility problem information in the current test scene.
Optionally, the page layout compatibility test device may further generate a compatibility test report according to the stored compatibility problem information in each test scenario, and display the compatibility test report on the front-end page, or send the compatibility test report to the designated device in a preset manner. The preset mode may be sending an email, sending a short message, and the like, and may be set by a technician according to actual needs, which is not specifically limited in this embodiment.
Step S205, responding to the received page address refresh command, and refreshing the page displayed in the preview area according to the page address in the page address refresh command.
In this embodiment, after the page to be tested is displayed in the preview area according to the page address and the adaptive scene information, the user may submit a page address refresh instruction to the page layout compatibility test device by re-inputting and submitting a new page address of the page to be tested on the test page, where the page address refresh instruction includes the page address of the page to be tested, which is re-input by the user.
For example, based on the test page as shown in fig. 4, the user may submit a page address refresh command to the page layout compatibility test device by re-inputting the page address of a page to be tested in the page address input area and clicking the "refresh" button.
After the page layout compatibility testing equipment receives the page address refreshing instruction, according to the page address in the page address refreshing instruction, the src attribute of the iframe label corresponding to the preview area is set so as to refresh the page displayed in the preview area, and therefore switching of pages to be tested in the same testing scene is achieved.
Step S206, responding to the received adaptive scene updating instruction, and refreshing the page size displayed in the preview area according to the adaptive scene information in the adaptive scene updating instruction.
In this embodiment, after a page to be tested is displayed in a preview area according to a page address and adaptation scene information, after a test scene is tested, a user may submit an adaptation scene update instruction to a page layout compatibility test device by specifying new adaptation scene information on the test page, where the adaptation scene update instruction includes the new adaptation scene information specified by the user.
After the page layout compatibility test equipment receives the adaptation scene updating instruction, the width and the height of the iframe label corresponding to the preview area can be reset according to the adaptation scene information in the adaptation scene updating instruction so as to refresh the size of the page displayed in the preview area, so that the display effect of the same page to be tested in different test scenes can be simulated, and the page layout compatibility test of the same page to be tested in different test scenes is realized.
Optionally, based on the test page shown in fig. 4, the user may submit an adaptation scene update instruction to the page layout compatibility test device by clicking any one of the adaptation scene information corresponding buttons in the selected adaptation scene information display area, where the adaptation scene update instruction includes the adaptation scene information currently selected by the user.
Optionally, the adaptation scene information reselected by the user may be determined according to the currently selected adaptation scene information in combination with the operation of the user on the direction key. The direction key may be a direction button displayed on the test page, or may also be a direction key on a keyboard device connected to the page layout compatibility test device, which is not specifically limited in this embodiment.
For example, the function of adapting the scene information is switched by "direction key", and the JavaScript technology can monitor the key value of the key pressed by the keyboard to determine which direction key is pressed, and further determine the next adapting scene information in the direction corresponding to the currently selected adapting scene information as the adapting scene information reselected by the user.
For example, the operation of the direction key by the user may include a click operation and a continuous pressing operation of the direction key. The clicking operation of the direction key refers to the operation that the direction key is lifted up after a first time interval is not exceeded after being pressed; the continuous pressing operation of the direction key refers to an operation that is lifted after a first time interval has elapsed after the direction key is pressed. The first time interval may be 1 second, and the first time interval may be set by a technician according to an actual application scenario and an empirical value, which is not specifically limited herein.
And if the clicking operation of the user on a certain direction key is detected, taking the next adaptive scene information in the direction corresponding to the direction key in the adaptive scene information display area as the adaptive scene information reselected by the user based on the currently selected adaptive scene information.
If the continuous pressing operation of the user on a certain direction key is detected, according to the continuous pressing operation duration time, after the direction key is pressed, moving the currently selected adaptive scene information to the next one along the direction corresponding to the direction key at intervals of a first time interval until the direction key is lifted, and taking the currently selected adaptive scene information as the adaptive scene information finally selected by the user.
For example, the first time interval is 1 second, when the continuous pressing operation of the user on the down key is detected, when the pressing time of the down key reaches 1 second, the currently selected adaptation scene information is moved downwards by one, when the pressing time of the down key reaches 2 seconds, the currently selected adaptation scene information is moved downwards by one again until the down key is lifted, and the currently selected adaptation scene information is used as the adaptation scene information finally selected by the user.
And step S207, responding to the received exit test instruction, and storing the current page address and/or the adaptation scene information.
In this embodiment, the page address and/or the adaptation scene information of the page to be tested, which is set before the test exit is performed after the test exit instruction is received, may be stored, so that when the test is started next time, the stored page address and/or the adaptation scene information may be directly obtained, and the page to be tested corresponding to the page address may be displayed in the preview area according to the stored page address and/or the adaptation scene information, which may reduce the number of times that the user repeatedly inputs the page address of the page to be tested, and submit the test efficiency.
Optionally, the current page address and/or the adaptive scene information may be stored in a local storage area (localStorage) of the browser through localStorage technology. Data is stored using the setItem method of localStorage, and the stored data is retrieved using the getItem method.
It should be noted that, in this embodiment, the above steps S204 to S207 may be executed sequentially, and in addition, the steps S204 to S207 may be executed after the step S203 in response to the corresponding instruction, and the execution sequence between the steps S204 to S207 is not particularly limited.
The embodiment of the invention refreshes the page displayed in the preview area according to the page address in the page address refreshing instruction by responding to the received page address refreshing instruction, thereby realizing the switching of the page to be tested in the same test scene; the size of the page displayed in the preview area is refreshed according to the adaptive scene information in the adaptive scene updating instruction in response to the received adaptive scene updating instruction, so that the display effect of the same page to be tested in different test scenes can be simulated, the compatibility test of the page layout of the same page to be tested in different test scenes is realized, and the efficiency of the page layout compatibility test is further improved.
EXAMPLE III
Fig. 7 is a schematic structural diagram of a page layout compatibility testing apparatus according to a third embodiment of the present invention. The page layout compatibility testing device provided by the embodiment of the invention can execute the processing flow provided by the page layout compatibility testing method embodiment. As shown in fig. 7, the page layoutcompatibility testing apparatus 30 includes: an adaptation sceneinformation processing module 301, a testdata acquisition module 302 and a compatibilitytest processing module 303.
Specifically, the adaptation scenarioinformation processing module 301 is configured to obtain adaptation scenario information corresponding to a plurality of test scenarios, and display the adaptation scenario information of each test scenario on the test interface.
The testdata obtaining module 302 is configured to obtain a page address and adaptation scenario information of a page to be tested.
And the compatibilitytest processing module 303 is configured to display the page to be tested in the preview area according to the page address and the adaptive scene information.
The apparatus provided in the embodiment of the present invention may be specifically configured to execute the method embodiment provided in the first embodiment, and specific functions are not described herein again.
The embodiment of the invention pre-acquires the adaptation scene information corresponding to a plurality of test scenes and displays the adaptation scene information of each test scene on the test interface so that a user can select different test scenes; acquiring a page address and adaptive scene information of a page to be tested; according to the page address and the adaptation scene information, the page to be tested is displayed in the preview area, so that the display effect of the page layout of the page to be tested under the corresponding test scene of the adaptation scene information selected by the user can be simulated, an application program to be tested does not need to be installed and deployed on a real machine, the test environment does not need to be configured, the efficiency of page layout compatibility test is greatly improved, and the test cost is reduced.
Example four
On the basis of the third embodiment, in this embodiment, the compatibility test processing module is further configured to:
and responding to the received page address refreshing instruction, and refreshing the page displayed in the preview area according to the page address in the page address refreshing instruction.
Optionally, the compatibility test processing module is further configured to:
and responding to the received adaptive scene updating instruction, and refreshing the page size displayed in the preview area according to the adaptive scene information in the adaptive scene updating instruction.
Optionally, the preview area is a display area corresponding to the iframe tag, and the compatibility test processing module is further configured to:
according to the page address, setting the src attribute of the iframe label corresponding to the preview area, and setting the page address as the page displayed by the iframe label corresponding to the preview area; and setting the width and height of the iframe label corresponding to the preview area according to the adaptive scene information.
Optionally, the test scenario at least includes: the model and browser type of the mobile terminal; the adaptive scene information corresponding to the test scene comprises: and testing the size of the page which can be displayed in the scene.
Optionally, the compatibility test processing module is further configured to:
in response to the received exit test instruction, the current page address and/or adaptation scenario information is stored.
Correspondingly, the test data acquisition module is further configured to:
and in response to the received starting test instruction, acquiring the stored page address and/or the adaptation scene information.
Optionally, the compatibility test processing module is further configured to:
responding to the received abnormal recording instruction, and acquiring an image displayed in the current preview area; and correspondingly storing the image displayed in the current preview area and the current page address with the current adaptive scene information or the test scene.
The apparatus provided in the embodiment of the present invention may be specifically configured to execute the method embodiment provided in the second embodiment, and specific functions are not described herein again.
The embodiment of the invention refreshes the page displayed in the preview area according to the page address in the page address refreshing instruction by responding to the received page address refreshing instruction, thereby realizing the switching of the page to be tested in the same test scene; the size of the page displayed in the preview area is refreshed according to the adaptive scene information in the adaptive scene updating instruction in response to the received adaptive scene updating instruction, so that the display effect of the same page to be tested in different test scenes can be simulated, the compatibility test of the page layout of the same page to be tested in different test scenes is realized, and the efficiency of the page layout compatibility test is further improved.
EXAMPLE five
Fig. 8 is a schematic structural diagram of a page layout compatibility test device according to a fifth embodiment of the present invention. As shown in fig. 8, the page layoutcompatibility test apparatus 70 includes: aprocessor 701, amemory 702, and a computer program stored on thememory 702 and executable on theprocessor 701;
when theprocessor 701 runs the computer program, the page layout compatibility test method provided by any one of the above method embodiments is implemented.
The embodiment of the invention pre-acquires the adaptation scene information corresponding to a plurality of test scenes and displays the adaptation scene information of each test scene on the test interface so that a user can select different test scenes; acquiring a page address and adaptive scene information of a page to be tested; according to the page address and the adaptation scene information, the page to be tested is displayed in the preview area, so that the display effect of the page layout of the page to be tested under the corresponding test scene of the adaptation scene information selected by the user can be simulated, an application program to be tested does not need to be installed and deployed on a real machine, the test environment does not need to be configured, the efficiency of page layout compatibility test is greatly improved, and the test cost is reduced.
In addition, an embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when the computer program is executed by a processor, the method for testing page layout compatibility provided in any of the above-mentioned method embodiments is implemented.
In the embodiments provided in the present invention, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, or in a form of hardware plus a software functional unit.
The integrated unit implemented in the form of a software functional unit may be stored in a computer readable storage medium. The software functional unit is stored in a storage medium and includes several instructions to enable a computer device (which may be a personal computer, a server, or a network device) or a processor (processor) to execute some steps of the methods according to the embodiments of the present invention. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk.
It is obvious to those skilled in the art that, for convenience and simplicity of description, the foregoing division of the functional modules is merely used as an example, and in practical applications, the above function distribution may be performed by different functional modules according to needs, that is, the internal structure of the device is divided into different functional modules to perform all or part of the above described functions. For the specific working process of the device described above, reference may be made to the corresponding process in the foregoing method embodiment, which is not described herein again.
Other embodiments of the invention will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This invention is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the invention and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the invention being indicated by the following claims.
It will be understood that the invention is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the invention is limited only by the appended claims.

Claims (10)

CN201910666184.8A2019-07-232019-07-23Page layout compatibility testing method, device and equipment and readable storage mediumPendingCN112306838A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201910666184.8ACN112306838A (en)2019-07-232019-07-23Page layout compatibility testing method, device and equipment and readable storage medium

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201910666184.8ACN112306838A (en)2019-07-232019-07-23Page layout compatibility testing method, device and equipment and readable storage medium

Publications (1)

Publication NumberPublication Date
CN112306838Atrue CN112306838A (en)2021-02-02

Family

ID=74328695

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201910666184.8APendingCN112306838A (en)2019-07-232019-07-23Page layout compatibility testing method, device and equipment and readable storage medium

Country Status (1)

CountryLink
CN (1)CN112306838A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113094287A (en)*2021-05-122021-07-09深圳市腾讯信息技术有限公司Page compatibility detection method, device, equipment and storage medium
CN115481045A (en)*2022-10-122022-12-16平安银行股份有限公司 Adaptability testing method, device, storage medium and equipment for banking business page

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104035863A (en)*2013-03-082014-09-10腾讯科技(深圳)有限公司Browser testing method and device
CN105955888A (en)*2016-05-042016-09-21腾讯科技(深圳)有限公司Page debugging and previewing method and system
CN106886491A (en)*2017-01-172017-06-23博彦科技股份有限公司Webpage compatibility test method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN104035863A (en)*2013-03-082014-09-10腾讯科技(深圳)有限公司Browser testing method and device
CN105955888A (en)*2016-05-042016-09-21腾讯科技(深圳)有限公司Page debugging and previewing method and system
CN106886491A (en)*2017-01-172017-06-23博彦科技股份有限公司Webpage compatibility test method and device

Cited By (4)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN113094287A (en)*2021-05-122021-07-09深圳市腾讯信息技术有限公司Page compatibility detection method, device, equipment and storage medium
CN113094287B (en)*2021-05-122024-03-15深圳市腾讯信息技术有限公司Page compatibility detection method, device, equipment and storage medium
CN115481045A (en)*2022-10-122022-12-16平安银行股份有限公司 Adaptability testing method, device, storage medium and equipment for banking business page
CN115481045B (en)*2022-10-122025-07-18平安银行股份有限公司Suitability test method and device for banking page, storage medium and equipment

Similar Documents

PublicationPublication DateTitle
CN110992092B (en)Advertisement delivery detection method and device, electronic equipment and storage medium
CN110659569B (en)Electronic signature method, device, storage medium and electronic equipment
CN106326120B (en)Regression testing method and device for application software and electronic equipment
US10101827B2 (en)Method and apparatus for controlling a touch-screen based application ported in a smart device
CN111143200A (en)Method and device for recording and playing back touch event, storage medium and equipment
CN110489312A (en)Data correlation method and device for control trigger data acquisition
CN110634049B (en)Page display content processing method and device, electronic equipment and readable medium
CN112947969A (en)Page off-screen rendering method, device, equipment and readable medium
CN112306838A (en)Page layout compatibility testing method, device and equipment and readable storage medium
CN111694550B (en)Page display control method, device and system
CN112988586A (en)Control testing method and device, electronic equipment and storage medium
CN113553132B (en) Information push method, device, system and equipment
CN110287397B (en)Content searching method and device based on screen saver and electronic equipment
CN111949510B (en)Test processing method, device, electronic equipment and readable storage medium
CN114741144B (en)Web-side complex form display method, device and system
KR101242878B1 (en)Method and system for extracting and providing item having annotation on electronic book
CN107766231B (en)Automatic testing method and device
CN110750742B (en)Page optimization method, system, medium and electronic equipment
CN113326180B (en) A method and device for testing task wizard
CN112286785B (en)Abnormality detection method and device for user interface
CN113986769A (en)Application testing method, system, device and computer readable storage medium
CN115729805A (en)Advertisement testing method and device, storage medium and program product
CN108449625B (en)Video screenshot method, device and terminal
CN112348403A (en)Wind control model construction method and device and electronic equipment
CN115982018B (en)UI test method, system, computer device and storage medium based on OCR

Legal Events

DateCodeTitleDescription
PB01Publication
PB01Publication
SE01Entry into force of request for substantive examination
SE01Entry into force of request for substantive examination

[8]ページ先頭

©2009-2025 Movatter.jp