Page jump test method, device, equipment and storage medium
By sending page jump instructions to the terminal and comparing the element and attribute values of the landing page and the standard page, the problems of inaccurate and low-efficiency page jump testing in the existing technology are solved, and a more efficient page jump test is achieved.
Patent Information
- Application Number
- CN202011005440.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-09-22
- Publication Date
- 2024-10-01
- Estimated Expiration
- 2040-09-22
AI Technical Summary
The page jump test results in the existing technology are not accurate enough and inefficient, leading to the problem of user loss.
By sending page jump instructions to the terminal, it jumps to the landing page, and obtains the page identifier and compares it with the standard page, extracts the page elements and attribute values, and determines whether the test has passed or failed.
Improved the accuracy and efficiency of page jump testing, ensuring that jump results meet expectations and reducing user churn.
Smart Images

Figure CN112256562B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of data processing technology, and in particular to a page jump testing method, device, equipment and storage medium. Background Art
[0002] At present, in actual applications, many business scenarios involve page jumps. For example, when opening an application, if a user is interested in a page that plays advertisements, he or she can click to jump to the corresponding detailed page. Another example is the link information received in the chat page of an instant messaging application. Users can click to jump to the corresponding page for browsing. Therefore, if the page jump result is wrong, the user may no longer try to click to browse the relevant page, resulting in user loss. Therefore, it is very important whether the result of the page jump meets expectations.
[0003] In the related art, a test engineer searches for a configuration file and then manually clicks to jump, which results in inaccurate test results and low efficiency. Summary of the invention
[0004] The present disclosure provides a page jump test method, device, equipment and storage medium to at least solve the problem that the test results of page jump tests in related technologies are not accurate enough and the efficiency is low. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of an embodiment of the present disclosure, a page jump testing method is provided, comprising:
[0006] Sending a page jump instruction to the terminal so that the terminal jumps from the current page to the landing page;
[0007] Obtaining a page identifier of the landing page of the terminal;
[0008] When the page identifier is consistent with the target identifier, the landing page is compared with the standard page to generate a test result.
[0009] In one embodiment of the present disclosure, the comparison of the landing page and the standard page to generate a test result includes: when the page identifier is consistent with the target identifier, extracting the page elements of the landing page and the attribute values corresponding to the page elements; when the page elements are consistent with the target elements of the standard page, further detecting whether the attribute values of the page elements are consistent with the attribute values of the target elements; and when the attribute values of the page elements are consistent with the attribute values of the target elements, judging that the test has passed.
[0010] In one embodiment of the present disclosure, the page jump testing method is characterized in that it also includes: when the jump identifier is inconsistent with the target identifier, or when the page element is inconsistent with the target element, or when the attribute value of the page element is inconsistent with the attribute value of the target element, judging that the test has failed.
[0011] In one embodiment of the present disclosure, sending a page jump instruction to the terminal includes: obtaining a jump path of the landing page relative to the current page; generating a debugging instruction according to the jump path, wherein the debugging instruction is used to trigger the terminal to jump from the current page to the landing page.
[0012] In one embodiment of the present disclosure, obtaining the page identifier of the landing page of the terminal includes: obtaining the version number of the operating system of the terminal; generating a query instruction according to the version number of the operating system; and sending the query instruction to the terminal to obtain the page identifier.
[0013] In one embodiment of the present disclosure, extracting the page elements of the landing page, and the attribute values corresponding to the page elements, includes: sending an extraction message to the terminal, wherein the extraction message includes: extraction parameters, so that the terminal extracts the page elements of the landing page, and the attribute values corresponding to the page elements according to the extraction parameters.
[0014] According to a second aspect of an embodiment of the present disclosure, a page jump testing device is provided, including:
[0015] A sending unit, configured to send a page jump instruction to the terminal, so that the terminal jumps from the current page to the landing page;
[0016] An acquisition unit, configured to acquire a page identifier of the landing page of the terminal;
[0017] The processing unit is configured to compare the landing page with the standard page to generate a test result when the page identifier is consistent with the target identifier.
[0018] In one embodiment of the present disclosure, the processing unit includes: an extraction subunit, configured to extract the page elements of the landing page and the attribute values corresponding to the page elements if the page identifier is consistent with the target identifier; a detection subunit, configured to further detect whether the attribute values of the page elements are consistent with the attribute values of the target elements when the page elements are consistent with the target elements of the standard page; and a first processing subunit, configured to determine that the test is passed when the attribute values of the page elements are consistent with the attribute values of the target elements.
[0019] In one embodiment of the present disclosure, the processing unit also includes: a second processing sub-unit, configured to determine that the test fails when the jump identifier is inconsistent with the target identifier, or when the page element is inconsistent with the target element, or when the attribute value of the page element is inconsistent with the attribute value of the target element.
[0020] In one embodiment of the present disclosure, the sending unit is configured to: obtain a jump path of the landing page relative to the current page; and generate a debugging instruction according to the jump path, wherein the debugging instruction is used to trigger the terminal to jump from the current page to the landing page.
[0021] In one embodiment of the present disclosure, the acquisition unit is configured to: acquire a version number of the operating system of the terminal; generate a query instruction according to the version number of the operating system; and send the query instruction to the terminal to acquire the page identifier.
[0022] In one embodiment of the present disclosure, the extraction subunit is configured to: send an extraction message to the terminal, wherein the extraction message includes: extraction parameters, so that the terminal extracts the page elements of the landing page and the attribute values corresponding to the page elements according to the extraction parameters.
[0023] According to a third aspect of an embodiment of the present disclosure, a server is provided, including:
[0024] processor;
[0025] a memory for storing instructions executable by the processor;
[0026] Among them, the processor is configured to execute the instructions to implement the page jump testing method described in the embodiment of the first aspect.
[0027] According to a fourth aspect of an embodiment of the present disclosure, there is provided a storage medium, including:
[0028] When the instructions in the storage medium are executed by the processor of the server, the server is enabled to execute the page jump test method described in the embodiment of the first aspect.
[0029] According to a fifth aspect of an embodiment of the present disclosure, a computer program product is provided. When instructions in the computer program product are executed by a processor, a server is enabled to execute the page jump test method described in the first aspect of the embodiment.
[0030] The technical solution provided by the embodiments of the present disclosure brings at least the following beneficial effects:
[0031] By sending a page jump instruction to the terminal, the terminal jumps from the current page to the landing page; obtaining the page ID of the terminal's landing page; when the page ID is consistent with the target ID, the landing page is compared with the standard page to generate a test result. Thus, the terminal jumps to the landing page according to the page jump instruction, and completes the page jump test based on the data comparison between the landing page and the standard page, thereby improving the accuracy and efficiency of the page jump test.
[0032] It is to be understood that the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the present disclosure. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present disclosure, and together with the description are used to explain the principles of the present disclosure, and do not constitute improper limitations on the present disclosure.
[0034] Figure 1 is an application scenario diagram of a page jump testing method according to an exemplary embodiment;
[0035] Figure 2A is a diagram of a terminal display interface according to an exemplary embodiment;
[0036] Figure 2B is a diagram of a terminal display interface according to an exemplary embodiment;
[0037] Figure 3 is a flow chart of a method for testing page jump according to an exemplary embodiment;
[0038] Figure 4 is a diagram of a terminal display interface according to an exemplary embodiment;
[0039] Figure 5 is a flow chart of another method for testing page jump according to an exemplary embodiment;
[0040] Figure 6 is a diagram of a terminal display interface according to an exemplary embodiment;
[0041] Figure 7 is a flow chart of another method for testing page jump according to an exemplary embodiment;
[0042] Fig. 8A is a diagram of a terminal display interface according to an exemplary embodiment;
[0043] Figure 8B is a diagram of a terminal display interface according to an exemplary embodiment;
[0044] Fig. 9is a block diagram of a test device for page jump according to an exemplary embodiment;
[0045] Fig.10 is a block diagram of a server 200 according to an exemplary embodiment. DETAILED DESCRIPTION
[0046] In order to enable ordinary persons in the art to better understand the technical solutions of the present disclosure, the technical solutions in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the accompanying drawings.
[0047] It should be noted that the terms "first", "second", etc. in the specification and claims of the present disclosure and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present disclosure described herein can be implemented in an order other than those illustrated or described herein. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present disclosure. Instead, they are merely examples of devices and methods consistent with some aspects of the present disclosure as detailed in the appended claims.
[0048] In actual application scenarios, such as clicking on the notification bar of the terminal to jump to the page, or clicking on an advertisement in the application to jump to the page, etc., it is necessary to be able to jump to the expected page. Therefore, it is necessary to test the page jump to improve the accuracy of the jump, thereby improving the user experience and meeting user needs.
[0049] In the related art, a test engineer searches for a configuration file and then manually clicks to jump, which results in inaccurate test results and low efficiency.
[0050] In response to the above problems, the present invention proposes a page jump testing method, which sends a page jump instruction to the terminal to make the terminal jump from the current page to the landing page; obtains the page identifier of the landing page of the terminal; when the page identifier is consistent with the target identifier, compares the landing page with the standard page to generate a test result, thereby improving the accuracy and efficiency of the page jump test and improving the accuracy and efficiency of the push information test.
[0051] The page jump test method disclosed in the present invention can be applied to Figure 1 In the scenario shown, Figure 1 This is an application scenario diagram of a page jump test method according to an exemplary embodiment, and the application scenario may include a terminal 10 and a server 20, wherein the server 20 may be connected to the terminal 10 through a communication interface for communication. The server 20 may send a page jump instruction to the terminal 10, and the terminal 10 jumps from the current page to the landing page.
[0052] It is understandable that in order to further improve the test efficiency, e.g. Figure 1 As shown, the server 20 can be connected to multiple terminals 10 for communication. The server 20 can send page jump instructions to multiple terminals 10 at the same time to test multiple page jumps, and the multiple terminals 10 jump from the current page to the landing page respectively.
[0053] like Figure 2A and Figure 2B As shown, Figure 2A and Figure 2B All of them are terminal display interface diagrams shown according to an exemplary embodiment. Figure 2A In the example of the application shown in FIG. 1 , the server 20 sends a page jump instruction to the terminal 10. Figure 2B Shown from Figure 2A The ad playback interface jumps to the landing page that displays the purchase details of the item, thereby completing the page jump test based on the data comparison between the landing page and the standard page, thereby improving the accuracy and efficiency of the page jump test.
[0054] Specifically, Figure 3 is a flow chart of a method for testing page jump according to an exemplary embodiment. Figure 3 As shown, the page jump test method is used in the server, including the following steps:
[0055] Step 101, sending a page jump instruction to the terminal to make the terminal jump from the current page to the landing page.
[0056] In the embodiments of the present disclosure, there are many ways to send a page jump instruction to the terminal, which can be selected and set according to application needs. Examples are as follows:
[0057] In the first example, a jump path of the landing page relative to the current page is obtained, and a debugging instruction is generated according to the jump path, wherein the debugging instruction is used to trigger the terminal to jump from the current page to the landing page.
[0058] The second example is to write different test scripts for different link addresses, and use an integrated tool, such as Jenkins (a continuous integration tool developed based on Java), to build a project for the test script and trigger the configuration script execution project of the integrated tool to send jump information to the terminal, where the jump information includes the link address, so that the terminal jumps to the landing page corresponding to the link address.
[0059] Step 102, obtaining the page identifier of the landing page of the terminal.
[0060] Step 103, when the page identifier is consistent with the target identifier, the landing page and the standard page are compared to generate a test result.
[0061] In the embodiments of the present disclosure, the terminal may be a terminal with different operating systems (such as Android, Symbian, etc.), and the same operating system may have different version numbers. There are many ways to obtain the page identifier of the landing page of the terminal, and examples are as follows:
[0062] As a possible implementation manner, the version number of the operating system of the terminal is obtained, a query instruction is generated according to the version number of the operating system, and the query instruction is sent to the terminal to obtain the page identifier.
[0063] The query instruction can be obtained by querying a mapping table of the correspondence between the version number of the preset operating system and the query instruction according to the version number of the operating system, and the query instruction is sent to the terminal to obtain the page identifier.
[0064] As another possible implementation manner, a general query instruction for obtaining a page identifier is sent to the terminal to obtain the page identifier.
[0065] In the embodiment of the present disclosure, a page identifier can identify a page, but needs to be combined with page content such as page elements and attribute values corresponding to the page elements to uniquely identify a page.
[0066] In an embodiment of the present disclosure, after obtaining the page identifier of the landing page, the landing page and the standard page are compared to generate a test result. It can be understood that the standard page is the expected page, and the target elements of the standard page and the attribute values of the target elements can be obtained in advance and stored in a relevant database.
[0067] Therefore, there are many ways to compare the landing page with the standard page. As one possible implementation method, the Activity (an application component that provides a screen) of the landing page is obtained as the page identifier. In other words, it is determined whether the screen of the landing page is consistent with the pre-set target identifier (screen). When the page identifier is consistent with the target identifier, the page elements of the landing page and the attribute values corresponding to the page elements are further extracted.
[0068] In an embodiment of the present disclosure, an extraction message can be sent to a terminal by running an automated test script through an integrated tool interface. After receiving the extraction message, the terminal parses the extraction information to obtain extraction parameters, and obtains page elements corresponding to the extraction parameters, as well as attribute values corresponding to the page elements.
[0069] For example, Figure 4 is a diagram of a terminal display interface according to an exemplary embodiment, such as Figure 4 As shown, the page elements of the landing page can be extracted according to the above method, such as Figure 4The text content, text position, picture content and picture position, as well as the attribute values corresponding to the page elements: text content "XXXXXX", text position 1, picture content "Girl" and picture position 2.
[0070] In the embodiment of the present disclosure, the target elements of the standard page and the attribute values corresponding to the target elements are obtained in advance and stored through the relevant plug-ins. After the page elements of the landing page and the attribute values corresponding to the page elements are extracted, it is first detected whether the page elements are consistent with the target elements. If the page elements are consistent with the target elements, it is further detected whether the attribute values of the page elements are consistent with the attribute values of the target elements. If the attribute values of the page elements are consistent with the attribute values of the target elements, it indicates that the page jump is successful, that is, the test passes.
[0071] It should be noted that if the jump identifier is inconsistent with the target identifier, or the page element is inconsistent with the target element, or the attribute value of the page element is inconsistent with the attribute value of the target element, it means that the page jump is inconsistent with the expected page, which means that the page jump fails, that is, the test fails.
[0072] It is understandable that the test results can be pushed to users. There are many ways to push test results to users. They can be displayed on computers, mobile phones and other devices in the format of an application web page framework so that the test results can be seen quickly and clearly, and corresponding test adjustments can be made. They can also be sent to computers, mobile phones and other devices in the form of emails, and specific settings can be made according to application requirements.
[0073] The page jump test method of the disclosed embodiment sends a page jump instruction to the terminal to make the terminal jump from the current page to the landing page; obtains the page identifier of the landing page of the terminal; and when the page identifier is consistent with the target identifier, compares the landing page with the standard page to generate a test result. Thus, the terminal jumps to the landing page according to the page jump instruction, and completes the page jump test according to the data comparison between the landing page and the preset page, thereby improving the accuracy and efficiency of the page jump test.
[0074] Figure 5 is a flow chart showing another method for testing page jump according to an exemplary embodiment. Figure 5 As shown, the following steps are included:
[0075] Step 201, obtain the jump path of the landing page relative to the current page, and generate a debugging instruction according to the jump path, wherein the debugging instruction is used to trigger the terminal to jump from the current page to the landing page.
[0076] In an embodiment of the present disclosure, a corresponding jump path is selected according to a specific test scenario, and a debugging instruction is generated according to the jump path. For example, the debugging instruction is "adb shell am start-a android.intent.action.VIEW-d" which is used to trigger the terminal to jump from the current page to the landing page. Thus, the accuracy of the jump is ensured by generating a debugging instruction according to the jump path to trigger the terminal to jump from the current page to the landing page.
[0077] Step 202: Obtain the version number of the operating system of the terminal, generate a query instruction according to the version number of the operating system, and send the query instruction to the terminal to obtain the page identifier.
[0078] In the disclosed embodiment, different query instructions can be generated according to the version numbers of different operating systems. Taking the Android system as an example, if the version number of the Android system is greater than 8.0, the generated query instruction is "adb shell dumpsysactivity|grep'mResumedActivity'", and the query instruction is sent to the terminal to obtain the page identifier.
[0079] For another example, if the version number of the Android system is less than or equal to 8.0, the generated query command is "adb shell dumpsysactivity|grep'mFocusedActivity'", and the query command is sent to the terminal to obtain the page identifier.
[0080] Therefore, different query instructions are generated based on the version numbers of different operating systems to obtain page identifiers, thereby ensuring the accuracy of page identifier acquisition, thereby ensuring the accuracy of subsequent comparisons, and ultimately achieving the accuracy of page jump testing.
[0081] Step 203, when the page identifier is consistent with the target identifier, extract the page elements of the landing page and the attribute values corresponding to the page elements. When the page elements are consistent with the target elements of the standard page and the attribute values of the page elements are consistent with the attribute values of the target elements, the test is judged to have passed.
[0082] In the embodiment of the present disclosure, a page identifier can identify a page, but a page element and an attribute value corresponding to the page element need to be combined to uniquely identify a page.
[0083] In the disclosed embodiment, after obtaining the page identifier of the landing page, the page identifier is first compared with the target identifier to see if they are consistent. If the current terminal system is an Android system, the Activity (an application component, providing a screen) of the landing page can be obtained as the page identifier. In other words, it is determined whether the screen of the landing page is consistent with the pre-set target identifier (screen). When the page identifier is consistent with the target identifier, the page elements of the landing page and the attribute values corresponding to the page elements are further extracted.
[0084] In the embodiments of the present disclosure, an extraction message can be sent to a terminal by means of an integrated tool running interface automated test script, etc. After receiving the extraction message, the terminal parses the extraction information to obtain extraction parameters, and obtains page elements corresponding to the extraction parameters, as well as attribute values corresponding to the page elements, thereby improving the extraction efficiency of page elements and attribute values corresponding to the page elements.
[0085] In the disclosed embodiment, the extraction parameters may include position parameters, text parameters, image parameters, etc. If the parameters can be extracted, the corresponding attribute values are fed back; if not, empty is returned, etc. The extraction parameters are set according to the application scenario.
[0086] For example, Figure 6 is a diagram of a terminal display interface according to an exemplary embodiment, such as Figure 6 As shown, the page elements of the landing page can be extracted according to the above method, such as Figure 6 The text content, text position, picture content and picture position in the text content, text position, picture content and picture position, as well as the attribute values corresponding to the page elements are text content "YYYYYY", text position 11, picture content "milk" and picture position 22. The target elements corresponding to the target identifier are pre-set as text content, text position, picture content and picture position, as well as the attribute values corresponding to the target elements are text content "YYYYYY", text position 11, picture content "milk" and picture position 22, then the test is judged to have passed.
[0087] Therefore, by comparing the page elements and the attribute values corresponding to the page elements, it is determined whether the page jump meets the expected requirements, thereby further improving the accuracy and efficiency of the page jump.
[0088] Step 204: when the jump identifier is inconsistent with the target identifier, or when the page element is inconsistent with the target element, or when the attribute value of the page element is inconsistent with the attribute value of the target element, it is determined that the test has not passed.
[0089] It is also understandable that continuing Figure 6For example, the target elements corresponding to the target identifier are pre-set as text content and text position, that is, the page elements are inconsistent with the target elements, and the test is judged to have failed; or, the target elements corresponding to the target identifier are pre-set as text content, text position, picture content and picture position, and the attribute values corresponding to the target elements are text content "ZZZZZZ", text position 11, picture content "milk" and picture position 22, that is, the attribute values of the page elements are inconsistent with the attribute values of the target elements, and the test is judged to have failed.
[0090] Therefore, directly judging that the test has failed when the jump identifier is inconsistent with the target identifier can avoid subsequent operations and improve test efficiency. Further comparison of the page elements and the target elements shows that the test has failed, or the attribute values of the page elements and the target elements show that the test has failed, which can ensure the accuracy of the test.
[0091] Step 205, when the page identifier is consistent with the pop-up window page identifier, a pop-up window closing message is sent to the terminal, wherein the pop-up window closing message includes the control operation permission, so that after the terminal obtains the control operation permission, it controls the pop-up window page to close and sends a page jump instruction to the terminal again.
[0092] In the disclosed embodiment, it can also be understood that the page identifier is consistent with the pop-up page identifier, that is, the landing page is a pop-up page. Therefore, a pop-up window closing message is sent to the terminal so that the terminal parses the pop-up window closing message to obtain the control operation permission, controls the pop-up window page to close, and sends a page jump instruction to the terminal again, thereby further improving the accuracy of the page jump test.
[0093] The page jump test method of the embodiment of the present invention obtains the jump path of the landing page relative to the current page, generates a debugging instruction according to the jump path, wherein the debugging instruction is used to trigger the terminal to jump from the current page to the landing page, obtains the version number of the terminal's operating system, generates a query instruction according to the version number of the operating system, sends the query instruction to the terminal to obtain the page identifier, if the page identifier is consistent with the target identifier, extracts the page elements of the landing page and the attribute values corresponding to the page elements, if the page elements are consistent with the target elements, and the attribute values of the page elements are consistent with the attribute values of the target elements, then the test is judged to have passed, if the jump identifier is inconsistent with the target identifier, or the page elements are inconsistent with the target elements, or the attribute values of the page elements are inconsistent with the attribute values of the target elements, then the test is judged to have failed, if the page identifier is consistent with the pop-up page identifier, then a pop-up window closing message is sent to the terminal, wherein the pop-up window closing message includes the control operation permission, so that after the terminal obtains the control operation permission, it controls the pop-up page to close, and sends the page jump instruction to the terminal again. Thus, the terminal jumps to the landing page according to the page jump instruction, and completes the page jump test according to the data comparison between the landing page and the preset page, thereby improving the accuracy and efficiency of the page jump test.
[0094] In order to make the specific process of the above page jump test more clear to those skilled in the art, Figure 7 8 is described in detail by taking the operating system of the terminal as the Android system and the current page as the notification content interface of the notification bar as an example.
[0095] Figure 7 is a flow chart of another method for testing page jump according to an exemplary embodiment. Figure 6 As shown, the following steps are included:
[0096] Step 301: Send a page jump instruction to the terminal.
[0097] In the embodiment of the present disclosure, the current page is as follows Fig. 8A The notification content of the notification bar shown in the figure selects the jump path of the notification content of the notification bar, and generates a debugging instruction according to the jump path. For example, the generated debugging instruction is "adb shell amstart-a android.intent.action.VIEW-d" which is used to trigger the terminal to jump from the notification content of the notification bar to the following: Figure 8B The live video display interface shown.
[0098] Step 302, obtain the version number of the terminal's operating system. If the version number of the operating system is greater than the preset version number, send a first query instruction to the terminal to obtain the page identifier. If the version number of the operating system is less than or equal to the preset version number, send a second query instruction to the terminal to obtain the page identifier.
[0099] In the disclosed embodiment, the operating system of the terminal is an Android system. If the version number of the Android system is greater than 8.0, the query instruction generated is "adb shell dumpsys activity|grep'mResumedActivity'", and the query instruction is sent to the terminal to obtain the page identifier; if the version number of the Android system is less than or equal to 8.0, the query instruction generated is "adb shell dumpsys activity|grep'mFocusedActivity'", and the query instruction is sent to the terminal to obtain the page identifier.
[0100] Step 303: Check whether the page identifier is consistent with the target identifier.
[0101] Step 304, when the page identifier is consistent with the target identifier, extract the page elements of the landing page and the attribute values corresponding to the page elements.
[0102] Step 305 , detecting whether the page element is consistent with the target element of the standard page, and whether the attribute value of the page element is consistent with the attribute value of the target element.
[0103] Step 306: When the page element is consistent with the target element, and the attribute value of the page element is consistent with the attribute value of the target element, it is determined that the test has passed.
[0104] Step 307: when the jump identifier is inconsistent with the target identifier, or when the page element is inconsistent with the target element, or when the attribute value of the page element is inconsistent with the attribute value of the target element, it is determined that the test has not passed.
[0105] In the embodiments of the present disclosure, Figure 8B The video live broadcast display interface shown in the figure obtains the page identifier of the video live broadcast display interface, for example, the Activity (an application component, providing a screen) of the landing page is Activity2.0, which is consistent with the preset target identifier Activity2.0, and further extracts the page elements of the video live broadcast display interface, including text content, text position, picture content and picture position, and the attribute values corresponding to the page elements, including text content "BBBBBB", text position 33, picture content "person" and "watch" and picture positions 44 and 55, which are consistent with the attribute values of the preset target elements, and then the test is judged to be passed.
[0106] It can also be understood that if the page identifier of the landing page is Activity2.0, which is inconsistent with the preset target identifier Activity1.0, or the target element corresponding to the target identifier is pre-set as text content and text position, that is, the page element is inconsistent with the target element, then the test is judged to have failed; or, if the target element corresponding to the target identifier is pre-set as text content, text position, picture content and picture position, and the attribute values corresponding to the target element are text content "BBBBBB", text position 11, picture content "watch" and picture position 44, that is, the attribute value of the page element is not completely consistent with the attribute value of the target element, then the test is judged to have failed.
[0107] Thus, the terminal jumps to the landing page according to the page jump instruction, and completes the page jump test according to the data comparison between the landing page and the preset page, thereby improving the accuracy and efficiency of the page jump test.
[0108] Fig. 9 1 is a block diagram of a test device for page jump according to an exemplary embodiment. Fig. 9 The device page jump test device 400 includes a sending unit 401, an acquiring unit 402 and a processing unit 403.
[0109] The sending unit 401 is configured to send a page jump instruction to the terminal so that the terminal jumps from the current page to the landing page.
[0110] In the embodiments of the present disclosure, there are many ways to send a page jump instruction to the terminal, which can be selected and set according to application needs. Examples are as follows:
[0111] In a first example, the sending unit 401 is configured to obtain a jump path of a landing page relative to a current page, and generate a debugging instruction according to the jump path, wherein the debugging instruction is used to trigger the terminal to jump from the current page to the landing page.
[0112] In the second example, the sending unit 401 is configured to write different test scripts for different link addresses, and use an integrated tool, such as Jenkins (a continuous integration tool developed based on Java), to build a project for the test script and trigger the configuration script execution project of the integrated tool to send jump information to the terminal, wherein the jump information includes the link address, so that the terminal jumps to the landing page corresponding to the link address.
[0113] The acquisition unit 402 is configured to acquire a page identifier of a landing page of the terminal.
[0114] The processing unit 403 is configured to compare the landing page with the standard page to generate a test result when the page identifier is consistent with the target identifier.
[0115] In the embodiments of the present disclosure, the terminal may be a terminal with different operating systems (such as Android, Symbian, etc.), and the same operating system may have different version numbers. There are many ways to obtain the page identifier of the landing page of the terminal, and examples are as follows:
[0116] As a possible implementation, the acquisition unit 402 is configured to acquire a version number of an operating system of the terminal, generate a query instruction according to the version number of the operating system, and send the query instruction to the terminal to acquire the page identifier.
[0117] The query instruction can be obtained by querying a mapping table of the correspondence between the version number of the preset operating system and the query instruction according to the version number of the operating system, and the query instruction is sent to the terminal to obtain the page identifier.
[0118] As another possible implementation, the acquisition unit 402 is configured to acquire a page identifier general query instruction, and send the page identifier general query instruction to the terminal to acquire the page identifier.
[0119] In the disclosed embodiment, different query instructions can be generated according to the version numbers of different operating systems. Taking the Android system as an example, if the version number of the Android system is greater than 8.0, the generated query instruction is "adb shell dumpsysactivity|grep'mResumedActivity'", and the query instruction is sent to the terminal to obtain the page identifier.
[0120] For another example, if the version number of the Android system is less than or equal to 8.0, the generated query command is "adb shell dumpsysactivity|grep'mFocusedActivity'", and the query command is sent to the terminal to obtain the page identifier.
[0121] In the embodiment of the present disclosure, a page identifier can identify a page, but a page element and an attribute value corresponding to the page element need to be combined to uniquely identify a page.
[0122] In the disclosed embodiment, after obtaining the page identifier of the landing page, the page identifier is first compared with the target identifier to see if they are consistent. If the current terminal system is an Android system, the Activity (an application component, providing a screen) of the landing page can be obtained as the page identifier. In other words, it is determined whether the screen of the landing page is consistent with the pre-set target identifier (screen). When the page identifier is consistent with the target identifier, the page elements of the landing page and the attribute values corresponding to the page elements are further extracted.
[0123] In an embodiment of the present disclosure, the extraction sub-unit is configured to send an extraction message to the terminal by means of an integrated tool running interface automated test script, etc. After receiving the extraction message, the terminal parses the extraction information to obtain extraction parameters, and obtains the page elements corresponding to the extraction parameters, as well as the attribute values corresponding to the page elements.
[0124] In the disclosed embodiment, after obtaining the page identifier of the landing page, the page identifier is first compared with the target identifier to see if they are consistent. If the current terminal system is an Android system, the Activity (an application component, providing a screen) of the landing page can be obtained as the page identifier. In other words, it is determined whether the screen of the landing page is consistent with the pre-set target identifier (screen). When the page identifier is consistent with the target identifier, the page elements of the landing page and the attribute values corresponding to the page elements are further extracted.
[0125] In an embodiment of the present disclosure, the extraction sub-unit is configured to send an extraction message to the terminal by means of an integrated tool running interface automated test script, etc. After receiving the extraction message, the terminal parses the extraction information to obtain extraction parameters, and obtains the page elements corresponding to the extraction parameters, as well as the attribute values corresponding to the page elements.
[0126] For example, Figure 4 is a diagram of a terminal display interface according to an exemplary embodiment, such as Figure 4 As shown, the page elements of the landing page can be extracted according to the above method, such as Figure 4 The text content, text position, picture content and picture position, as well as the attribute values corresponding to the page elements: text content "XXXXXX", text position 1, picture content "Girl" and picture position 2.
[0127] The detection subunit is configured to further detect whether the attribute value of the page element is consistent with the attribute value of the target element if the page element is consistent with the target element.
[0128] The first processing subunit is configured to determine that the test passes if the attribute value of the page element is consistent with the attribute value of the target element.
[0129] In the embodiment of the present disclosure, the target element of the jump page and the attribute value corresponding to the target element are obtained in advance and stored through the relevant plug-in. When the page element of the landing page and the attribute value corresponding to the page element are extracted, it is first detected whether the page element is consistent with the target element. If the page element is consistent with the target element, it is further detected whether the attribute value of the page element is consistent with the attribute value of the target element. If the attribute value of the page element is consistent with the attribute value of the target element, it indicates that the page jump is successful, that is, the test passes.
[0130] As a possible implementation method, the page jump testing device also includes: the second processing sub-unit is configured to, if the jump identifier is inconsistent with the target identifier, or the page element is inconsistent with the target element, or the attribute value of the page element is inconsistent with the attribute value of the target element, it indicates that the page jump is inconsistent with the expected page, that is, the test fails.
[0131] As a possible implementation method, the page jump testing device also includes: a third processing sub-unit, which is configured to send a pop-up window closing message to the terminal if the page identifier is consistent with the pop-up window page identifier, wherein the pop-up window closing message includes the control operation permission, so that after the terminal obtains the control operation permission, it controls the pop-up window page to close and re-sends the page jump instruction to the terminal.
[0132] In the disclosed embodiment, it can also be understood that the page identifier is consistent with the pop-up page identifier, that is, the landing page is a pop-up page. Therefore, a pop-up window closing message is sent to the terminal so that the terminal parses the pop-up window closing message to obtain the control operation permission, controls the pop-up window page to close, and sends a page jump instruction to the terminal again, thereby further improving the accuracy of the page jump test.
[0133] The page jump test device of the disclosed embodiment sends a page jump instruction to the terminal to make the terminal jump from the current page to the landing page; obtains the page identifier of the landing page of the terminal; and when the page identifier is consistent with the target identifier, compares the landing page with the standard page to generate a test result. Thus, the terminal jumps to the landing page according to the page jump instruction, and completes the page jump test according to the data comparison between the landing page and the preset page, thereby improving the accuracy and efficiency of the page jump test.
[0134] Fig.10 is a block diagram of a server 200 according to an exemplary embodiment.
[0135] like Fig.10 As shown, the server 200 includes:
[0136] The memory 210 and the processor 220, a bus 230 connecting different components (including the memory 210 and the processor 220), the memory 210 stores a computer program, and when the processor 220 executes the program, the page jump test method described in the embodiment of the present disclosure is implemented.
[0137] Bus 230 represents one or more of several types of bus structures, including a memory bus or memory controller, a peripheral bus, an accelerated graphics port, a processor or a local bus using any of a variety of bus architectures. For example, these architectures include but are not limited to Industry Standard Architecture (ISA) bus, Micro Channel Architecture (MAC) bus, Enhanced ISA bus, Video Electronics Standards Association (VESA) local bus and Peripheral Component Interconnect (PCI) bus.
[0138] The server 200 typically includes a variety of electronic device readable media. These media can be any available media that can be accessed by the server 200, including volatile and non-volatile media, removable and non-removable media.
[0139] The memory 210 may also include computer system readable media in the form of volatile memory, such as random access memory (RAM) 240 and / or cache memory 250. The server 200 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, the storage system 260 may be used to read and write non-removable, non-volatile magnetic media ( Fig.10 not shown, usually called a "hard drive"). Although Figure 6 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk"), and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, a DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to the bus 230 via one or more data medium interfaces. The memory 210 may include at least one program product having a set (e.g., at least one) of program modules that are configured to perform the functions of the various embodiments of the present disclosure.
[0140] A program / utility 280 having a set (at least one) of program modules 270 may be stored, for example, in the memory 210, such program modules 270 including, but not limited to, an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment. The program modules 270 generally perform the functions and / or methods of the embodiments described in the present disclosure.
[0141] The server 200 may also communicate with one or more external devices 290 (e.g., keyboards, pointing devices, displays 291, etc.), may communicate with one or more devices that enable users to interact with the server 200, and / or may communicate with any device that enables the server 200 to communicate with one or more other computing devices (e.g., network cards, modems, etc.). Such communication may be performed via an input / output (I / O) interface 292. In addition, the server 200 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 293. As shown, the network adapter 293 communicates with other modules of the server 200 via a bus 230. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the server 200, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0142] The processor 220 executes various functional applications and data processing by running the programs stored in the memory 210 .
[0143] It should be noted that the implementation process and technical principles of the server of this embodiment refer to the aforementioned explanation of the test method for page jump of the embodiment of the present disclosure, which will not be repeated here.
[0144] The server provided by the embodiment of the present disclosure can execute the test method of page jump as described above, by sending a page jump instruction to the terminal to make the terminal jump from the current page to the landing page; obtaining the page identifier of the landing page of the terminal; when the page identifier is consistent with the target identifier, the landing page and the standard page are compared to generate a test result. Thus, the terminal jumps to the landing page according to the page jump instruction, and completes the page jump test according to the data comparison between the landing page and the preset page, thereby improving the accuracy and efficiency of the page jump test.
[0145] In order to implement the above embodiments, the present disclosure also proposes a storage medium.
[0146] When the instructions in the storage medium are executed by the processor of the server, the server can execute the page jump test method as described above.
[0147] In order to implement the above embodiments, the present disclosure further provides a computer program product. When the computer program is executed by a processor of a server, the server can execute the page jump test method as described above.
[0148] Those skilled in the art will readily appreciate other embodiments of the present disclosure after considering the specification and practicing the invention disclosed herein. The present disclosure is intended to cover any variations, uses or adaptations of the present disclosure that follow the general principles of the present disclosure and include common knowledge or customary techniques in the art that are not disclosed in the present disclosure. The description and examples are to be considered exemplary only, and the true scope and spirit of the present disclosure are indicated by the following claims.
[0149] It should be understood that the present disclosure is not limited to the exact structures that have been 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 present disclosure is limited only by the appended claims.
Claims
1. A page jump test method, It is characterized in that include: Sending a page jump instruction to the terminal so that the terminal jumps from the current page to the landing page; Obtaining a page identifier of the landing page of the terminal; When the page identifier is consistent with the target identifier, the landing page is compared with the standard page to generate a test result; Wherein, the comparison of the landing page with the standard page to generate the test result includes: extracting the page elements of the landing page and the attribute values corresponding to the page elements, and when the page elements are consistent with the target elements of the standard page, further detecting whether the attribute values of the page elements are consistent with the attribute values of the target elements, and when the attribute values of the page elements are consistent with the attribute values of the target elements, judging that the test is passed, the page identifier can identify a page, and the page identifier uniquely identifies a page by combining the page elements and the attribute values corresponding to the page elements; The obtaining of the page identifier of the landing page of the terminal includes: obtaining the version number of the operating system of the terminal, if the version number of the operating system is greater than a preset version number, sending a first query instruction to the terminal to obtain the page identifier, if the version number of the operating system is less than or equal to the preset version number, sending a second query instruction to the terminal to obtain the page identifier.
2. The page jump testing method according to claim 1, It is characterized in that Also includes: When the jump identifier is inconsistent with the target identifier, or when the page element is inconsistent with the target element, or when the attribute value of the page element is inconsistent with the attribute value of the target element, it is determined that the test has not passed.
3. The page jump testing method as claimed in claim 1, It is characterized in that The sending of a page jump instruction to the terminal includes: Obtaining the jump path of the landing page relative to the current page; A debugging instruction is generated according to the jump path, wherein the debugging instruction is used to trigger the terminal to jump from the current page to the landing page.
4. The page jump testing method as claimed in claim 1, It is characterized in that The extracting the page elements of the landing page and the attribute values corresponding to the page elements includes: An extraction message is sent to the terminal, wherein the extraction message includes: extraction parameters, so that the terminal extracts page elements of the landing page and attribute values corresponding to the page elements according to the extraction parameters.
5. A test device for page jump, It is characterized in that include: A sending unit, configured to send a page jump instruction to the terminal, so that the terminal jumps from the current page to the landing page; An acquisition unit, configured to acquire a page identifier of the landing page of the terminal; A processing unit, configured to compare the landing page with a standard page to generate a test result when the page identifier is consistent with the target identifier; Wherein, the comparison of the landing page with the standard page to generate the test result includes: extracting the page elements of the landing page and the attribute values corresponding to the page elements, and when the page elements are consistent with the target elements of the standard page, further detecting whether the attribute values of the page elements are consistent with the attribute values of the target elements, and when the attribute values of the page elements are consistent with the attribute values of the target elements, judging that the test is passed, the page identifier can identify a page, and the page identifier uniquely identifies a page by combining the page elements and the attribute values corresponding to the page elements; The obtaining of the page identifier of the landing page of the terminal includes: obtaining the version number of the operating system of the terminal, if the version number of the operating system is greater than a preset version number, sending a first query instruction to the terminal to obtain the page identifier, if the version number of the operating system is less than or equal to the preset version number, sending a second query instruction to the terminal to obtain the page identifier.
6. The page jump testing device as claimed in claim 5, It is characterized in that The processing unit comprises: an extraction subunit, configured to extract page elements of the landing page and attribute values corresponding to the page elements when the page identifier is consistent with the target identifier; a detection subunit configured to further detect whether an attribute value of the page element is consistent with an attribute value of the target element when the page element is consistent with the target element of the standard page; and The first processing subunit is configured to determine that the test is passed when the attribute value of the page element is consistent with the attribute value of the target element.
7. The page jump testing device as claimed in claim 5, It is characterized in that The processing unit further includes: The second processing sub-unit is configured to determine that the test fails when the jump identifier is inconsistent with the target identifier, or when the page element is inconsistent with the target element, or when the attribute value of the page element is inconsistent with the attribute value of the target element.
8. The page jump testing device as claimed in claim 5, It is characterized in that The sending unit is configured as follows: Obtaining the jump path of the landing page relative to the current page; A debugging instruction is generated according to the jump path, wherein the debugging instruction is used to trigger the terminal to jump from the current page to the landing page.
9. The page jump testing device as claimed in claim 5, It is characterized in that The acquisition unit is configured as follows: Obtaining the version number of the operating system of the terminal; generating a query instruction according to the version number of the operating system; and The query instruction is sent to the terminal to obtain the page identifier.
10. The page jump testing device according to claim 6, It is characterized in that The extraction subunit is configured as follows: An extraction message is sent to the terminal, wherein the extraction message includes: extraction parameters, so that the terminal extracts page elements of the landing page and attribute values corresponding to the page elements according to the extraction parameters.
11. A server, It is characterized in that include: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instruction to implement the page jump test method according to any one of claims 1 to 4.
12. A storage medium, when instructions in the storage medium are executed by a processor of a server, enables the server to execute the page jump test method according to any one of claims 1 to 4.
