Disclosure of Invention
The embodiment of the application provides a method and equipment for testing task guide, and the method can automatically load guide steps, so that the efficiency of testing task guide is improved.
In a first aspect of an embodiment of the present application, a method for testing task guidance is provided, in which a task guidance includes M guidance steps, the M guidance steps include a first guidance step and a second guidance step, the second guidance step is a guidance step next to the first guidance step, and M is an integer greater than 1;
the method comprises the following steps:
the method comprises the steps of firstly controlling a browser to load a first page, and then loading a first guide step in the first page of the browser by a terminal, wherein the first page is loaded with a software product, the first guide step indicates that a first operation is carried out on the first page, and an event object corresponding to the first operation is used for enabling the browser to refresh a second page;
the terminal can generate an event object corresponding to the first operation according to the first guide step so that the browser refreshes the second page;
and finally, the terminal loads a second guide step in a second page.
After the first guiding step is loaded, the terminal generates an event object corresponding to the first operation, the event object enables the terminal to refresh the second page, and then the terminal loads the second guiding step in the second page, so that the automatic loading of the second guiding step is realized under the condition that the user does not perform the first operation on the first page, and the testing efficiency can be improved.
Based on the first aspect, an embodiment of the present application provides a first implementation manner of the first aspect, in this implementation manner, M is an integer greater than 2, and the second page corresponds to the first URL;
after the terminal loads the second guiding step in the second page, the method further comprises:
based on the exception of the second guiding step, the terminal cannot generate a corresponding event object according to the second guiding step, so that the browser cannot refresh the next page and further cannot automatically load the guiding step in the next page; based on this, the terminal determines a third guidance step corresponding to the first uniform resource locator URL from M guidance steps, wherein the second URL is one of N preset URLs and is different from the first URL, where N is a positive integer, the third guidance step is subsequent to the second guidance step, as an implementable manner, there may be no guidance step between the third guidance step and the second guidance step, that is, the third guidance step is a next guidance step of the second guidance step, and there may also be at least one guidance step between the third guidance step and the second guidance step;
then, the terminal controls the browser to load a third page according to the second URL;
and finally, the terminal loads a third guide step in a third page.
In this embodiment, N URLs are preset for M guidance steps, so that, based on the fact that the terminal cannot continue to load the guidance step due to the abnormality in loading the second guidance step, the terminal may control the browser to load the third page according to the preset URL, and then load the third guidance step in the third page, so that other guidance steps after the third guidance step may be automatically loaded to test the third guidance step and other guidance steps thereafter.
Based on the first aspect or the first implementation manner of the first aspect, an embodiment of the present application provides a second implementation manner of the first aspect, where before the step of loading, by the terminal, the first guidance in the first page of the browser, the method further includes:
the terminal determines a third URL corresponding to the first guiding step from preset N URLs, wherein N is a positive integer;
and the terminal controls the browser to load the first page according to the third URL.
And the terminal loads the first page according to the preset third URL, so that the automatic loading of the first page is realized.
Based on the first aspect, or the first implementation manner of the first aspect, or the second implementation manner of the first aspect, an embodiment of the present application provides a third implementation manner of the first aspect, and the method further includes:
the terminal collects test data of the task guide, wherein the test data comprises one or more of the following items: a loading order of the wizard steps, an operating state of at least one of the M wizard steps, a screenshot of a page loaded with at least one of the M wizard steps, or a degree of matching of metadata of the element selector to focused elements in the page.
In the embodiment, the terminal realizes automatic testing of the task guide by collecting the test data.
Based on the third implementation manner of the first aspect, an embodiment of the present application provides a fourth implementation manner of the first aspect, and after the terminal collects test data of the task guide, the method further includes:
and the terminal analyzes the task guide according to the test data and a preset test base line to obtain an analysis result, wherein the test base line can be obtained from the process of previewing the task guide, and the dimension of the test base line can be the same as that of the test data.
Based on the fourth implementation manner of the first aspect, this application provides the fifth implementation manner of the first aspect, and based on a change of a software product, a page of a browser also changes, which may further cause a difference between test data and a test baseline, so that after a terminal analyzes a task guide according to the test data and a preset test baseline, and obtains an analysis result, the method further includes:
and updating the test baseline and/or the metadata of the task guide by the terminal according to the test data based on the fact that the analysis result indicates that the difference degree between the test data and the preset test baseline is smaller than or equal to the preset difference degree.
In this embodiment, the terminal may automatically update the task guide and the test baseline according to the test data based on the difference between the test data and the test baseline but with a smaller degree of difference.
Based on the fourth implementation manner of the first aspect, an embodiment of the present application provides the sixth implementation manner of the first aspect, and after the terminal analyzes the task guide according to the test data and a preset test baseline to obtain an analysis result, the method further includes:
and indicating that the difference degree between the test data and the test baseline is greater than the preset difference degree based on the analysis result, and generating early warning information by the terminal.
In this embodiment, when the test data is different from the test baseline but the difference is large, the terminal generates the warning information to notify the user in time.
A second aspect of the embodiments of the present application provides a terminal for testing task guidance, where the task guidance includes M guidance steps, where the M guidance steps include a first guidance step and a second guidance step, the second guidance step is a guidance step subsequent to the first guidance step, and M is an integer greater than 1;
the terminal includes:
the loading unit is used for loading a first guide step in a first page of the browser, the first guide step indicates that a first operation is carried out on the first page, and an event object corresponding to the first operation is used for enabling the browser to refresh a second page;
the generating unit is used for generating an event object corresponding to the first operation according to the first guiding step so as to enable the browser to refresh the second page;
and the loading unit is also used for loading the second guide step in the second page.
Based on the second aspect, an embodiment of the present application provides a first implementation manner of the second aspect, where M is an integer greater than 2, and the second page corresponds to the first URL; the terminal further includes:
a determining unit, configured to determine, based on the second guiding step exception being loaded, a third guiding step corresponding to a second URL from among M guiding steps, where the third guiding step is subsequent to the second guiding step, the second URL is one of preset N URLs and is different from the first URL, where N is a positive integer;
the loading unit is also used for controlling the browser to load a third page according to the second URL;
and the loading unit is also used for loading the third guide step in the third page.
Based on the second aspect or the first implementation manner of the second aspect, an embodiment of the present application provides a second implementation manner of the second aspect, and the terminal further includes:
a determining unit, configured to determine a third URL corresponding to the first guiding step from preset N URLs, where N is a positive integer;
and the loading unit is also used for controlling the browser to load the first page according to the third URL.
Based on the second aspect, or the first implementation manner of the second aspect, or the second implementation manner of the second aspect, an embodiment of the present application provides a third implementation manner of the second aspect, and the terminal further includes:
the acquisition unit is used for acquiring the test data of the task guide;
the test data includes one or more of: a loading order of the wizard steps, an operating state of at least one of the M wizard steps, a screenshot of a page loaded with at least one of the M wizard steps, or a degree of matching of metadata of the element selector to focused elements in the page.
Based on the third implementation manner of the second aspect, this application provides a fourth implementation manner of the second aspect, and the terminal further includes:
and the analysis unit is used for analyzing the task guide according to the test data and a preset test baseline to obtain an analysis result.
Based on the fourth implementation manner of the second aspect, this application provides a fifth implementation manner of the second aspect, and the terminal further includes:
and the updating unit is used for updating the test baseline and/or the metadata of the task guide according to the test data based on the fact that the analysis result indicates that the difference degree between the test data and the preset test baseline is less than or equal to the preset difference degree.
Based on the fourth implementation manner of the second aspect, the present application provides a sixth implementation manner of the second aspect, and the generating unit is further configured to generate the warning information based on that the analysis result indicates that the degree of difference between the test data and the test baseline is greater than the preset degree of difference.
A third aspect of the embodiments of the present application provides a terminal device, including: at least one processor and a memory, the memory storing computer-executable instructions executable on the processor, the terminal device performing the method of testing task wizards as described in any one of the embodiments of the first aspect above when the computer-executable instructions are executed by the processor.
A fourth aspect of the embodiments of the present application provides a chip or a chip system, where the chip or the chip system includes at least one processor and a communication interface, the communication interface and the at least one processor are interconnected by a line, and the at least one processor is configured to execute a computer program or instructions to perform the method for testing task guidance according to any one of the embodiments of the first aspect.
A fifth aspect of the embodiments of the present application provides a computer storage medium, where the computer storage medium is used to store computer software instructions for the terminal device, and includes a program designed for executing the terminal device or the server;
the terminal device may be a terminal of a test task guide as described in the second aspect above.
A sixth aspect of embodiments of the present application provides a computer program product, which includes computer software instructions that can be loaded by a processor to implement the method for testing task guidance as described in any one of the embodiments of the first aspect.
According to the technical scheme, the embodiment of the application has the following advantages:
the method comprises the steps that a terminal loads a first guide step in a first page of a browser, a first operation is conducted on the first page based on an indication of the first guide step, an event object corresponding to the first operation is used for enabling the browser to refresh a second page, the terminal generates the event object corresponding to the first operation, so that the browser refreshes the second page, and finally, the terminal loads a second guide step in the second page.
Detailed Description
The embodiment of the application provides a method and equipment for testing task wizards, the method is used for testing the task wizards, and the efficiency of testing the task wizards can be improved due to the fact that wizard steps can be automatically loaded.
Referring to fig. 1, fig. 1 is a schematic diagram of a system architecture of a test task wizard. The embodiment of the application can be applied to the system shown in FIG. 1. The system comprises the terminal equipment and the server.
The terminal equipment (terminal device), which is called a terminal for short, or User Equipment (UE), is a device with a wireless transceiving function, and may be deployed on land, including indoors or outdoors, handheld or vehicle-mounted; can also be deployed on the water surface (such as a ship and the like); and may also be deployed in the air (e.g., airplanes, balloons, satellites, etc.). The terminal device may be a smart phone (mobile phone), a tablet computer (pad), a computer with a wireless transceiving function, a notebook computer, a Virtual Reality (VR) terminal, an Augmented Reality (AR) terminal, a wireless terminal in industrial control (industrial control), a wireless terminal in self driving (self driving), a wireless terminal in remote medical treatment (remote medical), a wireless terminal in smart grid (smart grid), a wireless terminal in transportation safety (transportation safety), a wireless terminal in smart city (smart city), a wireless terminal in smart home (smart home), and the like. Of which only a part of the terminal equipment is shown in fig. 1. For convenience of explanation, a terminal is explained below instead of the terminal device.
In the system architecture shown in fig. 1, first, a terminal or a server generates a test file of a task guide, where when the test file is generated by the server, the terminal acquires the test file from the server before a test is performed; then, the terminal runs the test file to load a guide step in a page of the browser, so that the task guide is tested. Although the step of loading the guide in the page of the browser by the terminal can be triggered by manually operating the page of the browser, the testing efficiency is low, so that the embodiment of the application provides the method for testing the task guide, the manual operation of the page of the browser is not needed, the guide step can be automatically loaded in the page of the browser, and the automatic test of the task guide is realized.
For ease of understanding, the method of the test task wizard in the embodiment of the present application is described below with reference to fig. 2. As shown in fig. 2, an embodiment of the present application provides an embodiment of a method for testing task guidance, in which the task guidance includes M guidance steps, where any one of the M guidance steps may be a prompting step or a non-prompting step; the prompting step is a guiding step irrelevant to interface elements and can also be called a guiding step of unfocused elements; the non-prompting step refers to a guiding step related to the interface element, and can also be called a guiding step with a focusing element. In the following embodiments, the prompting step and the non-prompting step will be described with reference to the drawings.
The M guiding steps include a first guiding step and a second guiding step, wherein the first guiding step can be any one of the M guiding steps, the second guiding step is the next guiding step of the first guiding step, and M is an integer greater than 1.
The second guiding step is the next guiding step of the first guiding step, and it can be understood that when the test file runs normally, the first guiding step is loaded in the page of the browser first, and then the second guiding step is loaded in the page of the browser based on a certain condition.
Based on the first guidance step and the second guidance step, the method comprises the following steps:
in operation 101, the terminal loads a first wizard step in a first page of the browser.
Before executing operation 101, the terminal needs to load a first page in a browser; it can be understood that, in order to make the method in the embodiment of the present application more intelligent, a corresponding test period may be preset, so that the terminal may determine a first time of the test task guide according to the test period, then automatically pull up the browser at the first time, and then load the first page in the browser.
In this embodiment of the application, there are various methods for loading the first page, and specifically, the terminal may be manually controlled to load the first page in the browser, for example, a user may input a uniform resource locator URL in the browser of the terminal or perform a search through a search engine, so that the browser loads the first page; the first page may also be automatically loaded by the terminal.
In addition, in general, before using a software product, an account of the software product needs to be logged in, and the login operation can be performed by manual control or by a terminal; based on the account number of the software product automatically logged in by the terminal, before the first page is automatically loaded by the terminal, the terminal can execute the operation of automatic login according to related configuration, wherein the related configuration can comprise the account number and the password, and can also comprise the URL of the login page; for example, the terminal loads a login page according to a preset URL of the login page, and then performs automatic login according to an account and a password.
The process of automatically loading the first page by the terminal is described below with reference to fig. 3. As shown in fig. 3, the terminal automatically loading the first page includes:
in operation 201, the terminal determines a third URL corresponding to the first guiding step from preset N URLs.
It is understood that N URLs may be preconfigured on the terminal, where N is a positive integer, and a mapping relationship between the first guidance step and a third URL in the N URLs is established, so that the terminal may determine the third URL corresponding to the first guidance step according to the mapping relationship.
In operation 202, the terminal controls the browser to load the first page according to the third URL.
After determining the third URL corresponding to the first guiding step, the terminal may control the browser to automatically load the first page according to the third URL.
Through the two methods, the terminal can load the first page in the browser, and after the first page is loaded, the terminal can run the test file of the task guide.
Based on the fact that the terminal loads the first page in the browser, the test file detects that the current page is the first page, and then a first guide step corresponding to the first page is loaded. Wherein the terminal loading the first guiding step in the first page comprises the terminal running a code related to the first guiding step in the first page; specifically, when the first guiding step needs to be manually checked, the step of loading the first guiding step in the first page by the terminal may further include the step of displaying the first guiding step in the first page by the terminal; when the first guidance step does not need to be manually viewed, the terminal may not display the first guidance step in the first page.
Specifically, assume that the first page is shown in fig. 4, where fig. 4 is a schematic view of an embodiment of the first page in the embodiment of the present application, and the first page shown in fig. 4 is a page of a game product, in the first page, a circular interface element represents a start area, a rectangular interface element represents a target area, a four-pointed star interface element located at the upper right of the rectangular interface element represents a store, and a game character is located in the start area.
Meanwhile, the content contained in the first guide step is assumed to be: clicking a right mouse button in the area to control the game character to move into the area; the terminal may automatically load the first page as shown in fig. 4 according to a preset third URL, and then load the first guidance step in the first page, and the first page loaded with the first guidance step may be as shown in fig. 5, where fig. 5 is a schematic view of an embodiment of the first page loaded with the first guidance step.
In an embodiment of the application, the first guiding step indicates that a first operation is performed on the first page. Taking the first guidance step in fig. 5 as an example, the first guidance step instructs the user to click the right mouse button in the target area, that is, the first operation is to click the right mouse button in the target area. In fig. 5, the first guide step is associated with a rectangular interface element representing the target area, so the rectangular interface element is the focused element of the first guide step, which is the non-hinting step.
It should be noted that when a user operates in a page of a browser, various events, such as a mouse event, a keyboard event, an input value change event, and a tree change event, are triggered. The mouse event may include left mouse click, right mouse click, mouse move in, mouse move out, mouse wheel, and the like, the keyboard event may include key press, key release, and the like, and the tree change event may specifically be a Document Object Model (DOM) tree change event, such as DOM tree node increase or decrease, content change, CSS change, attribute change, and the like.
And each event corresponds to an event object, the event object is used for representing the state of the event, and the event object can be collected by the terminal. The event object comprises attribute information such as an event type of the event object, an interface element triggering the event object, a key value generated by the event object and the like. In the embodiment of the application, based on the first operation on the first page, an event object corresponding to a product is generated; enabling the browser to refresh the second page through the event object corresponding to the first operation; specifically, an event object corresponding to the first operation triggers a listener in a page of the browser, and then a callback function of the listener is executed, so that the browser refreshes the second page; it should be noted that refreshing the second page includes loading the second page or forming the second page after refreshing a part of interface elements in the first page.
Wherein loading the second page may be understood as the browser loading the second page according to another URL that is different from the URL of the first page; when a second page is formed after refreshing partial interface elements in the first page, the URL of the second page is the same as that of the first page, and the partial interface elements of the second page are different from those of the first page.
Specifically, still assuming that the first page is as shown in fig. 4, the content included in the first wizard step is: clicking a right mouse button in the area to control the game character to move into the area; the first guiding step indicates that the first operation performed on the first page is: clicking a right mouse button in the target area; based on this first operation, the game character in the start area in fig. 4 moves into the target area, so the browser refreshes the second page as shown in fig. 6.
In the second page shown in FIG. 6, the game character is located within the target area represented by the rectangular interface element; thus, the second page shown in fig. 6 is compared to the first page shown in fig. 4: only the position of the game character is changed, but other interface elements are not changed, so that the interface element of the game character can be refreshed on the first page under the condition that the URL of the first page is maintained unchanged, and the browser refreshes the second page as shown in FIG. 6; in addition, the browser may load the second page as shown in fig. 6 according to another URL different from the URL of the first page.
In operation 102, the terminal generates an event object corresponding to the first operation according to the first guiding step, so that the browser refreshes the second page.
Based on the description of operation 101, if the user performs the first operation on the first page, the event object corresponding to the first operation causes the browser to refresh the second page.
However, in this embodiment of the application, the terminal generates an event object corresponding to the first operation to simulate that the user performs the first operation on the first page, so that the browser automatically refreshes the second page when the tester does not perform the first operation on the first page, where a process of refreshing the second page by the browser can be specifically understood with reference to the related description of operation 101.
In operation 103, the terminal loads a second guidance step in the second page.
Similarly, the running test file automatically detects that the current page of the browser changes into a second page, and then loads a second wizard step corresponding to the second page in the second page, wherein the process of loading the second wizard step is the same as the process of loading the first wizard step, which is not described herein. For example, still assume that the page shown in FIG. 6 is the second page, and assume that the contents of the second wizard step are: clicking on this, an accessory may be purchased for the game piece; the second page after the step of loading the second wizard may be as shown in fig. 7, where fig. 7 is a schematic view of an embodiment of the second page loaded with the step of second wizard.
In the embodiment of the application, after the terminal loads the first guiding step in the first page of the browser, the terminal can automatically refresh the second page in the browser without the operation of a user on the first page, and then automatically loads the second guiding step in the browser, and the user can compare the guiding step with the page where the guiding step is located to determine the matching degree of the task guide and the page of the software product, so that the test of the task guide is realized; and since the first guidance step may be any one of the M guidance steps, in the embodiment of the present application, the task guidance may be tested starting from any one of the M guidance steps.
Based on the foregoing embodiment, in another embodiment of the method for testing task guidance provided in this embodiment of the present application, in this embodiment, M is an integer greater than 2, that is, M guidance steps may include other guidance steps in addition to the first guidance step and the second guidance step.
It can be understood that, in the normal test process, the terminal loads the first guide step and the second guide step in sequence, and then loads other guide steps after the second guide step; however, based on the loading of the second guiding step exception, the terminal may not be able to continue loading other guiding steps after the second guiding step.
Specifically, loading a second guided step exception may include a variety of conditions; for example, loading a second guiding step exception may result based on the terminal failing to find the focusing element of the second guiding step; the failure of the terminal to find the target element of the second guidance step transmission event object also causes the second guidance step to be abnormal, and in general, the target element is the focus element of the second guidance step.
Specifically, based on the failure of loading the second guidance step, the terminal cannot generate a corresponding event object according to the second guidance step to trigger the browser to refresh another page, and further cannot load other guidance steps after the second guidance step in the another page, which finally results in that the other guidance steps cannot be tested.
Therefore, in the embodiment, a user selects N guide steps from M guide steps, and then configures a URL for the N guide steps at the terminal respectively, namely, establishes a one-to-one mapping relation between the N URLs and the N guide steps; for example, one wizard step corresponds to a URL of https:// www.xxx.com/aaa, another wizard step corresponds to a URL of https:// www.xxx.com/bbb, and yet another wizard step corresponds to a URL of https:// www.xxx.com/ccc; wherein N is a positive integer, N can be equal to M, and N can also be less than M.
Based on the mapping relationship between the URL and the guidance step, the terminal may first determine the URL corresponding to the guidance step to be loaded, then load the page according to the URL, and enable the browser to load the guidance step to be loaded in the page.
It should be noted that there may be at least one wizard step that cannot be configured with a URL in the M wizard steps, which is described below by way of an example.
This example is as follows:
as can be seen from the related description of operation 101, the first guiding step in the first page shown in fig. 5 indicates a first operation performed on the first page; based on the event object corresponding to the first operation collected by the browser, the browser may refresh part of the interface elements in the first page to form a second page as shown in fig. 6, that is, the URL of the first page is the same as the URL of the second page, where it is assumed that the URL of the first page and the URL of the second page are both the third URL.
However, the terminal can only load the first page or the second page in the browser according to the third URL, and it is assumed here that the terminal can only load the first page in the browser according to the third URL.
Therefore, the terminal cannot load the second page in the browser according to the third URL and further cannot load the second guidance step, so that the third URL cannot be configured for the second guidance step, that is, the terminal can only load the second page according to the event object corresponding to the first operation acquired by the browser.
Therefore, the user can select N guidance steps from the M guidance steps in consideration of whether the guidance steps can be configured with URLs.
Based on the N preconfigured URLs, in this embodiment, assuming that the second page corresponds to the first URL, after operation 103, the method further includes:
in operation 104, based on the loading of the second guiding step exception, the terminal determines a third guiding step corresponding to the second URL from the M guiding steps.
The second URL is one of preset N URLs and is different from the first URL; the third guiding step follows the second guiding step, in particular the third guiding step may be the next guiding step to the second guiding step, and one or more guiding steps may also be present between the third guiding step and the second guiding step.
In operation 105, the terminal controls the browser to load the third page according to the second URL.
After determining that the third guiding step corresponds to the second URL, the terminal may control the browser to automatically load the third page according to the second URL.
In operation 106, the terminal loads a third guidance step in a third page.
Similarly, the running test file automatically detects that the current page of the browser changes into a third page, and then loads a third wizard step corresponding to the third page in the third page, wherein the process of loading the third wizard step is the same as the process of loading the first wizard step, which is not described herein again.
The above-described process is described below with reference to fig. 6 to 9(a) by two different examples.
The first example is:
taking the page shown in fig. 6 as the second page as an example, assume that the M guidance steps include a first guidance step, a second guidance step, and a third guidance step, where the third guidance step is the next guidance step of the second guidance step; the contents of the second guide step are as follows: clicking on this, an accessory may be purchased for the game piece; the third guide step comprises the following contents: click here, the accessory is purchased for the game piece.
In the normal test process, based on that the second guiding step is successfully loaded, the second page may be as shown in fig. 7, where the second guiding step instructs the user to perform a second operation on the second page, and the second operation is to click on the store; then, the terminal generates an event object corresponding to the second operation to simulate the user to perform the second operation on the second page, and the event object corresponding to the second operation causes the browser to refresh the third page shown in fig. 8. Wherein the third page shown in fig. 8 is used to represent the purchase of accessories for a game character in a store, and specifically, in fig. 8, the interface elements in 3 rectangles represent the attack accessories, the auxiliary accessories and the defense accessories in the store, respectively.
Thereafter, the test file automatically detects that the current page of the browser changes to a third page shown in fig. 8, and then loads a third guiding step in the third page, where the third guiding step includes the following contents: click here, purchase ancillary equipment for the game piece; the third page loaded with the third guide step is shown in fig. 9 (a).
However, based on the failure of the second guiding step, the second guiding step cannot be loaded in the second page, that is, the second page including the second guiding step shown in fig. 7 cannot be displayed in the browser, and only the second page shown in fig. 6 can be displayed; at this time, the terminal may automatically load the third page shown in fig. 8 according to the second URL corresponding to the third guiding step, and similarly, the test file may detect the third page, and load the third guiding step in the third page, and finally display the third page including the third guiding step in fig. 9 (a).
In fig. 9(a), the third guidance step is associated with the rectangular interface element representing the auxiliary equipment, and specifically guides the user to click on the auxiliary equipment represented by the rectangular interface element, so the third guidance step in fig. 9(a) is a prompt step.
The second example is:
still taking the page shown in fig. 6 as the second page as an example, assume that the M guidance steps include a first guidance step, a second guidance step, and a third guidance step, where the third guidance step is a prompt step and is the next guidance step of the second guidance step; the contents of the second guide step are as follows: clicking on this, an accessory may be purchased for the game piece; the third guide step comprises the following contents: ask you what kind of equipment you need to buy.
Based on the failure of the second guiding step, the second guiding step cannot be loaded in the second page, that is, the second page including the second guiding step shown in fig. 7 cannot be displayed in the browser, and only the second page shown in fig. 6 can be displayed; at this time, the terminal may automatically load the third page as shown in fig. 8 according to the second URL corresponding to the third direction step.
Similarly, the third page is detected by the test document, and the third wizard step is loaded into the third page, and finally the third page including the third wizard step shown in fig. 9(b) is displayed. In the third page shown in fig. 9(b), the third guidance step is not associated with any of the 3 rectangular interface elements, so the third guidance step of fig. 9(b) is a prompt step specifically guiding the user to click on one of the attack equipment, the auxiliary equipment and the defense equipment represented by the 3 rectangular interface elements.
It can be understood that, in order to improve the efficiency of testing the task guide, in the embodiment of the present application, the terminal may simultaneously generate an event object corresponding to an operation of clicking the attack equipment, an event object corresponding to an operation of clicking the auxiliary equipment, and an event object corresponding to an operation of clicking the defense equipment, so that the browser simultaneously refreshes a page corresponding to the attack equipment, a page corresponding to the auxiliary equipment, and a page corresponding to the defense equipment; and then loading corresponding guide steps in the three pages respectively, so that the guide steps loaded in the three pages are tested simultaneously.
Based on the above description, in the embodiment of the present application, based on the exception of the second guiding step, the terminal cannot trigger the browser to refresh the third page by generating the event object, at this time, the terminal automatically loads the third page according to the preset second URL, and then loads the third guiding step in the third page, thereby implementing the automatic loading of the third guiding step to test the third guiding step; further, since the third step may be a next guidance step to the second guidance step, and one or more guidance steps may exist between the third guidance step and the second guidance step, the task guidance may be continuously tested from any guidance step in which a URL is arranged after the second guidance step.
In the above embodiments, when the terminal loads the guidance step, the user needs to manually compare the page of the browser where the guidance step and the guidance step are located to test the task guidance, so that the test efficiency is low, the time consumption is long, and the accuracy cannot be guaranteed. Based on this, as shown in fig. 10, in another embodiment of the method for testing a task guide provided in the embodiment of the present application, the method further includes:
in operation 301, the terminal collects test data of the task guide.
Wherein the test data comprises one or more of: the loading order of the wizard steps, the running state of at least one of the M wizard steps, a screenshot of a page loaded with at least one of the M wizard steps, or the matching degree of the metadata of the element selector with the focused element in the page, wherein the matching degree can be expressed in numerical values. The test data will be described below.
The loading sequence of the guide steps refers to the sequence of the guide steps loaded in the page of the browser by the terminal.
The running state of the guidance step may comprise normal loading of the guidance step and unloading of the guidance step, etc., and in particular the unloading of the guidance step may in turn comprise skipping of the guidance step due to the absence of the focusing element.
The screen shot of the page loaded with the wizard step may be a key frame screen shot, for example, the key frame screen shot may include a screen shot of the first page loaded with the first wizard step (as shown in fig. 5), a screen shot of the second page loaded with the second wizard step (as shown in fig. 7), and a screen shot of the third page loaded with the third wizard step (as shown in fig. 9 (a)).
The metadata of the element selector is used for representing the focusing elements of the guide steps recorded in the test file, and specifically may include information such as characters of the focusing elements, positions of the focusing elements, grades of the focusing elements, numbers of the focusing elements, attributes of the focusing elements, and context of the focusing elements; and the focus element in the page refers to the focus element of the guide step in the actual page. Taking fig. 5 as an example, the focusing element in the first page of the first guidance step is a rectangular interface element representing the target area; taking fig. 7 as an example, the focusing element of the second guidance step in the second page is an interface element representing a quadrangle star of the shop; taking fig. 9(a) as an example, the focusing element of the third wizard step in the third page is a rectangular interface element representing defensive equipment.
It can be understood that when the actual page is completely matched with the task guide, the matching degree of the metadata of the element selector and the focused element in the page is 100%; when the interface element in the actual page is changed, the matching degree of the metadata of the element selector and the focusing element in the page is lower than 100 percent; specifically, the degree of matching of the metadata of the element selector with the focused element in the page may be calculated according to a preset algorithm.
In addition, it should be noted that the terminal may perform operation 301 while performing operations 101 to 106.
In the embodiment of the application, the user can analyze the task guide according to the test data acquired by the terminal, so that the test of the task guide is realized.
In the above embodiment, although the terminal may automatically acquire the test data, the user is still required to manually analyze the task guide according to the test data, so that the problems of low test efficiency, long time consumption and incapability of ensuring accuracy still exist, and based on this, in another embodiment of the automatic test task guide provided in the embodiment of the present application, after the terminal acquires the test data of the task guide, the method further includes:
and operation 302, the terminal analyzes the task guide according to the test data and the preset test base line to obtain an analysis result.
The test baseline is reference data of the test data and can be obtained in the preview process of the task guide; for example, in the process of previewing the task guide, relevant parameters of the task guide during running can be recorded while a preview file of the task guide is running, and based on the fact that the previewing process meets the requirements of a user, the relevant parameters can be saved and used as a test baseline.
The test baseline also includes, in the same dimension as the test data, the loading order of the wizard steps, the running state of at least one of the M wizard steps, a screenshot of the page loaded with at least one of the M wizard steps, or the degree to which the metadata of the element selector matches the focused elements in the page.
It should be noted that, assuming that the task wizard includes M wizard steps, in the test baseline, the loading order of the wizard steps may include only the loading order of X wizard steps, where X is a positive integer smaller than M; specifically, the task guidance is assumed to comprise a first guidance step, a second guidance step, a fourth guidance step and a third guidance step, wherein the fourth guidance step is a guidance step in an abnormal situation; therefore, when the task wizard is normally operated, the first wizard step, the second wizard step and the third wizard step are loaded in sequence, and the fourth wizard step is not loaded, namely, in the test baseline, the loading sequence of the M wizard steps only comprises the loading sequence of the first wizard step, the second wizard step and the third wizard step.
The method for analyzing the task guide by the terminal according to the test data and the preset test base line has various methods, and the analysis method can be different for the test data with different dimensions.
For example, based on the test data including the loading order of the wizard steps, the terminal may analyze the difference between the loading order of the wizard steps in the test data and the loading order of the wizard steps in the test baseline; based on the test data including the operation state of at least one of the M guidance steps, the terminal may analyze a difference between the operation state of the guidance step in the test data and the operation state of the guidance step in the test baseline; based on the test data including the screenshot of the page loaded with at least one of the M wizard steps, the terminal may analyze a difference between the screenshot in the test data and the screenshot in the test baseline according to a position and a color of a pixel in the screenshot; based on how well the test data includes the metadata of the element selector matching the focused element in the page, the terminal may calculate a difference between the degree of matching in the test data and the degree of matching in the test baseline.
For test data with different dimensions, the terminal analyzes the task guide by using different analysis methods to obtain an analysis result, the analysis result may exist in the form of a test report, and specific contents of the analysis result may include multiple types, for example, may include: the conclusion that the test passed or failed, the wizard step that did not exist in the test baseline but existed in the test data, the wizard step that ran abnormally, the difference in the degree of matching of the metadata of the element selector with the focused elements in the page, and the processing recommendations, etc.
For example, when the software product is updated and a focused element of a certain guide step is deleted from a page of a browser, the test file skips the guide step at runtime, but does not affect the loading of other guide steps, and the processing suggestion in the analysis result may be: in the case where it is confirmed that the focused element of the guidance step does not exist in the page of the browser, the guidance step is deleted from the task guidance.
In an embodiment of the present application, the analysis result may indicate a degree of difference between the test data and the preset test baseline, for example, the analysis result may include a difference between a degree of matching between the metadata of the element selector and a focused element in the page and a degree of difference between page shots loaded with the guidance step, and based on that the difference between the degree of matching between the metadata of the element selector and the focused element in the page is smaller than a first threshold and the degree of difference between the page shots loaded with the guidance step is smaller than a second threshold, the degree of difference between the test data and the preset test baseline may be considered to be smaller than the preset degree of difference.
In the embodiment of the application, the terminal can intelligently analyze the task guide according to the test data and the test base line to obtain an analysis result, the test efficiency is high, the time consumption is short, the accuracy is high, and the analysis result can be displayed in a test report mode and can be checked by a user.
In another embodiment of the method for testing a task guide provided in the embodiment of the present application, after the terminal analyzes the task guide according to the test data and the preset test baseline to obtain an analysis result, the method further includes:
in operation 303, based on the analysis result indicating that the degree of difference between the test data and the preset test baseline is less than or equal to the preset degree of difference, the terminal updates the test baseline and/or the metadata of the task guide according to the test data.
It is understood that, when the degree of difference between the test data and the preset test baseline is less than or equal to the preset difference degree, the terminal may update the test baseline and/or the metadata of the task guide according to the test data.
In addition, it should be noted that, in the foregoing embodiments,
for example, referring to fig. 11, another embodiment of a second page loaded with a second wizard step in the embodiments of the present application is shown. Assuming that the software product is updated, the interface element representing the quadrangle star of the store in the second page shown in fig. 7 is changed to the interface element of the hexagon star, i.e., the second page loaded with the second guide step is shown in fig. 11.
Then, in the test data, the focusing element of the second guidance step is an interface element of a hexagon star, and in the test baseline, the focusing element of the second guidance step is an interface element of a quadrangle star, based on which, if the analysis result indicates that the difference degree between the test data and the preset test baseline is less than the preset difference degree, the terminal may update the focusing element of the second guidance step in the test baseline to the interface element of the hexagon star according to the test data, and likewise, the terminal may update the focusing element of the second guidance step in the metadata of the task guidance to the interface element of the hexagon star according to the test data.
It is to be understood that, in order to avoid confusion between the task guide and the test baseline caused by the terminal automatically updating the metadata and the test baseline of the task guide without the user knowing, based on the analysis result indicating that the degree of difference between the test data and the preset test baseline is less than or equal to the preset degree of difference, the terminal updating the metadata of the test baseline and/or the task guide according to the test data may include:
and based on the analysis result, indicating that the difference degree between the test data and the preset test baseline is less than or equal to the preset difference degree, and receiving an updating instruction input by a user, the terminal updates the test baseline and/or the metadata of the task guide according to the test data.
In the embodiment of the application, based on the fact that the difference degree between the analysis result indication test data and the preset test baseline is smaller than or equal to the preset difference degree, the terminal can automatically update the test baseline and/or the metadata of the task guide, so that labor is saved, and efficiency is improved; in addition, the terminal can also update the simulation interactive tutorial according to the analysis result, wherein the simulation interactive tutorial is generated by the terminal according to the screenshot of the page loaded with the guide step.
In another embodiment of the method for testing a task guide provided in the embodiment of the present application, after the terminal analyzes the task guide according to the test data and the preset test baseline to obtain an analysis result, the method further includes:
in operation 304, the terminal generates early warning information based on the analysis result indicating that the degree of difference between the test data and the test baseline is greater than the preset degree of difference.
The early warning information may have various forms, which is not limited in the embodiment of the present application, for example, the early warning information may include a logo, a sound, and the like.
It can be understood that, based on the fact that the difference degree between the test data and the test baseline is greater than the preset difference degree, the metadata of the test baseline and the task guide cannot be updated directly according to the test data, so that the terminal generates the early warning information, and the early warning information can instruct a user to search for the reason causing the difference degree according to the analysis result, so that the metadata of the test baseline and the task guide can be updated as soon as possible, and the task guide is matched with the page of the software product.
Referring to fig. 12, an embodiment of a terminal for testing task guidance in an embodiment of the present application is schematically illustrated, and as shown in fig. 12, an embodiment of the present application provides a terminal for generating task guidance, where the task guidance includes M guidance steps, the M guidance steps include a first guidance step and a second guidance step, the second guidance step is a guidance step next to the first guidance step, and M is an integer greater than 1;
the terminal includes: a loading unit 401, configured to load a first guidance step in a first page of a browser, where the first guidance step indicates to perform a first operation on the first page, and an event object corresponding to the first operation is used to enable the browser to refresh a second page;
a generating unit 402, configured to generate an event object corresponding to the first operation according to the first guiding step, so that the browser refreshes the second page;
the loading unit 401 is further configured to load the second guidance step in the second page.
The embodiment of the application provides another embodiment of a terminal of a test task guide, in the embodiment, M is an integer greater than 2, and a second page corresponds to a first URL; the terminal further includes:
a determining unit 403, configured to determine, based on the second guiding step exception being loaded, a third guiding step corresponding to a second URL from the M guiding steps, where the third guiding step is subsequent to the second guiding step, the second URL is one of preset N URLs and is different from the first URL, where N is a positive integer;
the loading unit 401 is further configured to control the browser to load a third page according to the second URL;
the loading unit 401 is further configured to load the third guidance step in the third page.
The embodiment of the present application provides another embodiment of a terminal for a test task guide, where in this embodiment, the terminal further includes:
a determining unit 403, configured to determine a third URL corresponding to the first guiding step from preset N URLs, where N is a positive integer;
the loading unit 401 is further configured to control the browser to load the first page according to the third URL.
The embodiment of the present application provides another embodiment of a terminal for a test task guide, where in this embodiment, the terminal further includes: an acquisition unit 404, configured to acquire test data of the task guide;
the test data includes one or more of: a loading order of the wizard steps, an operating state of at least one of the M wizard steps, a screenshot of a page loaded with at least one of the M wizard steps, or a degree of matching of metadata of the element selector to focused elements in the page.
The embodiment of the present application provides another embodiment of a terminal for a test task guide, where in this embodiment, the terminal further includes: and the analysis unit 405 is configured to analyze the task guide according to the test data and a preset test baseline to obtain an analysis result.
The embodiment of the present application provides another embodiment of a terminal for a test task guide, where in this embodiment, the terminal further includes: and the updating unit 406 is configured to update the test baseline and/or the metadata of the task guide according to the test data based on the analysis result indicating that the degree of difference between the test data and the preset test baseline is less than or equal to the preset degree of difference.
In this embodiment, the generating unit 402 is further configured to generate the warning information based on that the analysis result indicates that the difference degree between the test data and the test baseline is greater than the preset difference degree.
Referring to fig. 13, an embodiment of a terminal device in the embodiment of the present application may include one or more processors 501, a memory 502, and a communication interface 503.
Memory 502 may be transient or persistent storage. Still further, the processor 501 may be configured to communicate with the memory 502 to execute a series of instruction operations in the memory 502 on the terminal device.
In this embodiment, the processor 501 may execute the operations executed by the terminal of the test task guide in the embodiment shown in fig. 12, which is not described herein again.
In this embodiment, the specific functional module division in the processor 501 may be similar to the functional module division of the module described in fig. 12, and is not described here again.
An embodiment of the present application further provides a chip or a chip system, where the chip or the chip system includes at least one processor and a communication interface, the communication interface and the at least one processor are interconnected through a line, and the at least one processor is configured to run a computer program or an instruction to execute operations executed by the terminal of the test task guide in the embodiment shown in fig. 12, which is not described herein again in detail.
The communication interface in the chip may be an input/output interface, a pin, a circuit, or the like.
The embodiments of the present application further provide a first implementation manner of a chip or a chip system, where the chip or the chip system described above in the present application further includes at least one memory, and the at least one memory stores instructions therein. The memory may be a storage unit inside the chip, such as a register, a cache, etc., or may be a storage unit of the chip (e.g., a read-only memory, a random access memory, etc.).
Embodiments of the present application also provide a computer storage medium for storing computer software instructions for a terminal of the above-described test task guide, which includes a program designed for executing the terminal of the test task guide.
The terminal of the test task guide may be as described above for fig. 12.
Embodiments of the present application also provide a computer program product, which includes computer software instructions that can be loaded by a processor to implement the flow of the methods in fig. 2, fig. 3 and fig. 10.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other manners. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of the units is only one logical division, and other divisions may be realized in practice, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be substantially implemented or contributed to by the prior art, or all or part of the technical solution may be embodied in a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.