Page test method and device, terminal equipment and readable storage medium
By detecting and triggering target page elements, obtaining and storing the address list of the page after jump, the problem that the existing technology cannot test nested jump pages, and a comprehensive test of nested pages is achieved.
Patent Information
- Application Number
- CN202311085593.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-25
- Publication Date
- 2025-03-04
AI Technical Summary
Existing page testing tools can only test the target page based on the page address of the target page, and cannot test its nested jump page.
By detecting the page elements in the target page and triggering it, the page address of the jumped page is obtained when the page jump event is triggered, and it is stored in the address list. The jumped page is updated as the target page until all page elements trigger the operation, and there is no jump event. Then, the jumped page is tested based on the address list.
Page testing of jump pages nested by the target page is realized, expanding the coverage of page testing.
Smart Images

Figure CN119557194A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the technical field of page testing, and in particular, relates to a page testing method, apparatus, terminal device and readable storage medium. Background Art
[0002] In order to ensure the user experience, it is often necessary to perform page testing on front-end network (Web) pages and fifth-generation Hypertext Markup Language 5 (HTML5 / H5) pages.
[0003] The current page testing method usually inputs the page address into the page testing tool, and then tests the corresponding page. However, for a target page, it may be nested with multiple jump pages, and when performing page testing, it is often necessary to test its jump pages as well. In this case, the page testing tool can only perform page testing on the target page according to the page address of the target page, and cannot perform page testing on its nested jump pages. Summary of the invention
[0004] The embodiments of the present application provide a page testing method, apparatus, terminal device and readable storage medium, which can solve the problem that the page testing tool can only perform page testing on the target page according to the page address of the target page, but cannot perform page testing on its nested jump pages.
[0005] In a first aspect, an embodiment of the present application provides a page testing method, the method comprising:
[0006] Detecting page elements in a target page and performing trigger operations on the page elements;
[0007] When a page jump event is triggered, the page address of the page after the jump is obtained, and the page address is stored in the address list;
[0008] The page after the jump is updated to the target page, and the step of detecting the page elements in the target page is returned to be executed until a page jump event is not triggered after triggering operations are performed on all the page elements in the target page;
[0009] Based on each of the page addresses in the address list, a page test is performed on the page after the jump.
[0010] In a second aspect, an embodiment of the present application provides a page testing device, the device comprising:
[0011] An element detection module is used to detect page elements in a target page and perform trigger operations on the page elements;
[0012] An address acquisition module is used to acquire the page address of the page after the jump when a page jump event is triggered, and store the page address in an address list;
[0013] A page update module, used for updating the page after the jump to the target page, and returning to the step of detecting the page elements in the target page, until no page jump event is triggered after triggering operations are performed on all page elements in the target page;
[0014] The page testing module is used to perform page testing on the redirected page based on each of the page addresses in the address list.
[0015] In a third aspect, an embodiment of the present application provides a terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements a page testing method described in the first aspect when executing the computer program.
[0016] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the page testing method described in the first aspect is implemented.
[0017] In a fifth aspect, an embodiment of the present application provides a computer program product. When the computer program product is run on a terminal device, the terminal device executes a page testing method described in the first aspect above.
[0018] Compared with the prior art, the embodiments of the present application have the following beneficial effects: the present application detects page elements in the target page and performs a trigger operation on the page elements; in the case of triggering a page jump event, obtains the page address of the page after the jump, and stores the page address in an address list; updates the page after the jump to the target page, and returns to execute the step of detecting page elements in the target page until all page elements in the target page are triggered without triggering a page jump event; based on each page address in the address list, performs a page test on the page after the jump. The present application stores the page address of the page after the jump after the page jump event is triggered, and updates the page after the jump to the target page, and finally obtains an address list, and then implements a page test of the jump page nested in the target page based on the address list. BRIEF DESCRIPTION OF THE DRAWINGS
[0019] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.
[0020] Figure 1 It is a flow chart of a page testing method provided by an embodiment of the present application;
[0021] Figure 2 is a flow chart of a page testing method provided by another embodiment of the present application;
[0022] Figure 3 is a schematic structural block diagram of a page testing device provided in an embodiment of the present application;
[0023] Figure 4 It is a structural diagram of a terminal device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0024] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0025] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0026] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0027] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0028] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0029] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0030] Embodiment 1:
[0031] See also Figure 1 , Figure 1 The figure shows a schematic flow of a page testing method provided by the present application.
[0032] Step 101: Detect page elements in a target page and perform a trigger operation on the page elements.
[0033] The target page refers to the page to be tested, such as a web page or an H5 page.
[0034] It should be noted that the page to be tested may have a corresponding page address, so that the terminal device can access the corresponding page based on the page address; as an example, the page address may be a Uniform Resource Locator (URL).
[0035] Optionally, the page elements in the target page can be detected after the target page is tested, or the page address of the target page can be stored in an address list to perform page tests on the target page and its nested jump pages based on the address list. The jump page refers to the page that is jumped to after the trigger operation triggers the page jump event, that is, the page after the jump.
[0036] Before detecting the page elements in the target page, the page address of the target page can be input in the page test interface so that the terminal device can access the target page and then detect the page elements in the target page.
[0037] Optionally, page elements refer to elements constituting the target page, including but not limited to text, pictures, animations and other elements.
[0038] In a possible implementation, the page elements in the target page may be detected by using an interpreted or just-in-time compiled programming language (JavaScript, JS) script.
[0039] In another possible implementation, the page elements in the target page may be detected using a trained neural network model.
[0040] Optionally, the detected page elements may refer to all page elements in the target page, or may be interactive page elements (e.g., clickable page elements) in the target page. When detecting interactive page elements through JS scripts, the detection may be performed in combination with the attribute information of the page elements.
[0041] Optionally, detecting the page elements in the target page may refer to detecting and identifying the page elements in the target page, for example, the detection result is a page element bounding box, or may refer to detecting position information of the page elements in the target page.
[0042] The target page is displayed in the visible area, and the visible area may refer to the browser display area, that is, the effective area in the browser that displays the page. As an example and not a limitation, the position information of the page element includes: the distance between the top of the page element and the top of the visible area, the distance between the bottom of the page element and the top of the visible area, the distance between the left side of the page element and the left side of the visible area, the distance between the right side of the page element and the left side of the visible area, and the width and height of the page element. Based on the above position information, the position of the page element in the visible area can be determined, such as the coordinates of the center point of the page element.
[0043] Optionally, the page element may be triggered based on the detection and recognition result of the page element, or the page element may be triggered based on the position information of the page element.
[0044] In order to save labor costs and improve test speed and accuracy, the trigger operation can be an operation simulated by the terminal device to interact with the page elements. As an example and not limitation, the trigger operation can refer to click (single or double click), slide, long press and other operations.
[0045] Optionally, when multiple page elements are detected, a trigger operation may be performed on each page element separately.
[0046] The page height of the target page may be higher than the height of the visible area. In this case, the page elements obtained based on the page displayed in the visible area are part of the page elements in the target page. In order to implement page testing for all jump pages nested in the target page and avoid missing jump pages, this application needs to obtain all page elements in the target page.
[0047] Optionally, determining whether the page height of the target page is higher than the height of the visible area includes: after the target page is displayed in the visible area, obtaining the height of the loaded page to obtain a first height; if the first height is greater than the height of the visible area, determining that the page height of the target page is higher than the height of the visible area.
[0048] The page loading methods include lazy loading and full-screen loading. Lazy loading, also known as delayed loading or on-demand loading, means loading only when an object or data is needed. For a long page, the pages in the visible area are loaded first, and the pages outside the visible area will not be loaded. In order to avoid blank pages during the sliding process and improve the user experience, when lazy loading is performed, the pages in the visible area and the area of a set size below the visible area can be loaded first; full-screen loading means that the page content is loaded at one time, and the interface can stay in the loading interface before the page content is loaded.
[0049] When the page height of the target page is higher than the height of the visible area, if the target page is loaded in lazy loading mode, after the target page is displayed in the visible area, the loaded pages are the pages of the visible area and the set size area below the visible area. For example, after the target page is displayed in the visible area, the loaded pages are the pages of the first screen and part of the second screen; if the target page is loaded in full screen loading mode, after the target page is displayed in the visible area, the loaded pages are the entire page. Based on this, it can be known that regardless of whether the target loading page is loaded in lazy loading or full screen loading mode, after the target page is displayed in the visible area, the height of the loaded page will be higher than the height of the visible area. Therefore, after the target page is displayed in the visible area, the height of the loaded page can be obtained, and the height of the currently loaded page can be compared with the visible area to determine whether the page height of the target page is higher than the height of the visible area.
[0050] In an optional embodiment, if the page height of the target page is higher than the height of the visible area, the page elements in the target page are detected, including: sliding the target page, and detecting the page elements displayed in the visible area after each slide until sliding to the bottom of the target page; based on the page elements displayed in the visible area detected after each slide, obtaining the page elements in the target page.
[0051] Optionally, when sliding the target page, the page sliding height may be preset, for example, the page sliding height corresponding to each sliding is the height of the visible area, or the page sliding height may not be preset.
[0052] After each slide, the page elements in the entire page displayed in the visible area may be detected, or the page elements in a partial page in the visible area may be detected; wherein the partial page may refer to the page that enters the visible area corresponding to the slide operation.
[0053] When sliding the target page, it is necessary to determine whether the target page has been slid to the bottom. If the target page has been slid to the bottom, the sliding can be stopped.
[0054] The target page is loaded in different ways, and the method for determining whether the page has been slid to the bottom of the target page may be different. Based on this, the present application also needs to determine the target page loading method.
[0055] Optionally, determining the page loading mode of the target page includes: obtaining the height of the page loaded before sliding and the height of the page loaded after sliding; if the height of the page loaded after sliding is greater than the height of the page loaded before sliding, determining that the page loading mode of the target page is lazy loading; if the height of the page loaded after sliding is equal to the height of the page loaded before sliding, determining that the page loading mode of the target page is full screen loading.
[0056] For lazy loading, the target page is loaded as the page slides. In this case, the height of the loaded page increases as the page slides. For full-screen loading, since the target page has been fully loaded at the beginning, in this case, the height of the loaded page is fixed and will not change as the page slides. In summary, this application determines the page loading method of the target page based on the height of the loaded page obtained before and after sliding.
[0057] Optionally, in order to instantly determine whether the target page has been slid to the bottom, the page loading mode of the target page may be determined after the first slid.
[0058] In an optional embodiment, if the target page is loaded in lazy loading mode, it is determined whether the page has been slid to the bottom of the target page, including: after each slide, obtaining the height of the loaded page to obtain a second height; if the second height is equal to the third height, it is determined that the page has been slid to the bottom of the target page, and the third height is the height of the loaded page obtained before the slide.
[0059] If the page has not been slid to the bottom of the target page, the height of the loaded page obtained after sliding is greater than the height of the loaded page obtained before sliding, that is, the second height is greater than the third height; if the page has been slid to the bottom of the target page, the target page has been loaded, and when the target page is slid again, the height of the loaded page obtained before and after sliding is the same, that is, the second height is equal to the third height.
[0060] In an optional embodiment, if the target page is loaded in full screen mode, determining whether the page has been slid to the bottom of the target page includes: obtaining the number of slides after each slide; if the number of slides is equal to the set number of slides, determining that the page has been slid to the bottom of the target page. The set number of slides is determined based on the page height of the target page and the slide height corresponding to the preset slide operation. Specifically, the quotient of the page height of the target page divided by the slide height corresponding to the preset slide operation is obtained, and the quotient is rounded up to obtain the set number of slides.
[0061] In an optional embodiment, if the target page is loaded in full screen mode, determining whether the page has been slid to the bottom of the target page also includes: after each slide, obtaining the displayed page height; if the displayed page height is equal to the page height of the target page, determining that the page has been slid to the bottom of the target page. The displayed page height refers to the height of the page that has been displayed in the visible area. The displayed page height increases as the page slides. If the displayed page height is equal to the page height of the target page, it can be said that the target page has been fully displayed, that is, it can be said that the page has been slid to the bottom of the target page.
[0062] Optionally, when obtaining the page elements in the target page based on the page elements displayed in the visible area detected after each sliding, the page elements detected after each sliding can be compared with the page elements detected before sliding. If there are duplicate page elements among the page elements detected after sliding, the duplicate page elements are deleted.
[0063] Step 102, when a page jump event is triggered, obtain the page address of the page after the jump, and store the page address in an address list.
[0064] Alternatively, whether a page jump event is triggered can be determined based on whether the page address changes. If the page address of the current page is the same as the page address of the target page after the trigger operation is performed on the page element, it can be determined that the page jump event is not triggered, otherwise, it can be determined that the page jump event is triggered.
[0065] Optionally, the address list corresponds to the target page and is used to store the page addresses of the jump pages nested in the target page.
[0066] Step 103, updating the page after the jump to the target page, and returning to the step of detecting the page elements in the target page, until the page jump event is not triggered after triggering operations are performed on all the page elements in the target page.
[0067] In order to realize automatic traversal of the jump pages nested in the target page, the page after the jump can be updated to the target page, and steps 101 and 102 are executed repeatedly until the page jump event is not triggered after the trigger operation is performed on all the page elements in the target page. Among them, the loop termination condition is that the page jump event is not triggered after the trigger operation is performed on all the page elements in the target page, that is, the loop is terminated when there is no jump page nested in the target page.
[0068] Step 104: Based on each page address in the address list, perform a page test on the page after the jump.
[0069] Optionally, after traversing the redirected pages nested in the target page based on the page elements, a page test may be performed on the redirected page based on the page address in the address list.
[0070] Optionally, when performing page testing on the redirected page based on each page address in the address list, the page testing may be performed on one redirected page at a time, or on multiple redirected pages at a time, so as to improve testing efficiency.
[0071] Optionally, the above page test may refer to a page performance test. As an example and not a limitation, page performance test indicators include but are not limited to: First Contentful Paint (FCP), Largest Contentful Paint (LCP), Time To Interactive (TTI), Total Blocking Time (TBT), Cumulative Layout Shift (CLS), First Input Delay (FID) and other indicators.
[0072] Optionally, when performing a page test, the page address and the corresponding test result may be recorded. If the test result indicates that the test fails, the corresponding page address and test result may be marked so that the user can quickly lock the page that fails the test.
[0073] The present application detects page elements in a target page and triggers the page elements; in the case of triggering a page jump event, obtains the page address of the page after the jump, and stores the page address in an address list; updates the page after the jump to the target page, and returns to the step of detecting page elements in the target page until all page elements in the target page are triggered without triggering a page jump event; based on each page address in the address list, performs a page test on the page after the jump. The present application stores the page address of the page after the jump after the page jump event is triggered, and updates the page after the jump to the target page, and finally obtains an address list, and then implements a page test of the jump page nested in the target page based on the address list.
[0074] It should be understood that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0075] Embodiment 2:
[0076] See also Figure 2 , Figure 2 The figure shows a schematic flow of a page testing method provided by the present application.
[0077] Step 201: detect page elements in a target page and perform a trigger operation on the page elements.
[0078] The relevant contents in step 201 can refer to the relevant description in step 101, which will not be repeated here.
[0079] Step 202: If no page jump event is triggered, re-detect page elements in the target page.
[0080] In addition to triggering a page jump event, the trigger operation may also trigger other events, such as a pop-up display event, resulting in the appearance of new page elements in the target page. The new page elements may also correspond to a jump page. Based on this, in order to achieve a comprehensive traversal of the jump page, this application re-detects the page elements in the target page without triggering a page jump event to determine whether there are new page elements in the target page.
[0081] For re-detecting the contents of the page elements in the target page, reference may be made to the relevant description in step 101, which will not be repeated here.
[0082] Optionally, when a page jump event is not triggered, re-detecting page elements in the target page, including: when a page jump event is not triggered, determining whether a message prompt box display event is triggered; if a message prompt box display event is not triggered, re-detecting page elements in the target page.
[0083] In addition to page jump events and pop-up display events, the triggering operation may also trigger a message prompt box (Toast) display event, and the message prompt box cannot be clicked, so displaying the message prompt box in the visible area will not cause new page elements to appear in the target page. Therefore, in order to reduce the waste of computing resources and improve the overall speed of page testing, this application can first detect whether the message prompt box display event is triggered without triggering the page jump event. If the message prompt box display event is not triggered, the page elements in the target page will be re-detected.
[0084] Optionally, determining whether to trigger a message prompt box display event includes: obtaining an HTML file corresponding to the target page; detecting whether the HTML file contains identification information of the message prompt box; and determining to trigger a message prompt box display event if the HTML file contains identification information of the message prompt box. The identification information of the message prompt box may be the name of the message prompt box.
[0085] Step 203: If there is a newly added page element, a trigger operation is performed on the newly added page element, and when a page jump event is triggered, a page address of the page after the jump is obtained, and the page address is stored in an address list.
[0086] Step 204, updating the page after the jump to the target page, and returning to the step of detecting the page elements in the target page, until the page jump event is not triggered after triggering operations are performed on all the page elements in the target page.
[0087] Step 205: Based on each page address in the address list, perform a page test on the page after the jump.
[0088] For the relevant contents in step 203 to step 205, reference can be made to the relevant descriptions in steps 101 to 104, which will not be repeated here.
[0089] Without triggering a page jump event, this application re-detects the page elements in the target page to determine whether there are new page elements, and then detects whether there are jump pages nested in pop-up windows and other interfaces based on the new page elements. This can comprehensively traverse the jump pages nested in the target page, thereby improving the page coverage of the page testing method of this application.
[0090] Embodiment three:
[0091] See also Figure 3 , Figure 3 The schematic structure of a page testing device provided by the present application is shown. For the convenience of explanation, only the parts related to the embodiment of the present application are shown in the figure.
[0092] Reference Figure 3 The device includes an element detection module 31, an address acquisition module 32, a page update module 33 and a page test module 34; wherein the specific functions of each module are as follows:
[0093] The element detection module 31 is used to detect page elements in the target page and perform trigger operations on the page elements;
[0094] An address acquisition module 32 is used to acquire the page address of the page after the jump when a page jump event is triggered, and store the page address in an address list;
[0095] The page update module 33 is used to update the page after the jump to the target page, and return to the step of detecting the page elements in the target page until the page jump event is not triggered after the trigger operation is performed on all the page elements in the target page;
[0096] The page test module 34 is used to perform page test on the redirected page based on each page address in the address list.
[0097] Optionally, the target page is displayed in the visible area, and the page height of the target page is higher than the height of the visible area. The element detection module 31 is specifically used to: slide the target page, and after each slide, detect the page elements displayed in the visible area until sliding to the bottom of the target page; based on the page elements displayed in the visible area detected after each slide, obtain the page elements in the target page.
[0098] Optionally, the device also includes a first determination module, which is used to: after the target page is displayed in the visible area, obtain the height of the loaded page to obtain a first height; if the first height is greater than the visible area height, determine that the page height of the target page is higher than the visible area height.
[0099] Optionally, the target page is loaded in a lazy loading mode, and the element detection module 31 is specifically used to: after each sliding, obtain the height of the loaded page to obtain a second height; if the second height is equal to the third height, it is determined that the slide has reached the bottom of the target page, and the third height is the height of the loaded page obtained before the sliding.
[0100] Optionally, the device also includes a second determination module, used to: obtain the height of the page loaded before sliding and the height of the page loaded after sliding; if the height of the page loaded after sliding is greater than the height of the page loaded before sliding, determine that the page loading mode of the target page is lazy loading.
[0101] Optionally, the device also includes a re-detection module, which is used to: re-detect the page elements in the target page when no page jump event is triggered; if there are new page elements, trigger the new page elements, and when the page jump event is triggered, obtain the page address of the page after the jump, and store the page address in an address list.
[0102] Optionally, the re-detection module is specifically used to: determine whether to trigger a message prompt box display event when the page jump event is not triggered; if the message prompt box display event is not triggered, re-detect the page elements in the target page.
[0103] The above-mentioned page testing device provided in the embodiment of the present application can be applied in the above-mentioned method embodiments 1 and 2. For details, please refer to the description of the above-mentioned method embodiments 1 and 2, which will not be repeated here.
[0104] Embodiment 4:
[0105] See also Figure 4 , Figure 4 FIG. 4 shows a schematic structure of a terminal device provided by an embodiment of the present application. The terminal device 4 of this embodiment includes: at least one processor 40 ( Figure 4 Only one is shown), a memory 41, and a computer program 42 stored in the memory 41 and executable on the at least one processor 40, wherein the processor 40 implements the steps of a page testing method in the above-mentioned first and second embodiments when executing the computer program 42.
[0106] The terminal device 4 may be a computing device such as a desktop computer, a notebook, a PDA, or a cloud server. The terminal device 4 may include, but is not limited to, a processor 40 and a memory 41. Those skilled in the art will appreciate that Figure 4 It is only an example of the terminal device 4 and does not constitute a limitation on the terminal device 4. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, it may also include input and output devices, network access devices, etc.
[0107] The processor 40 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0108] In some embodiments, the memory 41 may be an internal storage unit of the terminal device 4, such as a hard disk or memory of the terminal device 4. In other embodiments, the memory 41 may also be an external storage device of the terminal device 4, such as a plug-in hard disk, a smart memory card (Smart Media Card, SMC), a secure digital (Secure Digital, SD) card, a flash card (Flash Card), etc. equipped on the terminal device 4. Further, the memory 41 may also include both an internal storage unit and an external storage device of the terminal device 4. The memory 41 is used to store an operating system, an application program, a boot loader (BootLoader), data, and other programs, such as the program code of the computer program, etc. The memory 41 may also be used to temporarily store data that has been output or is to be output.
[0109] It should be noted that the information interaction, execution process, etc. between the above-mentioned devices / units are based on the same concept as the method embodiment of the present application. Their specific functions and technical effects can be found in the method embodiment part and will not be repeated here.
[0110] The technicians in the relevant field can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example for illustration. In practical applications, the above-mentioned function allocation can be completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above. The functional units and modules in the embodiment can be integrated in a processing unit, or each unit can exist physically separately, or two or more units can be integrated in one unit. The above-mentioned integrated unit can be implemented in the form of hardware or in the form of software functional units. In addition, the specific names of the functional units and modules are only for the convenience of distinguishing each other, and are not used to limit the scope of protection of this application. The specific working process of the units and modules in the above-mentioned system can refer to the corresponding process in the aforementioned method embodiment, which will not be repeated here.
[0111] An embodiment of the present application further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
[0112] If the integrated unit is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the present application implements all or part of the processes in the above-mentioned embodiment method, which can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a computer-readable storage medium, and the computer program can implement the steps of the above-mentioned various method embodiments when executed by the processor. Among them, the computer program includes computer program code, and the computer program code can be in source code form, object code form, executable file or some intermediate form. The computer-readable medium may at least include: any entity or device capable of carrying the computer program code to the terminal device, a recording medium, a computer memory, a read-only memory (ROM), a random access memory (RAM), an electric carrier signal, a telecommunication signal and a software distribution medium. For example, a USB flash drive, a mobile hard disk, a magnetic disk or an optical disk. In some jurisdictions, according to legislation and patent practice, computer-readable media cannot be electric carrier signals and telecommunication signals.
[0113] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described or recorded in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0114] Those of ordinary skill in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0115] In the embodiments provided in the present application, it should be understood that the disclosed devices / terminal equipment and methods can be implemented in other ways. For example, the device / terminal equipment embodiments described above are only schematic. For example, the division of the modules or units is only a logical function division. There may be other division methods in actual implementation, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.
[0116] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0117] The embodiments described above are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application has been described in detail with reference to the aforementioned embodiments, a person skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present application, and should all be included in the protection scope of the present application.
Claims
1. A page testing method, characterized in that: The method comprises: Detecting page elements in a target page and performing trigger operations on the page elements; When a page jump event is triggered, the page address of the page after the jump is obtained, and the page address is stored in the address list; The page after the jump is updated to the target page, and the step of detecting the page elements in the target page is returned to be executed until a page jump event is not triggered after triggering operations are performed on all the page elements in the target page; Based on each of the page addresses in the address list, a page test is performed on the page after the jump.
2. The method according to claim 1, characterized in that The target page is displayed in the visible area, and the page height of the target page is higher than the height of the visible area. The detecting of the page elements in the target page includes: Slide the target page, and after each slide, detect the page elements displayed in the visible area until sliding to the bottom of the target page; Based on the page elements displayed in the visible area detected after each sliding, the page elements in the target page are obtained.
3. The method according to claim 2, characterized in that The method further comprises: After the target page is displayed in the visible area, obtaining the height of the loaded page to obtain a first height; If the first height is greater than the visible area height, it is determined that the page height of the target page is higher than the visible area height.
4. The method according to claim 2, characterized in that The target page is loaded in a lazy loading mode, and the method further includes: After each slide, get the height of the loaded page and get the second height; If the second height is equal to the third height, it is determined that the page has been slid to the bottom of the target page, and the third height is the height of the loaded page obtained before the sliding.
5. The method according to claim 4, characterized in that The method further comprises: Get the height of the loaded page before sliding and the height of the loaded page after sliding; If the height of the page loaded after the sliding is greater than the height of the page loaded before the sliding, it is determined that the page loading mode of the target page is lazy loading.
6. The method according to claim 1, characterized in that The method further comprises: If no page jump event is triggered, re-detecting page elements in the target page; If there is a newly added page element, a trigger operation is performed on the newly added page element, and when the page jump event is triggered, the page address of the page after the jump is obtained, and the page address is stored in the address list.
7. The method according to claim 6, characterized in that The re-detecting the page elements in the target page when the page jump event is not triggered includes: In the case where the page jump event is not triggered, determine whether to trigger the message prompt box display event; If the message prompt box display event is not triggered, the page elements in the target page are re-detected.
8. A page testing device, characterized in that: The device comprises: An element detection module is used to detect page elements in a target page and perform trigger operations on the page elements; An address acquisition module is used to acquire the page address of the page after the jump when a page jump event is triggered, and store the page address in an address list; A page update module, used for updating the page after the jump to the target page, and returning to the step of detecting the page elements in the target page, until no page jump event is triggered after triggering operations are performed on all page elements in the target page; The page testing module is used to perform page testing on the redirected page based on each of the page addresses in the address list.
9. A terminal device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the method according to any one of claims 1 to 7 is implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.