Disclosure of Invention
The disclosure provides a mobile terminal automatic test method, a mobile terminal automatic test device, electronic equipment and a storage medium, so as to at least solve the problem of low compatibility of the mobile terminal automatic test method in the related technology. The technical scheme of the present disclosure is as follows:
in a first aspect, a mobile terminal automation test method is provided, including:
acquiring a task to be tested and displaying a corresponding test interface on a mobile terminal;
acquiring a current step to be tested of the task to be tested and an indicative element corresponding to the current step to be tested, and performing image recognition on the test interface to determine an element matched with the indicative element on the test interface as a target indicative element;
triggering the target indicative element and executing the current step to be tested.
In an optional embodiment, the image identifying the test interface to determine an element on the test interface that matches the indicative element as a target indicative element includes: acquiring test script information matched with the current step to be tested; the test script information stores at least one element image of an indicative element; based on the test script information, comparing each indicative element on the test interface with the element image in the image recognition mode, and taking the indicative element matched with the element image on the test interface as the target indicative element.
In an alternative embodiment, the triggering the target indicative element, performing the current step to be tested, includes: based on the test script information, acquiring a trigger instruction which is matched with the current step to be tested and is aimed at the element image; and triggering the target indicative element by using the triggering instruction, and executing the current step to be tested.
In an optional embodiment, the triggering the target indicator element by using the triggering instruction, performing the current step to be tested includes: acquiring an image position of an element image of a target indicative element in a test interface; and implementing a trigger instruction in the image position to execute the current step to be tested.
In an alternative embodiment, the task to be tested comprises a plurality of steps to be tested; after the step of performing the current step to be tested, the method further includes: displaying an execution interface after the current step to be tested is executed on the mobile terminal; if the current step to be tested is not the last step to be tested, determining a test result of the current step to be tested based on the execution interface; the last step to be tested is the last step to be tested in the task to be tested; and if the test result of the current step to be tested is that the test is successful, taking the execution interface as a test interface of the next step to be tested.
In an alternative embodiment, the task to be tested comprises a plurality of steps to be tested; after the step of performing the current step to be tested, the method further includes: displaying an execution interface after the current step to be tested is executed on the mobile terminal; if the current step to be tested is not the last step to be tested, determining a test result of the current step to be tested based on the execution interface; the last step to be tested is the last step to be tested in the task to be tested; and if the test result of the current step to be tested is that the test is successful, taking the execution interface as a test interface of the next step to be tested.
In an alternative embodiment, the mobile terminal automated testing method further comprises: if the test result of the current step to be tested is a test failure, uploading the test result of the current step to be tested to a first server.
In an alternative embodiment, the mobile terminal automated testing method further comprises: and if the current step to be tested is the last step to be tested, taking the test result of the current step to be tested as the test result of the task to be tested, and uploading the test result of the task to be tested to a first server.
In an alternative embodiment, the mobile terminal automated testing method further comprises: and uploading the image of the test interface and the image of the execution interface to a second server for storage.
In an optional embodiment, the acquiring the task to be tested and displaying the corresponding test interface on the mobile terminal includes: receiving the task to be tested from a third server; determining a target template to be tested corresponding to the task to be tested from a plurality of preset templates to be tested according to the task to be tested; and determining a test interface corresponding to the task to be tested and a step to be tested according to the target template to be tested, and displaying the corresponding test interface.
In a second aspect, a mobile terminal automatic testing device is provided, including:
the test task acquisition unit is configured to perform acquisition of a task to be tested and display a corresponding test interface on the mobile terminal;
the indicating element determining unit is configured to execute a current to-be-tested step of the task to be tested and indicating elements corresponding to the current to-be-tested step, and perform image recognition on the test interface to determine elements matched with the indicating elements on the test interface as target indicating elements;
And the test step execution unit is configured to execute the current step to be tested by triggering the target indicative element.
In an optional embodiment, the indication element determining unit is further configured to perform obtaining test script information matching the current step to be tested; the test script information stores at least one element image of an indicative element; based on the test script information, comparing each indicative element on the test interface with the element image in the image recognition mode, and taking the indicative element matched with the element image on the test interface as the target indicative element.
In an optional embodiment, the test step execution unit is further configured to execute, based on the test script information, acquiring a trigger instruction for the element image that matches the current step to be tested; and triggering the target indicative element by using the triggering instruction, and executing the current step to be tested.
In an optional embodiment, the test step execution unit is further configured to execute acquiring an image position of the element image of the target indicative element in the test interface; and implementing the trigger instruction in the image position to execute the current step to be tested.
In an alternative embodiment, the task to be tested comprises a plurality of steps to be tested; the mobile terminal automatic testing device further comprises: the execution interface switching unit is configured to execute an execution interface after the current step to be tested is executed on the mobile terminal; if the current step to be tested is not the last step to be tested, determining a test result of the current step to be tested based on the execution interface; the last step to be tested is the last step to be tested in the task to be tested; and if the test result of the current step to be tested is that the test is successful, taking the execution interface as a test interface of the next step to be tested.
In an optional embodiment, the mobile terminal automatic test device further includes: and the test result uploading module is configured to execute the step of uploading the test result of the current step to be tested to the first server if the test result of the current step to be tested is a test failure.
In an optional embodiment, the test result uploading module is further configured to execute, if the current step to be tested is the last step to be tested, to upload the test result of the current step to be tested to the first server as the test result of the task to be tested.
In an optional embodiment, the mobile terminal automatic test device further includes: and the test image uploading module is configured to upload the image of the test interface and the image of the execution interface to a second server for storage.
In an alternative embodiment, the test task obtaining unit is further configured to perform receiving the task to be tested from a third server; determining a target template to be tested corresponding to the task to be tested from a plurality of preset templates to be tested according to the task to be tested; and determining a test interface corresponding to the task to be tested and a step to be tested according to the target template to be tested, and displaying the corresponding test interface.
In a third aspect, there is provided an electronic device comprising: a processor; a memory for storing the processor-executable instructions; wherein the processor is configured to execute the instructions to implement the mobile-end automated test method described in any of the embodiments of the first aspect.
In a fourth aspect, a storage medium is provided, which when executed by a processor of an electronic device, enables the electronic device to perform the mobile-end automated test method described in any one of the embodiments of the first aspect.
In a fifth aspect, a computer program product is provided, the program product comprising a computer program stored in a readable storage medium, from which at least one processor of a device reads and executes the computer program, such that the device performs the mobile-side automated test method as described in any of the embodiments of the first aspect.
The technical scheme provided by the embodiment of the disclosure at least brings the following beneficial effects:
acquiring a task to be tested and displaying a corresponding test interface on the mobile terminal; acquiring a current step to be tested of a task to be tested and indicative elements corresponding to the current step to be tested, and carrying out image recognition on a test interface to determine elements matched with the indicative elements on the test interface as target indicative elements; triggering the target indicative element, and executing the current step to be tested. The mobile terminal automatic test method provided by the disclosure can determine the indicative elements on the test interface in an image recognition mode and trigger the indicative elements to execute the test steps without depending on an operating system interface, so that the compatibility of the mobile terminal automatic test can be improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Detailed Description
In order to enable those skilled in the art to better understand the technical solutions of the present disclosure, the technical solutions of the embodiments of the present disclosure will be clearly and completely described below with reference to the accompanying drawings.
It should be noted that the terms "first," "second," and the like in the description and claims of the present disclosure and in the foregoing figures are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments of the disclosure described herein may be capable of operation in sequences other than those illustrated or described herein. The implementations described in the following exemplary examples are not representative of all implementations consistent with the present disclosure. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present disclosure as detailed in the accompanying claims.
The mobile terminal automatic test method provided by the disclosure can be applied to an application environment as shown in fig. 1. Whereinmobile terminal 101 interacts withserver 102 over a network. Specifically, theserver 102 may issue a task to be tested to themobile terminal 101, and the mobile terminal may display a corresponding test interface according to the task to be tested, and find an indicative element matched with the current test step on the test interface in an image recognition manner, and trigger the current test step. After the test is completed,mobile terminal 101 may upload the test result toserver 102. Themobile terminal 101 may be, but not limited to, various types of handsets, and theserver 102 may be implemented by a stand-alone server or a server cluster formed by a plurality of servers.
Fig. 2 is a flowchart illustrating a mobile terminal automation test method according to an exemplary embodiment, and the mobile terminal automation test method is used in themobile terminal 101 as shown in fig. 2, and includes the following steps.
In step S201, themobile terminal 101 obtains a task to be tested and displays a corresponding test interface on themobile terminal 101.
The task to be tested refers to an automatic test task that needs to be executed by themobile terminal 101, and the task may be generated by a user of the mobile terminal through a test program installed on the mobile terminal and used for automatic test, or may be issued by aserver 102 connected with themobile terminal 101 in a communication manner, where the test interface is an interface displayed during the process of executing the automatic test on the task to be tested by the mobile terminal, and themobile terminal 101 may obtain the task to be tested that needs to complete the automatic test and display a corresponding test interface.
In step S202, themobile terminal 101 obtains a current step to be tested of the task to be tested and an indicative element corresponding to the current step to be tested, and performs image recognition on the test interface to determine an element on the test interface that matches the indicative element as a target indicative element.
The indicative elements refer to some design elements displayed on the interface by themobile terminal 101 for informing, guiding, and indicating that the user implements a certain pre-designed function through the mobile terminal, for example, a call icon displayed on the interface of themobile terminal 101 may be a part of the indicative elements, the user may click on the call icon to enter a dialing interface of a mobile phone call, and a play button displayed on the video playing interface by themobile terminal 101 may be a part of the indicative elements, and the user may play a video by clicking on the play button, or the like.
Specifically, after themobile terminal 101 obtains the task to be tested, the current step to be tested may be determined first, and one task to be tested may include a plurality of steps to be tested, for example, for a mobile phone call function of the mobile terminal to be tested, a plurality of steps to be tested are needed, a mobile phone dialing interface is needed to be entered first, then the mobile phone number is input, and a dialing key is clicked to complete dialing, so for this task to be tested, the current step to be tested and only the sex element corresponding to the current step to be tested need to be determined first. If the current step to be tested is to enter the dialing interface of the mobile phone, the corresponding indicative element is an icon of a certain mobile phone style, and if the current step to be tested is to complete the input of the mobile phone number, the corresponding indicative element can be a plurality of number keys.
Because various indicative elements may be displayed on the interface of themobile terminal 101, including a phone style icon entering a dialing interface, or an information style icon entering a short message input interface, etc., themobile terminal 101 needs to determine the indicative element corresponding to the current step to be tested first, and determine the element matching with the indicative element on the test interface by means of image recognition, for example, the current step to be tested needs to enter the phone dialing interface, and then themobile terminal 101 can find the phone style icon by means of image recognition as the target indicative element.
In step S203, themobile terminal 101 triggers the target indicative element to execute the current step to be tested.
Themobile terminal 101 finds the target indicative element on the test interface, and may perform a triggering operation on the obtained target indicative element to execute the current step to be tested.
In the mobile terminal automatic test method, themobile terminal 101 obtains a task to be tested and displays a corresponding test interface on the mobile terminal; acquiring a current step to be tested of a task to be tested and indicative elements corresponding to the current step to be tested, and carrying out image recognition on a test interface to determine elements matched with the indicative elements on the test interface as target indicative elements; triggering the target indicative element, and executing the current step to be tested. The mobile terminal automatic test method provided by the disclosure can determine the indicative elements on the test interface in an image recognition mode and trigger the indicative elements to execute the test steps without depending on an operating system interface, so that the compatibility of the mobile terminal automatic test can be improved.
In an exemplary embodiment, as shown in fig. 3, in step S202, themobile terminal 101 performs image recognition on the test interface to determine an element on the test interface that matches with the indicative element, and the element is used as the target indicative element, which may be specifically implemented by the following steps:
in step S301, themobile terminal 101 obtains test script information matched with the current step to be tested; the test script information stores therein an element image of at least one indicative element.
The test script information may be an automated test script pre-compiled by the user for executing different tasks to be tested, and may be pre-stored in themobile terminal 101. The different steps to be tested may also correspond to test script information, respectively, which may be compiled in a manner that triggers an element image of a certain indicative element. After themobile terminal 101 obtains the current step to be tested, the matched test script information can be obtained according to the current step to be tested, and the element image of the indicative element included in the test script information can be read out.
In step S302, themobile terminal 101 compares each indicative element on the test interface with the element image by using the image recognition method based on the test script information, and uses the indicative element on the test interface that matches the element image as the target indicative element.
Specifically, after obtaining the test script information, themobile terminal 101 may perform a one-to-one comparison with each indicative element on the test interface according to the element image of the indicative element carried in the script information, to find the indicative element on the test interface that matches with the element image, as the target indicative element. For example, if a test for entering a dialing interface of a mobile phone needs to be executed, a user may pre-write script information for triggering an indicative element of a mobile phone style icon, and when the test is performed, themobile terminal 101 may obtain an element image of the mobile phone style icon from the script information, and find, based on the element image, an indicative element on the test interface that matches with the element image of the mobile phone style icon in a mode of image recognition matching, as a target indicative element.
And, step S203 may include: themobile terminal 101 acquires a trigger instruction which is matched with the current step to be tested and is specific to the element image based on the test script information; and triggering the target indicative element by using the triggering instruction, and executing the current step to be tested.
The triggering instruction is an instruction for triggering the indicative element displayed on themobile terminal 101, and may include various types of instructions, such as drag-and-drop, clicking, long-press, etc., of the indicative element, and the test script information may store various types of triggering instructions for element images of the indicative element, which are respectively used for executing different steps to be tested. Specifically, after themobile terminal 101 obtains the test script information, a trigger instruction for an element image in the current test step may be read from the test script information, and the trigger instruction is utilized to perform a trigger operation on the target indicative element, and execute the current step to be tested.
Further, themobile terminal 101 triggers the target indicative element by using the trigger instruction, and executes the current step to be tested, which may further include: themobile terminal 101 acquires the image position of an element image of a target indicative element in a test interface; and implementing a trigger instruction in the image position to execute the current step to be tested.
The image position refers to an image position of an element image of the target indicative element on themobile terminal 101, where the image position is displayed on the corresponding test interface, and may be represented by coordinate position information. Specifically, after themobile terminal 101 obtains the element image of the target indicative element by means of image recognition, coordinate position information of the element image on the test interface may be recorded at the same time, as an image position of the target indicative element, and a trigger instruction obtained by themobile terminal 101 is implemented in the image position, so as to execute the current step to be tested.
In the above embodiment, themobile terminal 101 may perform image recognition on the target indicative element based on the element image of the indicative element in the test script information, to obtain the image position of the target indicative element in the test interface, and implement the trigger instruction matched with the test script information on the position, so as to execute the current step to be tested, so that the stability and accuracy of the automated test of the mobile terminal may be improved while the compatibility is ensured without depending on the operating system interface to complete the automated test.
In an exemplary embodiment, the task to be tested includes a plurality of steps to be tested, as shown in fig. 4, after step S203, the mobile terminal automated testing method may further include the following steps:
in step S401, themobile terminal 101 displays an execution interface after executing the current step to be tested on themobile terminal 101.
For example, as shown in fig. 5, in an automated testing process for dialing a mobile phone, if the current step to be tested is to enter the dialing interface of the mobile phone by clicking an indicative element triggering a phone style icon, the dialing interface of the mobile phone is the executing interface after the current step to be tested, and if the current step to be tested is to enter the phone call interface by clicking an indicative element triggering a call style icon, the phone call interface is the executing interface after the current step to be tested. Specifically, after themobile terminal 101 executes the current step to be tested, the test interface displayed on themobile terminal 101 may be switched to the execution interface displayed after the execution of the current step to be tested is completed.
In step S402, if the current step to be tested is not the last step to be tested, themobile terminal 101 determines a test result of the current step to be tested based on the execution interface; the last step to be tested is the last step to be tested in the task to be tested.
The last test step refers to the last test step of themobile terminal 101 in the whole task to be tested. Specifically, themobile terminal 101 may determine whether the current step to be tested is the last step to be tested in the whole task to be tested, then themobile terminal 101 may determine whether the test result is successful according to the displayed execution interface, if an indicating element triggering the mobile phone style icon appears, but a short message input interface is entered, the test failure is described, if a dial input interface appears, the test is indicated to be successful, after themobile terminal 101 executes each current step to be tested, the test result of the current step to be tested may be determined according to the displayed execution interface.
In step S403, if the test result of the current step to be tested is that the test is successful, themobile terminal 101 uses the execution interface as the test interface of the next step to be tested.
Because the current step to be tested is not the last step to be tested in the task to be tested by the mobile terminal, after the execution of the current step to be tested is completed to obtain the execution interface, if the test result of the current step to be tested is judged to be successful, the next step to be tested needs to be continuously executed until the current step to be tested is the last step to be tested, and meanwhile, the obtained execution interface can also be used as the test interface of the next step to be tested so as to continuously execute the next step to be tested.
If the test result of the current step to be tested obtained in step S402 is a test failure, themobile terminal 101 uploads the test result of the current step to be tested to the first server.
The first server is a platform server for storing an automated test result of themobile terminal 101, and may be a part of components in theserver 102, when the test result of the current step to be tested is a test failure, the test failure result may be uploaded to the first server for storage, and the first server may display the automated test result and a corresponding progress of the automated test.
In addition, if the current step to be tested is the last step to be tested, themobile terminal 101 takes the test result of the current step to be tested as the test result of the task to be tested, and uploads the test result of the task to be tested to the first server.
If the current step to be tested is the last step to be tested, that is, after the current step to be tested is completed, the task to be tested of themobile terminal 101 is also completed, then themobile terminal 101 can use the test result of the current step to be tested as the test result of the whole task to be tested, if the test result of the current step to be tested is successful, the test result of the whole task to be tested is successful, and if the test result of the current step to be tested is failed, the test result of the whole task to be tested is failed, and the terminal can upload the obtained test result of the task to be tested to the first server for storing the test result.
Meanwhile, the method in this embodiment may further include: themobile terminal 101 uploads the image of the test interface and the image of the execution interface to the second server for storage.
The second server is mainly a cloud server for storing test files generated in the process of automatic testing, for example, a server for testing pictures, and may also be one of the components in theserver 102. After the mobile terminal 101 finishes executing the current step to be tested to obtain the execution interface, the image of the test interface and the image of the execution interface, for example, the screenshot of the test interface and the execution interface, may be uploaded to the second server for storage.
In the above embodiment, themobile terminal 101 may use the execution interface obtained after executing the current step to be tested as the test interface corresponding to the next step to be tested, so as to ensure continuity of the automated test process, and in addition, may obtain the test result of the current step to be tested according to the obtained execution interface, and upload the test result and the execution interface obtained in the test process to the first server and the second server for storage, so that traceability of the automated test result of themobile terminal 101 may be improved.
In an exemplary embodiment, as shown in fig. 6, step S201 may be specifically implemented by:
in step S601, themobile terminal 101 receives a task to be tested from a third server.
The third server may be a task management platform for distributing tasks to be tested, may be used for managing one or moremobile terminals 101 for performing automated tests, and may be an integral part of theserver 102. Specifically, the third server may send the preconfigured automated test task as a task to be tested to themobile terminal 101, and themobile terminal 101 may execute the automated test according to the received task to be tested.
In step S602, themobile terminal 101 determines, according to the task to be tested, a target template to be tested corresponding to the task to be tested from a plurality of templates to be tested.
The number of templates to be tested can be a plurality of templates which can be preset by a user and respectively correspond to the automatic tests executed under different application scenes in different application software, for example, the templates to be tested can comprise: template A to be tested, template B to be tested and template C to be tested, wherein template A to be tested corresponds to the automatic test flow which needs to be executed by application software A inscene 1, template B to be tested corresponds to the automatic test flow which needs to be executed by application software A inscene 2, template C to be tested can be the automatic test flow which needs to be executed by application software C inscene 1, and the like. The user may configure a plurality of templates to be tested for themobile terminal 101 in advance, and after themobile terminal 101 obtains a task to be tested sent by the third server, the template to be tested corresponding to the obtained test task may be obtained from the stored plurality of templates to be tested and used as a target template to be tested.
In step S603, themobile terminal 101 determines a test interface corresponding to the task to be tested and a step to be tested according to the target template to be tested, and displays the corresponding test interface.
After themobile terminal 101 obtains the target template to be tested, the corresponding test interface and the current step to be tested can be determined according to the target template to be tested, and meanwhile, the test interface is displayed. For example, the target to-be-tested template is an application scenario of the mobile terminal call program for dialing from the desktop, and then themobile terminal 101 can determine and display the desktop of themobile terminal 101 as a test interface according to the target to-be-tested template, and determine that the current to-be-tested step is to enter the dialing interface of the mobile phone by triggering the indicative element of the mobile phone style icon.
In the above embodiment, themobile terminal 101 may configure a plurality of templates to be tested in advance, and after receiving a task to be tested from the third server, the mobile terminal may find a corresponding target template to be tested from the pre-stored plurality of templates to be tested directly, and display a corresponding test interface and obtain a current step to be tested, so that the efficiency of automatic testing of the mobile terminal may be improved, and when the process of automatic testing needs to be modified, the expandability of the automatic testing process of the mobile terminal may be further improved by only modifying the template to be tested, without modifying the whole testing process.
Fig. 7 is a flowchart of a mobile terminal automation test method according to an exemplary embodiment, and the mobile terminal automation test method is used in themobile terminal 101 as shown in fig. 7, and includes the following steps.
In step S701, themobile terminal 101 receives a task to be tested from a third server; according to the task to be tested, determining a target template to be tested corresponding to the task to be tested from a plurality of preset templates to be tested;
in step S702, themobile terminal 101 determines a test interface corresponding to a task to be tested and a step to be tested according to a target template to be tested, and displays the corresponding test interface;
in step S703, themobile terminal 101 acquires test script information that matches the current step to be tested; the test script information stores at least one element image of an indicative element;
in step S704, themobile terminal 101 compares each indicative element on the test interface with the element image in the image recognition manner based on the test script information, and uses the indicative element on the test interface matched with the element image as the target indicative element;
in step S705, themobile terminal 101 obtains a trigger instruction for an element image that matches the current step to be tested based on the test script information;
In step S706, themobile terminal 101 acquires an image position of an element image of the target indicative element in the test interface; implementing a trigger instruction in the image position to execute the current step to be tested; displaying an execution interface after executing the current step to be tested on themobile terminal 101; uploading the tested interface and the execution interface to a second server in an image form for storage;
in step S707, if the current step to be tested is not the last step to be tested, themobile terminal 101 determines a test result of the current step to be tested based on the execution interface; the last step to be tested is the last step to be tested in the task to be tested;
in step S708, if the test result of the current step to be tested is that the test is successful, themobile terminal 101 uses the execution interface as the test interface of the next step to be tested;
in step S709, if the current step to be tested is the last step to be tested, themobile terminal 101 takes the test result of the current step to be tested as the test result of the task to be tested, and uploads the test result of the task to be tested to the first server.
In the above embodiment, themobile terminal 101 may determine the indicative element on the test interface and trigger the indicative element by using the image recognition manner to execute the test step, without relying on the operating system interface, so that the compatibility of the automated test of the mobile terminal may be improved, and image recognition may be performed on the target indicative element to obtain the image position of the target indicative element in the test interface, and trigger the trigger instruction matched with the test script information on the position to execute the current step to be tested, so that the stability and accuracy of the automated test of the mobile terminal may be improved. Meanwhile, the execution interface obtained after the current step to be tested is executed can be used as a test interface corresponding to the next step to be tested, so that the continuity of an automatic test process is ensured, and the test result and the execution interface obtained in the test process are respectively uploaded to the first server and the second server for storage, so that the traceability of the automatic test result of themobile terminal 101 can be improved. Finally, a plurality of templates to be tested can be configured in advance, so that the efficiency of automatic testing of the mobile terminal can be improved, and when the process of automatic testing needs to be modified, the expansibility of the process of automatic testing of the mobile terminal can be further improved by only modifying the templates to be tested without modifying the whole testing flow.
In an exemplary embodiment, there is also provided a mobile terminal automation test method, which may be applied to test an application employing a hybrid stack technology, as shown in fig. 8, and may include the steps of:
step a: the task management platform issues a test task to the test node;
step b: the test node receives the task list, and runs the test script to circularly consume the test task;
step c: the test node tests according to the test task, dynamically acquires indicative elements such as buttons, pictures, progress and the like by capturing a screen of the current equipment and using an image recognition algorithm, finds the position of the indicative element by utilizing the pre-acquired indicative elements for generating key steps on the automatic link, and operates the indicative element;
step d: the test node gathers the report platforms of the automatic test result, the process, the result file and the like;
step e: and after all the task lists are processed, the task management platform can display the total task progress and result.
The automatic testing method for the mobile terminal can realize the normal operation of the automatic testing of equipment with different brands, different resolutions and different systems, thereby improving the compatibility and the stability of the automatic testing scheme of the mobile terminal.
It should be understood that, although the steps in the flowcharts of this disclosure are shown in order as indicated by the arrows, these steps are not necessarily performed in order as indicated by the arrows. The steps are not strictly limited to the order of execution unless explicitly recited herein, and the steps may be executed in other orders. Moreover, at least a portion of the steps in the figures may include steps or stages that are not necessarily performed at the same time, but may be performed at different times, nor does the order in which the steps or stages are performed necessarily performed in sequence, but may be performed alternately or alternately with other steps or at least a portion of the steps or stages in other steps.
FIG. 9 is a block diagram of a mobile end automated test equipment, according to an example embodiment. Referring to fig. 9, the apparatus includes a testtask acquisition unit 901, an instructionelement determination unit 902, and a teststep execution unit 903.
The testtask acquisition unit 901 is configured to perform acquisition of a task to be tested and display a corresponding test interface on the mobile terminal;
the indicatingelement determining unit 902 is configured to perform image recognition on the test interface to determine an element matched with the indicating element on the test interface as a target indicating element, wherein the indicating element corresponds to the current step to be tested and the current step to be tested of the task to be tested;
The teststep execution unit 903 is configured to execute the trigger target indicative element, and execute the current step to be tested.
In an exemplary embodiment, the indicationelement determining unit 902 is further configured to perform obtaining test script information matching the current step to be tested; the test script information stores at least one element image of an indicative element; based on the test script information, comparing each indicative element on the test interface with the element image in an image recognition mode, and taking the indicative element matched with the element image on the test interface as a target indicative element.
In an exemplary embodiment, the teststep execution unit 903 is further configured to execute, based on the test script information, acquiring a trigger instruction for the element image that matches the current step to be tested; and triggering the target indicative element by using the triggering instruction, and executing the current step to be tested.
In an exemplary embodiment, the teststep execution unit 903 is further configured to obtain an image position of the element image of the target indicative element in the test interface; and implementing the trigger instruction in the image position to execute the current step to be tested.
In an exemplary embodiment, the task to be tested includes a plurality of steps to be tested; automatic testing arrangement of mobile terminal still includes: the execution interface switching unit is configured to execute an execution interface after the current step to be tested is executed on the mobile terminal; if the current step to be tested is not the last step to be tested, determining a test result of the current step to be tested based on an execution interface; the last step to be tested is the last step to be tested in the task to be tested; and if the test result of the current step to be tested is that the test is successful, the execution interface is used as the test interface of the next step to be tested.
In an exemplary embodiment, the mobile terminal automated test equipment further includes: and the test result uploading module is configured to execute the step of uploading the test result of the current step to be tested to the first server if the test result of the current step to be tested is the test failure.
In an exemplary embodiment, the test result uploading module is further configured to execute, if the current step to be tested is the last step to be tested, to upload the test result of the task to be tested to the first server with the test result of the current step to be tested as the test result of the task to be tested.
In an exemplary embodiment, the mobile terminal automated test equipment further includes: and the test image uploading module is configured to upload the image of the test interface and the image of the execution interface to the second server for storage.
In an exemplary embodiment, the testtask acquisition unit 901 is further configured to perform receiving a task to be tested from the third server; according to the task to be tested, determining a target template to be tested corresponding to the task to be tested from a plurality of preset templates to be tested; and determining a test interface and a step to be tested corresponding to the task to be tested according to the target template to be tested, and displaying the corresponding test interface.
The specific manner in which the various modules perform the operations in the apparatus of the above embodiments have been described in detail in connection with the embodiments of the method, and will not be described in detail herein.
Fig. 10 is a block diagram illustrating anapparatus 1000 for mobile-end automated testing, according to an example embodiment. For example, thedevice 1000 may be a mobile phone.
Referring to fig. 10,device 1000 may include one or more of the following components: aprocessing component 1002, amemory 1004, apower component 1006, amultimedia component 1008, anaudio component 1010, an input/output (I/O)interface 1012, asensor component 1014, and acommunication component 1016.
Theprocessing component 1002 generally controls overall operation of thedevice 1000, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. Theprocessing component 1002 can include one ormore processors 1020 to execute instructions to perform all or part of the steps of the methods described above. Further, theprocessing component 1002 can include one or more modules that facilitate interaction between theprocessing component 1002 and other components. For example, theprocessing component 1002 can include a multimedia module to facilitate interaction between themultimedia component 1008 and theprocessing component 1002.
Thememory 1004 is configured to store various types of data to support operations at thedevice 1000. Examples of such data include instructions for any application or method operating ondevice 1000, contact data, phonebook data, messages, pictures, video, and the like. Thememory 1004 may be implemented by any type or combination of volatile or nonvolatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic disk, or optical disk.
Thepower supply component 1006 provides power to the various components of thedevice 1000. Thepower components 1006 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for thedevice 1000.
Themultimedia component 1008 includes a screen between thedevice 1000 and the user that provides an output interface. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive input signals from a user. The touch panel includes one or more touch sensors to sense touches, swipes, and gestures on the touch panel. The touch sensor may sense not only the boundary of a touch or slide action, but also the duration and pressure associated with the touch or slide operation. In some embodiments, themultimedia assembly 1008 includes a front-facing camera and/or a rear-facing camera. The front camera and/or the rear camera may receive external multimedia data when thedevice 1000 is in an operational mode, such as a photographing mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have focal length and optical zoom capabilities.
Theaudio component 1010 is configured to output and/or input audio signals. For example, theaudio component 1010 includes a Microphone (MIC) configured to receive external audio signals when thedevice 1000 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may be further stored inmemory 1004 or transmitted viacommunication component 1016. In some embodiments, theaudio component 1010 further comprises a speaker for outputting audio signals.
The I/O interface 1012 provides an interface between theprocessing assembly 1002 and peripheral interface modules, which may be a keyboard, click wheel, buttons, and the like. These buttons may include, but are not limited to: homepage button, volume button, start button, and lock button.
Thesensor assembly 1014 includes one or more sensors for providing status assessment of various aspects of thedevice 1000. For example, thesensor assembly 1014 may detect an on/off state of thedevice 1000, a relative positioning of the components, such as a display and keypad of thedevice 1000, thesensor assembly 1014 may also detect a change in position of thedevice 1000 or a component of thedevice 1000, the presence or absence of user contact with thedevice 1000, an orientation or acceleration/deceleration of thedevice 1000, and a change in temperature of thedevice 1000. Thesensor assembly 1014 may include a proximity sensor configured to detect the presence of nearby objects in the absence of any physical contact. Thesensor assembly 1014 may also include a light sensor, such as a CMOS or CCD image sensor, for use in imaging applications. In some embodiments, thesensor assembly 1014 can also include an acceleration sensor, a gyroscopic sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
Thecommunication component 1016 is configured to facilitate communication between thedevice 1000 and other devices, either wired or wireless. Thedevice 1000 may access a wireless network based on a communication standard, such as WiFi, an operator network (e.g., 2G, 3G, 4G, or 5G), or a combination thereof. In one exemplary embodiment, thecommunication component 1016 receives broadcast signals or broadcast-related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, thecommunication component 1016 further includes a Near Field Communication (NFC) module to facilitate short range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, ultra Wideband (UWB) technology, bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, theapparatus 1000 may be implemented by one or more Application Specific Integrated Circuits (ASICs), digital Signal Processors (DSPs), digital Signal Processing Devices (DSPDs), programmable Logic Devices (PLDs), field Programmable Gate Arrays (FPGAs), controllers, microcontrollers, microprocessors, or other electronic elements for executing the methods described above.
In an exemplary embodiment, a non-transitory computer readable storage medium is also provided, such asmemory 1004, including instructions executable byprocessor 1020 ofdevice 1000 to perform the above-described method. For example, the non-transitory computer readable storage medium may be ROM, random Access Memory (RAM), CD-ROM, magnetic tape, floppy disk, optical data storage device, etc.
Other embodiments of the disclosure will be apparent to those skilled in the art from consideration of the specification and practice of the disclosure disclosed herein. This application is intended to cover any adaptations, uses, or adaptations of the disclosure following, in general, the principles of the disclosure and including such departures from the present disclosure as come within known or customary practice within the art to which the disclosure pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the disclosure being indicated by the following claims.
It is to be understood that the present disclosure is not limited to the precise arrangements and instrumentalities shown in the drawings, and that various modifications and changes may be effected without departing from the scope thereof. The scope of the present disclosure is limited only by the appended claims.