A page testing method, device, equipment and storage medium
Through the correspondence between server storage controls and test cases, the test cases on the page are automatically executed, which solves the problems of low testing efficiency and insufficient integrity in the existing technology, and realizes efficient and comprehensive control testing.
Patent Information
- Application Number
- CN202111460858.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2024-12-31
- Estimated Expiration
- 2041-12-02
AI Technical Summary
In the prior art, developers need to write test cases for each page, resulting in inefficient testing and possible missing controls, which cannot guarantee the integrity of the test.
The server stores the correspondence between multiple controls and multiple test cases, automatically traverses the controls in the page and executes corresponding test cases, avoiding writing test cases on the page, and ensuring that each control executes corresponding test cases.
Improves the efficiency of the test page controls, guarantees the integrity of the test, reduces the time cost of writing test cases, and allows the same controls in different pages to execute the same test case.
Smart Images

Figure CN114356748B_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network technology, and in particular to a page testing method, device, equipment and storage medium. Background Art
[0002] With the development of network technology, various applications (APPs) can be installed in terminal devices (such as mobile phones, laptops, smart watches, etc.) to achieve multiple functions. In order to ensure that the APP can run normally, it is necessary to test the APP controls during the development process.
[0003] Currently, developers usually write test cases to test controls in an APP, and then use the test cases to test controls in the page. However, when developers write test cases, they need to write a test case for each page in the APP, and each page may include a large number of controls, which results in a long time spent on writing test cases and low efficiency in testing pages. Summary of the invention
[0004] The present disclosure provides a page testing method, device, equipment and storage medium, which can improve the efficiency of testing pages. The technical solution of the present disclosure is as follows:
[0005] According to a first aspect of the present disclosure, a page testing method is provided, which is applied to a server, wherein the server stores a correspondence between a plurality of controls and a plurality of test cases, wherein the test cases are used to trigger the controls, and the plurality of controls are all controls in the application to be tested. The method comprises:
[0006] A first page is obtained, where the first page is any page among all pages of the application to be tested. All controls of the first page are obtained. A test case is executed for each control among all controls of the first page according to a correspondence between multiple controls and multiple test cases and all controls of the first page.
[0007] Optionally, the method for executing a test case on each of all controls on the first page according to the correspondence between multiple controls and multiple test cases and all controls on the first page includes: for each control, executing a test case on each of all controls on the first page according to a first operation. The first operation includes: identifying a target control, where the target control is any control among all controls on the first page. Determining a target test case according to the correspondence between multiple controls and multiple test cases and the target control, where the target test case is a test case among multiple test cases for testing the target control. Execute the target test case on the target control.
[0008] Optionally, all controls on the first page include a page jump control, and the page jump control is used to trigger a jump to the second page. The above method of executing a test case on each control in all controls on the first page includes: executing a test case on the page jump control. The displayed page jumps from the first page to the second page. If there is a control in all controls on the first page that has not executed a test case, a first event is executed, and the first event is used to indicate a jump to the first page. Test cases are executed on other controls in the first page except the page jump control.
[0009] Optionally, the page testing method further includes: if all controls on the first page have executed the test case, then all controls on the second page are acquired, and the test case is executed for each control in all controls on the second page.
[0010] Optionally, the server further includes a tested page set, in which pages in which all controls have been tested are stored. The page testing method further includes: if all controls of the first page have executed the test case, storing the first page in the tested page set.
[0011] Optionally, the page testing method further includes: determining whether all controls in the second page have executed the test case based on the tested page set and the second page. If there are controls in all controls in the second page that have not executed the test case, and all controls in the first page have executed the test case, then obtaining all controls in the second page.
[0012] Optionally, the server stores all pages of the application to be tested. The page testing method further includes: if the set of tested pages includes all pages of the application to be tested, executing a second event, the second event being used to instruct to stop testing the application to be tested.
[0013] According to a second aspect of the present disclosure, a page testing device is provided, which is applied to a server, wherein the server stores a correspondence between a plurality of controls and a plurality of test cases, wherein the test cases are used to trigger the controls, and the plurality of controls are all controls in the application to be tested. The page testing device includes: an acquisition unit and a processing unit.
[0014] The acquisition unit is configured to execute acquisition of a first page, where the first page is any page of all pages of the application to be tested. The acquisition unit is also configured to execute acquisition of all controls of the first page. The processing unit is configured to execute a test case for each control of all controls of the first page according to the correspondence between the multiple controls and the multiple test cases and all controls of the first page.
[0015] Optionally, the processing unit is further configured to perform, identify a target control, the target control being any control among all controls on the first page, determine a target test case according to a correspondence between the multiple controls and the multiple test cases and the target control, the target test case being a test case among the multiple test cases for testing the target control, and execute the target test case on the target control.
[0016] Optionally, all controls of the first page include a page jump control, and the page jump control is used to trigger jumping to the second page. The testing device of the page also includes a display unit. The processing unit is further configured to execute a test case for the page jump control. The display unit is configured to execute the displayed page to jump from the first page to the second page. The processing unit is further configured to execute a first event if there is a control in all controls of the first page that has not executed the test case, and the first event is used to indicate jumping to the first page. The processing unit is further configured to execute test cases for other controls in the first page except the page jump control.
[0017] Optionally, the processing unit is further configured to execute if all controls on the first page have executed the test case, then obtain all controls on the second page. The processing unit is further configured to execute the test case for each control in all controls on the second page.
[0018] Optionally, the server further includes a tested page set, in which pages in which all controls have completed testing are stored. The processing unit is further configured to execute if all controls on the first page have executed the test case, then store the first page in the tested page set.
[0019] Optionally, the processing unit is further configured to determine whether all controls in the second page have executed the test case based on the tested page set and the second page. The processing unit is further configured to obtain all controls in the second page if there are controls in all controls in the second page that have not executed the test case and all controls in the first page have executed the test case.
[0020] According to a third aspect of the present disclosure, a server is provided, the server comprising:
[0021] A processor. A memory for storing processor executable instructions. The processor is configured to execute instructions to implement any one of the optional page testing methods in the first aspect above.
[0022] According to a fourth aspect of the present disclosure, a computer-readable storage medium is provided, on which instructions are stored. When the instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute any one of the optional page testing methods in the above-mentioned first aspect.
[0023] According to a fifth aspect of the present disclosure, there is provided a computer program product, comprising instructions, which, when executed on a computer, enable the computer to execute any one of the optional page testing methods in the first aspect.
[0024] According to a sixth aspect of the present disclosure, the present disclosure provides a chip, the chip including a processor and a communication interface, the communication interface and the processor are coupled, and the processor is used to run a computer program or instructions to implement a page testing method as described in the first aspect and any possible implementation of the first aspect.
[0025] The technical solution provided by the present disclosure brings at least the following beneficial effects: obtaining a first page, the first page being any page among all the pages of the application to be tested. Obtaining all the controls of the first page. Since the server stores the correspondence between multiple controls and multiple test cases, the test case is used to trigger the control, and the multiple controls are all the controls in the application to be tested, the test case can be executed for each of all the controls of the first page according to the correspondence between the multiple controls and the multiple test cases and all the controls of the first page. In this way, in the process of testing the page controls, the controls in the page can be automatically traversed, and the corresponding test case can be executed for each control. Compared with conventional technologies, there is no need to write test cases for the page, which not only ensures the integrity of the test, but also the same controls in different pages can execute the same test case, which can reduce the number of test cases, reduce the time spent on writing test cases for controls, and improve test efficiency.
[0026] 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
[0027] 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.
[0028] Figure 1 is a schematic diagram of the structure of a server according to an exemplary embodiment;
[0029] Figure 2 is a flow chart of a page testing method according to an exemplary embodiment;
[0030] Figure 3 is a flow chart of another page testing method according to an exemplary embodiment;
[0031] Figure 4 is a flow chart of another page testing method according to an exemplary embodiment;
[0032] Figure 5 is a structural schematic diagram of a page testing device according to an exemplary embodiment;
[0033] Figure 6 The figure is a schematic structural diagram of another page testing device according to an exemplary embodiment. DETAILED DESCRIPTION
[0034] 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.
[0035] 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.
[0036] It should be noted that the user information involved in this disclosure (including but not limited to user device information, user personal information, etc.) is all information authorized by the user or fully authorized by all parties.
[0037] First, the application scenarios of the embodiments of the present disclosure are introduced.
[0038] The page testing method of the disclosed embodiment is applied to the page of the test APP. In conventional technology, the control of the test APP is usually written by the developer to write a test case, and the control in the page is tested through the test case. However, in the process of the developer writing the test case, it is necessary to write a test case for each page in the APP. If there are many pages in the APP, a large number of test cases need to be written to test the page, resulting in a long time to write the test case and low efficiency of the test page. In addition, each page may include a large number of controls, and the developer may miss the control when writing the test case of the page, and the integrity of the test cannot be guaranteed.
[0039] In order to solve the above problems, the embodiment of the present disclosure provides a page testing method, which can obtain a page in the application to be tested and obtain all the controls in the page. After that, the test case is executed for each control in all the controls. In this way, in the process of testing the page controls, the controls in the page can be automatically traversed and the test case can be executed for each control. Compared with conventional technologies, there is no need to write test cases for the page, which not only improves the test efficiency, but also avoids missing a control in the page during the page testing process, thereby ensuring the integrity of the test.
[0040] Figure 1 The present invention provides a schematic diagram of a server structure for applying the method provided by the present invention. The server 10 includes a processor 101 and a memory 102.
[0041] The processor 101 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 101 may include an application processor (AP), a modem processor, a graphics processor (GPU), an image signal processor (ISP), a controller, a memory, a video codec, a digital signal processor (DSP), a baseband processor, and / or a neural-network processing unit (NPU), etc. Different processing units may be independent devices or integrated into one or more processors.
[0042] The memory 102 may include one or more computer-readable storage media, which may be non-transitory. The memory 102 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In some embodiments, the non-transitory computer-readable storage medium in the memory 102 is used to store at least one instruction, which is used to be executed by the processor 101 to implement the group communication method provided by the method embodiment of the present disclosure.
[0043] In some embodiments, the server 10 may further optionally include: a peripheral device interface 103 and at least one peripheral device. The processor 101, the memory 102 and the peripheral device interface 103 may be connected via a bus or a signal line. Each peripheral device may be connected to the peripheral device interface 103 via a bus, a signal line or a circuit board. Specifically, the peripheral device includes: at least one of a radio frequency circuit 104, a display screen 105, a camera assembly 106, an audio circuit 107, a positioning assembly 108 and a power supply 109.
[0044] The peripheral device interface 103 may be used to connect at least one peripheral device related to I / O (Input / Output) to the processor 101 and the memory 102. In some embodiments, the processor 101, the memory 102, and the peripheral device interface 103 are integrated on the same chip or circuit board; in some other embodiments, any one or two of the processor 101, the memory 102, and the peripheral device interface 103 may be implemented on a separate chip or circuit board, which is not limited in this embodiment.
[0045] The radio frequency circuit 104 is used to receive and transmit RF (Radio Frequency) signals, also known as electromagnetic signals. The radio frequency circuit 104 communicates with the communication network and other communication devices through electromagnetic signals. The radio frequency circuit 104 converts electrical signals into electromagnetic signals for transmission, or converts received electromagnetic signals into electrical signals. Optionally, the radio frequency circuit 104 includes: an antenna system, an RF transceiver, one or more amplifiers, a tuner, an oscillator, a digital signal processor, a codec chipset, a user identity module card, and the like. The radio frequency circuit 104 can communicate with other servers through at least one wireless communication protocol. The wireless communication protocol includes, but is not limited to: a metropolitan area network, various generations of mobile communication networks (2G, 3G, 4G and 5G), a wireless local area network and / or a Wi-Fi (Wireless Fidelity) network. In some embodiments, the radio frequency circuit 104 may also include circuits related to NFC (Near Field Communication), which is not limited in the present disclosure.
[0046] The display screen 105 is used to display the UI (User Interface). The UI may include graphics, text, icons, videos and any combination thereof. When the display screen 105 is a touch display screen, the display screen 105 also has the ability to collect touch signals on the surface or above the surface of the display screen 105. The touch signal can be input to the processor 101 as a control signal for processing. At this time, the display screen 105 can also be used to provide virtual buttons and / or virtual keyboards, also known as soft buttons and / or soft keyboards. In some embodiments, the display screen 105 can be one, setting the front panel of the server 10; the display screen 105 can be made of materials such as LCD (Liquid Crystal Display), OLED (Organic Light-Emitting Diode) and the like.
[0047] The camera assembly 106 is used to collect images or videos. Optionally, the camera assembly 106 includes a front camera and a rear camera. Usually, the front camera is set on the front panel of the server, and the rear camera is set on the back of the server. The audio circuit 107 may include a microphone and a speaker. The microphone is used to collect sound waves from the user and the environment, and convert the sound waves into electrical signals and input them into the processor 101 for processing, or input them into the radio frequency circuit 104 to achieve voice communication. For the purpose of stereo acquisition or noise reduction, there can be multiple microphones, which are respectively arranged at different parts of the server 10. The microphone can also be an array microphone or an omnidirectional acquisition microphone. The speaker is used to convert the electrical signal from the processor 101 or the radio frequency circuit 104 into sound waves. The speaker can be a traditional film speaker or a piezoelectric ceramic speaker. When the speaker is a piezoelectric ceramic speaker, it can not only convert the electrical signal into a sound wave audible to humans, but also convert the electrical signal into a sound wave inaudible to humans for purposes such as ranging. In some embodiments, the audio circuit 107 can also include a headphone jack.
[0048] The positioning component 108 is used to locate the current geographical location of the server 10 to implement navigation or LBS (Location Based Service). The positioning component 108 can be a positioning component based on the US GPS (Global Positioning System), China's Beidou system, Russia's Grenas system or the European Union's Galileo system.
[0049] The power supply 109 is used to power various components in the server 10. The power supply 109 can be an alternating current, a direct current, a disposable battery, or a rechargeable battery. When the power supply 109 includes a rechargeable battery, the rechargeable battery can support wired charging or wireless charging. The rechargeable battery can also be used to support fast charging technology.
[0050] In some embodiments, the server 10 further includes one or more sensors 1010. The one or more sensors 1010 include, but are not limited to: an acceleration sensor, a gyroscope sensor, a pressure sensor, a fingerprint sensor, an optical sensor, and a proximity sensor.
[0051] The acceleration sensor can detect the magnitude of acceleration on the three coordinate axes of the coordinate system established with the server 10. The gyroscope sensor can detect the body direction and rotation angle of the server 10, and the gyroscope sensor can cooperate with the acceleration sensor to collect the user's 3D actions on the server 10. The pressure sensor can be set on the side frame of the server 10 and / or the lower layer of the display screen 105. When the pressure sensor is set on the side frame of the server 10, the user's holding signal of the server 10 can be detected. The fingerprint sensor is used to collect the user's fingerprint. The optical sensor is used to collect the ambient light intensity. The proximity sensor, also known as the distance sensor, is usually set on the front panel of the server 10. The proximity sensor is used to collect the distance between the user and the front of the server 10.
[0052] The execution subject of the page testing method provided by the present disclosure may be a page testing device, and the execution device may be Figure 1 The server shown. At the same time, the execution device can also be a central processing unit (CPU) of the server, or a control module in the server for processing data. In the embodiment of the present application, the test method of the page executed by the server is taken as an example to illustrate the test method of the page provided in the embodiment of the present application.
[0053] In an operative manner, the server is used to provide voice and / or data connectivity services to users. The server may have different names, such as UE, terminal unit, terminal station, mobile station, mobile station, remote station, remote terminal, mobile device, wireless communication device, vehicle user equipment, terminal agent or terminal device, etc.
[0054] Optionally, the server may be any handheld device, vehicle-mounted device, wearable device, or computer with communication functions, which is not limited in the embodiments of the present disclosure. For example, the handheld device may be a smart phone. The vehicle-mounted device may be a vehicle-mounted navigation system. The wearable device may be a smart bracelet. The computer may be a personal digital assistant (PDA), a tablet computer, or a laptop computer.
[0055] After introducing the application scenario and server implementation environment of the embodiment of the present disclosure, the following takes the server as a computer as an example to introduce in detail the page testing method provided by the embodiment of the present disclosure.
[0056] Figure 2 FIG. 1 is a flow chart of a method for testing a page according to an exemplary embodiment. Figure 2 As shown, the method may include steps 201 to 203.
[0057] 201. Get the first page.
[0058] The first page is any page among all pages of the application to be tested.
[0059] It should be noted that the first page is not limited in the embodiments of the present disclosure. For example, the first page may be the main page of the application to be tested. For another example, the first page may be the page when the application to be tested was last exited. For another example, the first page may be a page in a set application to be tested. Generally, the first page may be the main page of the application to be tested.
[0060] As a possible implementation manner, the application to be tested is started and the first page is obtained.
[0061] 202. Get all controls of the first page.
[0062] In the embodiment of the present disclosure, the first page includes at least one control.
[0063] It should be noted that the embodiments of the present disclosure do not limit the control. For example, the control may be a navigation control. For another example, the control may be a like control. For another example, the space may be a return control.
[0064] As a possible implementation manner, after obtaining the first page, each control in the first page is traversed to obtain all controls in the first page.
[0065] Exemplarily, if the first page includes a first control, a second control, and a third control, then after acquiring the first page, the first control, the second control, and the third control may be acquired.
[0066] 203. Execute the test case for each control in all controls on the first page according to the correspondence between the multiple controls and the multiple test cases and all controls on the first page.
[0067] Among them, the test case is used to trigger the control.
[0068] In a possible design, the test case is used to simulate at least one user behavior to trigger the control. For example, test case A is used to simulate click behavior. For another example, test case B is used to simulate sliding behavior (such as sliding up, sliding down, sliding left, and sliding right) and long pressing behavior. For another example, test case C is used to simulate clicking behavior and text input behavior.
[0069] In an embodiment of the present disclosure, a server stores a correspondence between multiple controls and multiple test cases, where the multiple controls are all controls in the application to be tested. Among them, all controls on the first page are some controls among all controls in the application to be tested. The server stores multiple test cases. Each test case corresponds to one or more controls.
[0070] Exemplarily, as shown in Table 1, it shows the corresponding relationship between multiple controls and multiple test cases.
[0071] Table 1
[0072] Controls Test Cases Simulate Behavior Control A and Control B Test Case A Click Control C Test Case B Click, long press Control D, Control E, Control F Test Case C Swipe up, swipe down, long press Control G, Control H Test Case D Click, swipe left, swipe right
[0073] That is to say, controls A and B can be tested by calling test case A, that is, by simulating click behavior to trigger controls A and B. Control C can be tested by calling test case B, that is, by simulating click behavior and simulating long press behavior to trigger control C. Similarly, controls D, E, and F can be tested by calling test case C, and controls G and H can be tested by calling test case D. For specific descriptions, please refer to the process of testing controls A and B by calling test case A, which will not be repeated here.
[0074] As a possible implementation, according to the correspondence between the multiple controls and the multiple test cases and all the controls on the first page, the test case corresponding to each control in all the controls on the first page is determined. Then, the test case corresponding to the control is executed for each control in all the controls on the first page.
[0075] For example, if all controls on the first page include control A and control D, then in combination with Table 1, control A can be tested by simulating a click behavior, and control D can be tested by simulating an upward slide behavior, a downward slide behavior, and a long press behavior.
[0076] As another possible implementation manner, for each control, a test case is executed on each control in all controls of the first page according to a first operation; the first operation includes steps one to three.
[0077] Step 1: Identify the target control.
[0078] The target control is any control among all controls on the first page.
[0079] Exemplarily, if all controls on the first page include: control A, control B, and control C, then the target control may be any one of control A, control B, and control C.
[0080] As a possible implementation, the server stores the corresponding relationship between the control identifier and the control, and the control identifier is used to identify the control. The identifier of the target control is obtained to identify the target control.
[0081] Exemplarily, if the identifier A corresponds to the like control, the identifier A of the target control is obtained, and the target control is determined to be the like control.
[0082] Step 2: Determine the target test case based on the correspondence between the multiple controls and the multiple test cases and the target control.
[0083] The target test case is a test case among multiple test cases used to test the target control.
[0084] As a possible implementation manner, after the target control is identified, the target test case is determined from the multiple test cases according to the corresponding relationship between the multiple controls and the multiple test cases.
[0085] Exemplarily, in conjunction with Table 1, if the target control is control A, the target test case is test case A, that is, control A can be tested by simulating click behavior. If the target control is control D, the target test case is test case C, that is, control D can be tested by simulating up-slide behavior, simulating down-slide behavior, and simulating long-press behavior, respectively.
[0086] Step 3: Execute the target test case on the target control.
[0087] Exemplarily, in conjunction with Table 1, if the target control is control A and the target test case is test case A, a simulated click behavior is performed on the control.
[0088] The technical solution provided by the above embodiment brings at least the following beneficial effects: the server stores the correspondence between multiple controls and multiple test cases, and the multiple controls are all controls in the application to be tested. For each control, a test case is executed for each control in all controls of the first page according to the first operation, and the first operation includes: identifying the target control, and determining the target test case according to the correspondence between the multiple controls and the multiple test cases and the target control, and the target test case is a test case used to test the target control in the multiple test cases. In this way, the target test case can be executed on the target control. Compared with the conventional technology that each page requires a corresponding test case, and the test case also includes the test case corresponding to all controls in the current page, the present disclosure only needs to find the corresponding test case through the control to test the control. In this way, not only can the integrity of the test be guaranteed, but also the same control in different pages can execute the same test case, which can reduce the number of test cases, reduce the time spent on writing test cases, and improve the test efficiency.
[0089] As another possible implementation, a plurality of test cases are stored in the server, each control in the first page is traversed, and a plurality of test cases are executed for each control.
[0090] Exemplarily, if the first page includes controls A, B, and C, the multiple test cases include test case A and test case B. Test case A and test case B can be executed on controls A, B, and C respectively.
[0091] The technical solution provided by the above embodiment brings at least the following beneficial effects: obtaining a first page, the first page being any page among all the pages of the application to be tested. Obtaining all the controls of the first page. Since the server stores the correspondence between multiple controls and multiple test cases, the test case is used to trigger the control, and the multiple controls are all the controls in the application to be tested, the test case can be executed for each of all the controls of the first page according to the correspondence between the multiple controls and the multiple test cases and all the controls of the first page. In this way, in the process of testing the page controls, the controls in the page can be automatically traversed, and the corresponding test case can be executed for each control. Compared with conventional technology, there is no need to write test cases for the page, which not only ensures the integrity of the test, but also the same controls in different pages can execute the same test case, which can reduce the number of test cases, reduce the time spent on writing test cases for controls, and improve test efficiency.
[0092] In one practicable manner, Figure 3 As shown, step 203 may include steps 301 to 305 .
[0093] 301. Execute test cases for page jump controls.
[0094] In a possible design, all controls of the first page include a page jump control, and the page jump control is used to trigger a jump to the second page.
[0095] The second page is a page in the application to be tested. For example, the second page is a page of the next level of the first page. For another example, the second page is a page of the previous level of the first page.
[0096] For example, if the displayed page jumps from page A to page B, page A is the previous page of page B, and page B is the next page of page A.
[0097] As a possible implementation method, a test case corresponding to the page jump control is determined according to the page jump control, and then the test case corresponding to the page jump control is executed on the page jump control.
[0098] 302. The displayed page jumps from the first page to the second page.
[0099] As a possible implementation, in the case of testing all controls of the first page, the first page is displayed. After executing the test case for the page jump control of the first page, the displayed page jumps from the first page to the second page.
[0100] 303. Determine whether all controls on the first page have executed test cases.
[0101] As a possible implementation, after executing the test case for each control on the first page, the controls for which the test case has been executed are marked. After the displayed page jumps from the first page to the second page, the marked controls are compared with all the controls on the first page. If the marked controls are the same as all the controls on the first page, it is determined that all the controls on the first page have executed the test case. If the marked controls are different from all the controls on the first page, it is determined that there are controls on all the controls on the first page for which the test case has not been executed.
[0102] Exemplarily, if all controls on the first page include: control A, control B, control C, and control D. If the marked controls include control A and control B, it is determined that there are controls for which the test case has not been executed among all controls on the first page. If the marked controls include control A, control B, control C, and control D, it is determined that all controls on the first page have executed the test case.
[0103] In an implementable manner, if there are controls on all controls on the first page that have not executed the test case, step 304 to step 305 are executed.
[0104] In an practicable manner, if there is a control that has not executed the test case among all the controls on the first page, then step 304-step 305 is executed. If all the controls on the first page have executed the test case, then the following steps are executed: Figure 3 Steps 306-307 are shown.
[0105] 304. Execute the first event.
[0106] The first event is used to instruct jumping to the first page.
[0107] As a possible implementation, if there is a control in all controls of the first page that has not executed the test case, a return control is triggered, and the return control is used to indicate returning to the previous page of the second page (ie, the first page).
[0108] 305. Execute test cases for other controls in the first page except the page jump control.
[0109] Exemplarily, if all controls on the first page include: control A, page jump control, control C, and control D. If the test case is executed in the order of control A-page jump control-control C-control D. After executing the test case on the page jump control, jump from the first page to the second page. Afterwards, if there are controls that do not execute the test case among all controls on a page (i.e., control C and control D do not execute the test case), execute the first event and jump from the second page to the first page. Then, execute the test case on control C and control D.
[0110] The technical solution provided by the above embodiment brings at least the following beneficial effects: all controls of the first page include a page jump control, and the page jump control is used to trigger jumping to the second page. After executing the test case on the page jump control, the displayed page jumps from the first page to the second page. In the case that there are controls for which the test case has not been executed among all controls of the first page, the first event is executed and the page is jumped to the first page again. Then, the test case is executed for other controls in the first page except the page jump control. In this way, if the page changes, if there are controls for which the test case has not been executed among the controls in the page, it is possible to jump to the previous page again and continue to test the controls in the page. In this way, it can be ensured that the test case is executed for all controls in the page, and some controls are avoided from being missed, thereby improving the safety of the test.
[0111] 306. Get all controls of the second page.
[0112] As a possible implementation manner, if all controls on the first page have executed the test case, all controls on the second page are obtained.
[0113] 307. Execute the test case for each control in all controls of the second page.
[0114] The technical solution provided by the above embodiment brings at least the following beneficial effects: when all controls on the first page have executed the test case, all controls on the second page are obtained, and the test case is executed for each control in all controls on the second page. In this way, when all controls on a page have completed the test, another page is tested, which can avoid missing controls during the test process and improve the safety of the test.
[0115] In an practicable manner, the server further includes a tested page set, wherein the tested page set stores pages in which all controls in the page have completed testing. If all controls in the first page have executed the test case, the first page is stored in the tested page set.
[0116] Exemplarily, the tested page set stores page images or page identifiers. Taking the case where the tested page set stores page images as an example, when all controls on the first page have been tested, an image of the first page (such as a screenshot) is obtained and the image of the first page is saved in the tested page set.
[0117] The technical solution provided by the above embodiment brings at least the following beneficial effects: the server also includes a tested page set, and the tested page set stores pages in which all controls in the page have completed testing. When all controls in the first page have executed the test case, the first page is stored in the tested page set. In this way, by determining the pages that have completed the test through the tested page set, it is possible to avoid repeated testing of pages in the application to be tested, thereby improving the test efficiency.
[0118] In one practicable manner, Figure 4 As shown, after step 303 and before step 306 , step 401 may be included.
[0119] 401. Determine whether all controls in the second page have executed test cases according to the tested page set and the second page.
[0120] As a possible implementation, a page image is stored in the tested page set. An image of a second page is obtained. Then, a preset image recognition algorithm is used to determine the similarity between the image of the second page and each page image in the tested page set. If there is a page image in the tested page set whose similarity with the image of the second page is greater than a preset similarity threshold, it is determined that all controls in the second page have executed the test case. If the similarity between each page image in the tested page set and the image of the second page is less than the preset similarity threshold, it is determined that there is a control in all controls in the second page that has not executed the test case.
[0121] Exemplarily, the preset image recognition algorithm can be a template matching image recognition algorithm, and the preset similarity threshold is 96%. If the tested page set includes: an image of page A, an image of page B, and an image of page C. If the similarity between the image of the second page and the image of page A is 70%, the similarity between the image of the second page and the image of page B is 15%, and the similarity between the image of the second page and the image of page C is 99%, then it is determined that the image of the second page is highly similar to the image of page C, and all controls in the second page have executed the test case. If the similarity between the image of the second page and the image of page A is 70%, the similarity between the image of the second page and the image of page B is 15%, and the similarity between the image of the second page and the image of page C is 60%, then it is determined that there is no page image with a high similarity to the second page in the tested page set, and there are controls in all controls in the second page that have not executed the test case.
[0122] In an practicable manner, if there is a control in all controls in the second page that has not executed the test case, step 306 is executed. If all controls in the second page have executed the test case, a second event is executed, and the second event is used to instruct to stop testing the application to be tested.
[0123] Optionally, if all controls in the second page have executed the test case, the test case is re-executed for each space in the second page. The second page includes a first page jump control, and the first page jump control is used to trigger a jump to a third page. The third page is any page in the application to be tested. When the test case is executed for the first page jump control, the actual page jumps from the second page to the third page. Afterwards, the test case is executed for all controls in the third page.
[0124] In an implementable manner, if there are controls in all controls on the second page that have not executed the test case, and all controls on the first page have executed the test case, then all controls on the second page are acquired.
[0125] The technical solution provided by the above embodiment brings at least the following beneficial effects: according to the tested page set and the second page, it is determined whether all controls in the second page have executed the test case. In the case where there are controls that have not executed the test case among all controls in the second page, and all controls on the first page have executed the test case, all controls on the second page are obtained. In this way, in the case where there are controls that have not executed the test case in the second page, it means that the controls on the second page need to be tested, and all controls on the first page have executed the test case, indicating that there is no need to return to the first page. Afterwards, all controls on the second page are obtained and all controls on the second page are tested. In this way, not only can the second page be avoided from being tested twice, but also the second page can be tested when the test on the first page is completed, which not only improves the test efficiency, but also ensures the integrity of the test.
[0126] In an practicable manner, all pages of the application to be tested are stored in the server. If the set of tested pages includes all pages of the application to be tested, a second event is executed, and the second event is used to instruct to stop testing the application to be tested.
[0127] Exemplarily, if the server stores the identifiers of all pages of the application to be tested, including identifier A, identifier B, and identifier C, and the set of tested pages includes identifier A, identifier B, and identifier C, then it is determined that all pages in the application to be tested have been tested, and the second event is executed.
[0128] The technical solution provided by the above embodiment brings at least the following beneficial effects: all pages of the application to be tested are stored in the server. If the set of tested pages includes all pages of the application to be tested, the second event is executed, and the second event is used to instruct to stop testing the application to be tested. In this way, it can be ensured that the test of the application to be tested is stopped when all pages of the application to be tested have been tested. In this way, it can be avoided to miss some pages of the application to be tested, and the integrity of the test is guaranteed.
[0129] In another practicable manner, all pages of the application to be tested are stored in the server. After executing the test cases for all controls in each page of the application to be tested, the pages for which the test is completed are marked. If all pages are marked, the second event is executed.
[0130] It is understandable that the above method can be implemented by a test device of the page. In order to implement the above functions, the test device of the page includes hardware structures and / or software modules corresponding to the execution of each function. Those skilled in the art should easily realize that, in combination with the modules and algorithm steps of each example described in the embodiments disclosed herein, the embodiments of the present disclosure can be implemented in the form of hardware or a combination of hardware and computer software. Whether a function is executed in the form of hardware or computer software driving hardware 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 exceed the scope of the embodiments of the present disclosure.
[0131] The disclosed embodiment can divide the functional modules of the test device of the above-mentioned page, etc. according to the above-mentioned method example. For example, each functional module can be divided corresponding to each function, or two or more functions can be integrated into one processing module. The above-mentioned integrated module can be implemented in the form of hardware or in the form of software functional modules. It should be noted that the division of modules in the disclosed embodiment is schematic and is only a logical functional division. There may be other division methods in actual implementation.
[0132] Figure 5 is a structural block diagram of a page testing device according to an exemplary embodiment. Figure 5 The testing device 50 of the page includes an acquisition unit 51, a processing unit 52 and a display unit 53.
[0133] The acquisition unit 51 is configured to execute acquisition of a first page, where the first page is any page of all pages of the application to be tested. The acquisition unit 51 is also configured to execute acquisition of all controls of the first page. The processing unit 52 is configured to execute a test case for each control of all controls of the first page according to the correspondence between the multiple controls and the multiple test cases and all controls of the first page.
[0134] Optionally, the processing unit 52 is further configured to perform, identify a target control, the target control being any control among all controls on the first page, determine a target test case according to the correspondence between the multiple controls and the multiple test cases and the target control, the target test case being a test case among the multiple test cases for testing the target control, and execute the target test case on the target control.
[0135] Optionally, all controls of the first page include a page jump control, and the page jump control is used to trigger jumping to the second page. The processing unit 52 is also configured to execute a test case for the page jump control. The display unit 53 is configured to execute the displayed page to jump from the first page to the second page. The processing unit 52 is also configured to execute a first event if there is a control in all controls of the first page that has not executed the test case, and the first event is used to indicate jumping to the first page. The processing unit 52 is also configured to execute test cases for other controls in the first page except the page jump control.
[0136] Optionally, the processing unit 52 is further configured to execute if all controls on the first page have executed the test case, then obtain all controls on the second page. The processing unit 52 is further configured to execute the test case for each control in all controls on the second page.
[0137] Optionally, the server further includes a tested page set, in which pages on which all controls in the page have completed testing are stored. The processing unit 52 is further configured to execute if all controls in the first page have executed the test case, then store the first page in the tested page set.
[0138] Optionally, the processing unit 52 is further configured to determine whether all controls in the second page have executed the test case based on the tested page set and the second page. The processing unit 52 is further configured to obtain all controls in the second page if there are controls in all controls in the second page that have not executed the test case and all controls in the first page have executed the test case.
[0139] Regarding the page testing device in the above embodiment, the specific manner in which each module performs operations has been described in detail in the embodiment of the method, and will not be elaborated here.
[0140] Figure 6 60 is a schematic diagram of the structure of a page testing device 60 provided by the present disclosure. Figure 6 The page testing device 60 may include at least one processor 601 and a memory 603 for storing executable instructions of the processor 601. The processor 601 is configured to execute the instructions in the memory 603 to implement the page testing method in the above embodiment.
[0141] In addition, the page testing device 60 may further include a communication bus 602 and at least one communication interface 604 .
[0142] The processor 601 may be a GPU, a microprocessing unit, an ASIC, or one or more integrated circuits for controlling the execution of the program of the disclosed solution.
[0143] Communication bus 602 may include a pathway for transmitting information between the above-mentioned components.
[0144] The communication interface 604 uses any transceiver or other device for communicating with other devices or communication networks, such as Ethernet, radio access network (RAN), wireless local area networks (WLAN), etc.
[0145] The memory 603 may be a read-only memory (ROM) or other types of static storage devices that can store static information and instructions, a random access memory (RAM) or other types of dynamic storage devices that can store information and instructions, or an electrically erasable programmable read-only memory (EEPROM), a compact disc read-only memory (CD-ROM) or other optical disc storage, optical disc storage (including compressed optical disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto. The memory may exist independently and be connected to the processing unit via a bus. The memory may also be integrated with the processing unit and be a volatile storage medium in the GPU.
[0146] The memory 603 is used to store instructions for executing the solution of the present disclosure, and the execution is controlled by the processor 601. The processor 601 is used to execute the instructions stored in the memory 603, so as to realize the functions in the method of the present disclosure.
[0147] In a specific implementation, as an embodiment, the processor 601 may include one or more GPUs, such as Figure 6 GPU0 and GPU1 in .
[0148] In a specific implementation, as an embodiment, the page testing device 60 may include multiple processors, such as Figure 6 601 and processor 607 in FIG. Each of these processors may be a single-core (single-CPU) processor or a multi-core (multi-GPU) processor. A processor herein may refer to one or more devices, circuits, and / or processing cores for processing data (e.g., computer program instructions).
[0149] In a specific implementation, as an embodiment, the page test device 60 may further include an output device 605 and an input device 606. The output device 605 communicates with the processor 601 and may display information in a variety of ways. For example, the output device 605 may be a liquid crystal display (LCD), a light emitting diode (LED) display device, a cathode ray tube (CRT) display device, or a projector. The input device 606 communicates with the processor 601 and may receive user input in a variety of ways. For example, the input device 606 may be a mouse, a keyboard, a touch screen device, or a sensor device.
[0150] Those skilled in the art will understand that Figure 6 The structure shown in the figure does not constitute a limitation on the page testing device 60, and may include more or less components than those shown in the figure, or combine certain components, or adopt a different component arrangement.
[0151] The present disclosure also provides a computer-readable storage medium having instructions stored thereon. When the instructions in the storage medium are executed by a processor of a server, the server is enabled to execute the group communication method provided by the above-mentioned embodiment of the present disclosure.
[0152] The embodiment of the present disclosure also provides a computer program product including instructions, which, when executed on a server, enables the server to execute the page testing method provided by the embodiment of the present disclosure.
[0153] 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.
[0154] 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 testing method, characterized in that: Applied to a server, the server stores a correspondence between a plurality of controls and a plurality of test cases, the test cases are used to trigger the controls, and the plurality of controls are all controls in the application to be tested; the method comprises: Acquire a first page, where the first page is any page among all pages of the application to be tested; Get all controls of the first page; According to the correspondence between the multiple controls and the multiple test cases and all the controls on the first page, the test case is executed on each control in all the controls on the first page; all the controls on the first page include a page jump control, and the page jump control is used to trigger a jump to a second page; Executing a test case for each control in all controls of the first page includes: Executing the test case on the page jump control, so that the displayed page jumps from the first page to the second page; If there is a control among all controls on the first page that does not execute the test case, a first event is executed, where the first event is used to instruct to jump to the first page; The test case is executed on other controls in the first page except the page jump control.
2. The method according to claim 1, characterized in that The executing the test case on each control in all controls of the first page according to the correspondence between the multiple controls and the multiple test cases and all controls of the first page comprises: For each of the controls, a test case is executed on each of all controls on the first page according to a first operation; the first operation includes: Identify a target control, where the target control is any control among all controls on the first page; Determine a target test case according to the correspondence between the multiple controls and the multiple test cases and the target control, wherein the target test case is a test case among the multiple test cases for testing the target control; The target test case is executed on the target control.
3. The method according to claim 1 or 2, characterized in that: The method further comprises: If all controls on the first page have executed the test case, then obtaining all controls on the second page; A test case is executed for each control in all controls of the second page.
4. The method according to claim 3, characterized in that The server also includes a tested page set, in which pages on which all controls have been tested are stored; the method also includes: If all controls of the first page have executed the test case, the first page is stored in the tested page set.
5. The method according to claim 4, characterized in that Before acquiring all controls of the second page, the method further includes: Determining, based on the tested page set and the second page, whether all controls in the second page have executed the test case; If all controls on the first page have executed the test case, then obtaining all controls on the second page includes: If there are controls in all controls on the second page that have not executed the test case, and all controls on the first page have executed the test case, then all controls on the second page are acquired.
6. The method according to claim 5, characterized in that The server stores all pages of the application to be tested; the method further includes: If the set of tested pages includes all pages of the application to be tested, a second event is executed, where the second event is used to instruct to stop testing the application to be tested.
7. A page testing device, characterized in that: Applied to a server, the server stores a correspondence between a plurality of controls and a plurality of test cases, the test cases are used to trigger the controls, and the plurality of controls are all controls in the application to be tested; the device comprises: An acquiring unit is configured to acquire a first page, where the first page is any page among all pages of the application to be tested; The acquisition unit is further configured to acquire all controls of the first page; a processing unit configured to execute a test case for each control among all controls of the first page according to the correspondence between the multiple controls and the multiple test cases and all controls of the first page; all controls of the first page include a page jump control, and the page jump control is used to trigger a jump to a second page; The processing unit is further configured to execute the test case on the page jump control; A display unit, configured to execute a page jump from the first page to the second page; The processing unit is further configured to execute a first event if there is a control that does not execute the test case among all the controls on the first page, wherein the first event is used to indicate a jump to the first page; The processing unit is further configured to execute the test case on other controls in the first page except the page jump control.
8. The page testing device according to claim 7, characterized in that: The processing unit is further configured to execute: Identify a target control, where the target control is any control among all controls on the first page; Determine a target test case according to the correspondence between the multiple controls and the multiple test cases and the target control, wherein the target test case is a test case among the multiple test cases for testing the target control; The target test case is executed on the target control.
9. The page testing device according to claim 7 or 8, characterized in that: The processing unit is further configured to obtain all controls of the second page if all controls of the first page have executed the test case; The processing unit is further configured to execute a test case on each control in all controls of the second page.
10. The page testing device according to claim 9, characterized in that: The server also includes a tested page set, in which the tested page set stores pages in which all controls in the page have been tested; The processing unit is further configured to store the first page into the tested page set if all controls of the first page have executed the test case.
11. The page testing device according to claim 10, characterized in that: The processing unit is further configured to determine whether all controls in the second page have executed the test case based on the tested page set and the second page; The processing unit is further configured to obtain all controls on the second page if there are controls on the second page that have not executed the test case, and all controls on the first page have executed the test case.
12. The page testing device according to claim 11, characterized in that: The server stores all pages of the application to be tested; The processing unit is further configured to execute a second event if the set of tested pages includes all pages of the application to be tested, wherein the second event is used to instruct to stop testing the application to be tested.
13. A server, characterized in that: The server comprises: processor; a memory for storing instructions executable by the processor; The processor is configured to execute the instructions to implement the page testing method as described in any one of claims 1-6.
14. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instructions in the computer-readable storage medium are executed by a processor of a server, the server is enabled to execute the page testing method according to any one of claims 1 to 6.
15. A computer program product comprising a computer program / instructions, characterized in that When the computer program / instructions are executed by a processor, the page testing method according to any one of claims 1 to 6 is implemented.