CN115858397A - APP automatic test method and device and automatic test system - Google Patents

APP automatic test method and device and automatic test system Download PDF

Info

Publication number
CN115858397A
CN115858397A CN202310053171.XA CN202310053171A CN115858397A CN 115858397 A CN115858397 A CN 115858397A CN 202310053171 A CN202310053171 A CN 202310053171A CN 115858397 A CN115858397 A CN 115858397A
Authority
CN
China
Prior art keywords
app
page display
test
display element
tool
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN202310053171.XA
Other languages
Chinese (zh)
Other versions
CN115858397B (en
Inventor
吴华建
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Yincheng Network Technology Co Ltd
Original Assignee
Jiangsu Yincheng Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Yincheng Network Technology Co Ltd filed Critical Jiangsu Yincheng Network Technology Co Ltd
Priority to CN202310053171.XA priority Critical patent/CN115858397B/en
Publication of CN115858397A publication Critical patent/CN115858397A/en
Application granted granted Critical
Publication of CN115858397B publication Critical patent/CN115858397B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Landscapes

  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The invention provides an APP automatic test method, device and automatic test system, wherein an element positioning tool and a test execution tool are configured in the automatic test system; the method comprises the steps of positioning page display elements of an APP by using an element positioning tool to obtain various page display elements corresponding to the APP; configuring a function case scene and an operation method corresponding to each page display element in an automatic test system; and aiming at the page display element and the function case scene corresponding to the page display element, executing a corresponding operation method on the APP by using a test execution tool based on the configuration information, and determining a test result corresponding to the APP according to operation feedback corresponding to the operation method and a preset operation result. The invention integrates and uses the element positioning tool and the test execution tool, tests by matching with the configuration information, directly selects the operation method according to the configuration information, does not need manual regression of testers, saves manpower and improves the test efficiency.

Description

APP automatic test method and device and automatic test system
Technical Field
The invention relates to the technical field of data testing, in particular to an APP automatic testing method, device and system.
Background
The iteration of the daily version of APP needs to return the scene more, and relates to the different models of a plurality of models, and the work load that returns is great in the overall test, and the time spent is more, does not satisfy the needs of the quick flow at present of team. Among them, the existing tests have the following problems: 1. at present, the APP with multiple types and models is adapted, but the functions are basically consistent, and based on the situation, the APP configured by multiple types needs to be tested repeatedly by manpower; 2. the existing regression scene does not relate to the change of the current version, and a large amount of manpower regression tests are still needed for the changed version; 3. version iteration is frequent, and the task of a tester is multiple.
Disclosure of Invention
In view of the above, the present invention provides an automated APP test method, an automated APP test device, and an automated APP test system, which can perform a test quickly even if the APP is updated iteratively, thereby saving labor and improving test efficiency.
In a first aspect, an embodiment of the present invention provides an APP automatic test method, where the method is applied to an automatic test system, and an element positioning tool and a test execution tool are configured in the automatic test system; the method comprises the following steps: positioning the updated page display elements of the APP by using an element positioning tool to obtain a plurality of page display elements corresponding to the APP; configuring a function case scene and an operation method corresponding to each page display element in the automatic test system according to the obtained multiple page display elements; aiming at the page display elements and the function case scenes corresponding to the page display elements, executing an operation method corresponding to the page display elements on the APP by using a test execution tool; the method comprises the following steps that an operation method executed by a test execution tool on an APP is determined according to pre-configured configuration information; the configuration information comprises an execution module corresponding to the operation method and an execution environment corresponding to the operation method; responding to the operation feedback of the APP, obtaining assertion between the operation feedback and a preset operation result according to the operation feedback, and determining the assertion as a test result corresponding to the APP.
With reference to the first aspect, an embodiment of the present invention provides a first possible implementation manner of the first aspect, where the automated testing system includes a testing frame, where the testing frame includes a BASE element layer, a PAGE method layer, and a Testcase case layer; according to the obtained multiple page display elements, configuring a function case scene and an operation method corresponding to each page display element in an automatic test system, wherein the steps comprise: storing each obtained page display element into a BASE element layer; for each PAGE display element, configuring an operation method corresponding to the PAGE display element in a PAGE method layer corresponding to a BASE element layer; and determining a use case script corresponding to the page display element based on the function use case scene corresponding to the page display element, and storing the use case script into a Testcase layer corresponding to the page display element.
With reference to the first aspect, an embodiment of the present invention provides a second possible implementation manner of the first aspect, where the test framework further includes a COMMON method layer; the method further comprises the following steps: configuring a processing method of public data corresponding to the APP in a COMMON method layer of the automatic test system, so that a test execution tool executes a test of the public data on the APP by using the processing method; the processing method of the public data comprises an operation method of a database and/or a reading method of a message agent tool.
With reference to the first aspect, an embodiment of the present invention provides a third possible implementation manner of the first aspect, where the method further includes: and pushing the test result to the intelligent terminal corresponding to the APP.
With reference to the first aspect, an embodiment of the present invention provides a fourth possible implementation manner of the first aspect, where a test push selection button is configured in the automated testing system; the method comprises the following steps of pushing a test result to an intelligent terminal corresponding to the APP, and comprises the following steps: and acquiring data corresponding to the test pushing selection button, and pushing a test result to the intelligent terminal corresponding to the APP when the data is characterized as pushing information.
With reference to the first aspect, an embodiment of the present invention provides a fifth possible implementation manner of the first aspect, where, for a page display element and a function case scenario corresponding to the page display element, a step of executing an operation method corresponding to the page display element by using a test execution tool includes: determining a use case script corresponding to the APP aiming at the page display element of the APP; determining an operation method corresponding to a page display element based on the use case script; and transmitting PAGE display elements of the BASE element layer into a PAGE method layer, calling an operation method corresponding to the PAGE method layer, and executing a step of simulating manual operation on the APP.
With reference to the first aspect, an embodiment of the present invention provides a sixth possible implementation manner of the first aspect, where the step of performing positioning operation on the page display element of the APP by using an element positioning tool to obtain multiple page display elements corresponding to the APP includes: connecting an intelligent terminal corresponding to the APP with an automatic test system, and acquiring a device number corresponding to the intelligent terminal; setting equipment parameters corresponding to the intelligent terminal in the element positioning tool, and positioning the intelligent terminal; searching an APP in the intelligent terminal by using an element positioning tool, and searching various Xpath paths in the APP; and positioning each page display element of the APP according to each Xpath path.
With reference to the first aspect, an embodiment of the present invention provides a seventh possible implementation manner of the first aspect, where the automated testing system is configured with a timer program; the method further comprises the following steps: starting a timing program; and when the timing time of the timing program meets the preset test trigger time, triggering the test execution tool to execute the operation method corresponding to the page display element on the APP.
In a second aspect, an embodiment of the present invention further provides an APP automatic test apparatus, where the apparatus is applied to an automatic test system, and an element positioning tool and a test execution tool are configured in the automatic test system; the device comprises: the element determining module is used for positioning the updated page display elements of the APP by using an element positioning tool to obtain a plurality of page display elements corresponding to the APP; the configuration module is used for configuring a function case scene and an operation method corresponding to each page display element in the automatic test system according to the obtained multiple page display elements; the execution module is used for executing the operation method corresponding to the page display element on the APP by using a test execution tool aiming at the page display element and the function case scene corresponding to the page display element; the method comprises the following steps that an operation method of a test execution tool for executing the APP is determined according to pre-configured configuration information; the configuration information comprises an execution module corresponding to the operation method and an execution environment corresponding to the operation method; and the output module is used for responding to the operation feedback of the APP, obtaining assertion between the operation feedback and a preset operation result according to the operation feedback, and determining the assertion as a test result corresponding to the APP.
In a third aspect, an embodiment of the present invention further provides an automated testing system, where an element positioning tool and a test execution tool are configured in the automated testing system; the element positioning tool is used for positioning the updated page display element of the APP; the test execution tool is used for configuring an operation method corresponding to the page display element and executing the operation method on the APP; the operation method is determined according to the pre-configured configuration information; the test execution tool is also provided with a test frame, and the test frame is used for integrating the page display elements positioned by the element positioning tool and the operation method for configuring the test execution tool; the test execution tool also stores configuration information, and the configuration information comprises an execution module corresponding to the operation method and an execution environment corresponding to the operation method.
The embodiment of the invention has the following beneficial effects: according to the automatic APP test method, device and automatic APP test system, the element positioning tool and the test execution tool are used in an integrated mode, after the element positioning tool is positioned to the page display element positioning, the element positioning tool is configured with the function case scene and the operation method, so that the test execution tool can select the function case scene and the operation method to execute test operation on the APP according to the configuration information when the test is executed, the test can be executed quickly even if the APP is updated in an iterative mode or has more test regression scenes, manual regression of test personnel is not needed, labor is saved, and the test efficiency can be improved.
Additional features and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. The objectives and other advantages of the invention will be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
In order to make the aforementioned and other objects, features and advantages of the present invention comprehensible, preferred embodiments accompanied with figures are described in detail below.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a flowchart of an APP automatic test method according to an embodiment of the present invention;
FIG. 2 is a flowchart of another APP automatic testing method provided in the embodiment of the present invention;
fig. 3 is a test execution flow chart corresponding to an APP automatic test method provided by the embodiment of the present invention;
fig. 4 is a schematic structural diagram of an APP automatic test apparatus according to an embodiment of the present invention;
fig. 5 is a schematic structural diagram of another APP automatic test apparatus according to an embodiment of the present invention;
fig. 6 is a schematic structural diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is apparent that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Iteration of the daily version of the APP needs more regression scenes, the regression workload in integral tests of different models of multiple models is large, the time is long, and the requirement of the current agile flow of a team is not met. Among them, the existing tests have the following problems: 1. the existing APP adapters have multiple models and types, but basically consistent functions, and based on the result, the APP configured by multiple models needs to be tested repeatedly by manpower; 2. the existing regression scene does not relate to the change of the current version, and a large amount of manpower regression tests are still needed for the changed version; 3. version iteration is frequent, and the tester has multiple tasks.
Based on this, the automatic testing method, device and system for the APP provided by the embodiment of the invention can quickly execute the test even if the APP is updated iteratively, thereby saving manpower and improving the testing efficiency.
In order to facilitate understanding of the embodiment, first, an APP automatic test method disclosed by the embodiment of the present invention is described in detail, where the method is applied to an automatic test system, and an element positioning tool and a test execution tool are configured in the automatic test system; fig. 1 shows a flowchart of an APP automated testing method provided by an embodiment of the present invention, and as shown in fig. 1, the method includes the following steps:
and S102, positioning the updated page display elements of the APP by using an element positioning tool to obtain a plurality of page display elements corresponding to the APP.
And step S104, configuring a function case scene and an operation method corresponding to each page display element in the automatic test system according to the obtained multiple page display elements.
And step S106, aiming at the page display elements and the function case scenes corresponding to the page display elements, executing the operation method corresponding to the page display elements on the APP by using a test execution tool.
And S108, responding to the operation feedback of the APP, obtaining assertion between the operation feedback and a preset operation result according to the operation feedback, and determining the assertion as a test result corresponding to the APP.
During specific implementation, the element positioning tool can be used for positioning the page display elements of the APP to obtain multiple page display elements corresponding to the APP, after the page display elements are obtained, the function case scene and the operation method corresponding to each page display element are configured in the automatic test system, when the APP is tested, the test execution tool is used for executing the operation method corresponding to the page display elements and the function case scenes corresponding to the page display elements to the APP, after the APP performs operation according to the test execution tool, the APP can obtain assertion between preset operation results according to corresponding operation feedback, and then corresponding test results are obtained.
The method comprises the following steps that an operation method of a test execution tool for executing the APP is determined according to pre-configured configuration information; the configuration information comprises an execution module corresponding to the operation method and an execution environment corresponding to the operation method; specifically, the test execution tool can be the execution tool that Jenkins corresponds, can set up specific python execution parameter in Jenkins, like execution environment and execution module etc., and write the call command in Jenkins, after spreading into configuration information's configuration parameter, can directly call when the project starts and write the Jenkins configuration method that has compiled, so that the test execution tool tests APP according to the execution parameter that configures, at this moment, need not to carry out a large amount of tests to APP, after APP is more up-to-date, can obtain the assertion result of required test according to configuration information, the user can clearly confirm the problem after the APP updates.
The preset operation result is an operation result corresponding to the page display element before the APP is not updated, after the APP is updated, the corresponding operation result may be changed, if the operation result of the page display element is not changed after the APP is updated, the assertion result is indicated to be the same as the operation, otherwise, the operation is different, and at this time, the assertion after the APP is updated can be determined based on the preset operation result.
According to the automatic APP testing method provided by the embodiment of the invention, the element positioning tool and the test execution tool are used in an integrated manner, and after the element positioning tool is positioned to the page display element positioning, the functional case scene and the operation method are configured, so that the test execution tool selects the functional case scene and the operation method to execute the test operation on the APP according to the configuration information during the test execution, the test can be executed quickly even if the APP is updated iteratively or has more test regression scenes, and the manual regression of a tester is not needed, so that the labor is saved, and the test efficiency can be improved.
For convenience of understanding, on the basis of fig. 1, another APP automatic testing method is further provided in the embodiment of the present invention, fig. 2 shows a flowchart of another APP automatic testing method provided in the embodiment of the present invention, and specifically, as shown in the flowchart of another APP automatic testing method shown in fig. 2, the method includes the following steps:
and S202, connecting the intelligent terminal corresponding to the APP with the automatic test system, and acquiring the equipment number corresponding to the intelligent terminal.
And S204, setting equipment parameters corresponding to the intelligent terminal in the element positioning tool, and positioning the intelligent terminal.
During specific implementation, the element positioning tool uses an APP, the APP is connected with an intelligent terminal corresponding to the APP, and after the two are connected, an adb command is used to obtain an equipment ID of the intelligent terminal, in addition, equipment parameters corresponding to the intelligent terminal are set in the APP, specifically, classifications such as platforminame, deviceName, appPackage, appActivity and the like can be set in the APP, and specific data in the platforminame, deviceName, appPackage and appActivity are filled based on the obtained equipment ID to obtain corresponding equipment parameters, so that the connected intelligent terminal is positioned based on the obtained equipment ID, and the APP executed test for which intelligent terminal is determined.
And S206, searching for an APP in the intelligent terminal by using the element positioning tool, and searching for various Xpath paths in the APP.
And S208, positioning each page display element of the APP according to each Xpath path.
In step S210, each of the obtained page display elements is stored in the BASE element layer.
In specific implementation, the automatic test system comprises a test frame, wherein the test frame comprises a BASE element layer, a PAGE method layer and a Testcase case layer; the element positioning tool adopts an Xpath mode to position and obtain the page display elements on the APP of the intelligent terminal, defines the obtained page display elements in the BASE element layer, and returns the Xpath path of the elements.
Specifically, the embodiment of the invention executes the test based on the same-city bill network APP, and the corresponding page display elements, the function case scene and the operation method are introduced according to the same-city bill network APP. Specifically, the page display elements may include a filtering item button of a hall filtering option, such as a query of each filtering condition in the event of a ticketing network APP in the same city, a name of a contractor for filtering an order, a price, an expiration date, a flaw, an operation button of an order flow such as order receiving, bargaining and the like, and elements of regression of various transaction flows.
Step S212, for each PAGE display element, configuring the operation method corresponding to the PAGE display element in the PAGE method layer corresponding to the BASE element layer.
The PAGE method layer comprises operation methods after elements of different BASE element layers are encapsulated, after corresponding PAGE display elements are defined in the BASE element layer, operation methods of the PAGE display elements are configured in the PAGE method layer corresponding to the BASE element layer, wherein each PAGE display element corresponds to one BASE element in the BASE element layer, the PAGE method layer comprises a plurality of operation methods, and each BASE element can correspond to one or more operation methods in the PAGE method layer. Specifically, the operation method of the page display element includes methods of clicking, sliding, inputting, selecting a pull-down, and the like.
Step S214, based on the function use case scene corresponding to the page display element, determining a use case script corresponding to the page display element, and storing the use case script into a Testcase layer corresponding to the page display element.
The page display elements also correspond to function use case scenes, specific function use case scenes such as order stream creation, order receiving, payment and receipt, hall preference setting, screening and result comparison are stored in the Testcase use layer, use case scripts of the function use case scenes can be compiled from actual function scenes, and the use case scripts are stored in the Testcase use layer corresponding to the page display elements.
Specifically, the automated test system is written using the python language, the test framework is pytest, is designed based on pytest specifications, and adopts a PO design mode. And the case file name under the Testcase case layer conforms to the naming specification.
Further, in the embodiment of the present invention, jenkins is used to integrate data in the BASE element layer, the PAGE method layer, and the Testcase case layer, so that the test execution tool executes an automated test, and an APP executes a test using an apim. Specific python execution parameters such as execution environment and execution module can be set in Jenkins, and Jenkins can also configure preference functions.
Specifically, the specific python execution parameter set in Jenkins may be configured in a configuration file, and the configuration file is stored in a test framework, and when a test is performed, the configuration file may be called from the test framework, and a related execution environment and execution module may be called from the configuration file, so as to determine a specific operation method. The configuration file may be a modification _ yaml.
And based on the timing execution time, the automatic test system is configured with a timing program, timing automatic trigger parameters are configured in Jenkins, the timing program is started after the Jenkins are started, and then the test execution tool is triggered to execute the operation method corresponding to the page display element of the APP when the timing time of the timing program meets the preset test trigger time. In the execution stage, the APP of the intelligent terminal can be automatically triggered after Jenkins are started, and the regression test is completed by simulating manual operation according to the designed case scene and the test triggering time.
Further, the test framework also includes a COMMON method layer; the embodiment of the invention can also configure a processing method of the public data corresponding to the APP in the COMMON public method layer of the automatic test system, so that the test execution tool executes the test of the public data to the APP by using the processing method; the processing method of the public data comprises an operation method of a database, such as an operation method of a MySQL database and a Redis database; and/or a reading method of the message agent, such as nail pushing configuration, database operation configuration, message agent Apollo reading configuration and the like, and further comprises secondary packaging of a python original request library, a method of screenshot in a case execution process and adding a test report, a method of encrypting a login account password according to rules and the like, the method in the COMMON method layer is called according to actual requirements, and specific operation steps are not repeated herein.
Step S216, determining a use case script corresponding to the APP aiming at the page display element of the APP.
Step S218, based on the use case script, determining an operation method corresponding to the page display element.
And S220, transmitting PAGE display elements of the BASE element layer into a PAGE method layer, calling an operation method corresponding to the PAGE method layer, and executing a step of simulating manual operation on the APP.
After the configuration of the BASE element layer, the PAGE method layer, and the Testcase layer is completed for the PAGE display element, a test execution tool may be used to execute a test on the APP. Specifically, in the test execution stage, a python case command is executed by selecting parameters such as a configured execution module and an execution environment from Jenkins, a compiled automatic case script is run, for example, an APP starts to release an order, screen an order, receive an order from a hall, confirm an order, pay an order, endorse an order, sign an order and the like, and the test is executed on a corresponding intelligent terminal to release test manpower.
Specifically, a corresponding use case script is determined for each PAGE display element of the APP, an operation method used for the PAGE display element is determined based on the use case script, and then the PAGE display element of the BASE element layer is transmitted into the PAGE method layer so as to call an operation method corresponding to the PAGE method layer according to the PAGE display element.
Step S222, responding to the operation feedback of the APP, obtaining assertion between the operation feedback and a preset operation result according to the operation feedback, and determining the assertion as a test result corresponding to the APP.
After the operation method is called, the step of manual actual operation can be simulated according to the operation method, at the moment, the APP can provide corresponding feedback according to the operation, at the moment, the simulated feedback result is compared with the expected result, the simulated assertion can be obtained, and the test result corresponding to the APP test is also obtained. For example, the automated testing may simulate manual selection of an input box on a login interface, then input an account password in the corresponding input box, click a check box of a reading protocol, and finally simulate manual click of a login button to realize automatic login. At the moment, a specific element displayed through the early login success interface is used as a final assertion basis, and when the element appears, the login success is proved.
The embodiment of the invention can generate a test report according to the test result, the test report is generated by using HTML and Allure, and the Allure is used for recording each operation step in the test and operation feedback corresponding to each operation step, such as execution time, an execution module, an execution environment, execution parameter input data, execution parameter output data, execution result screenshot and the like. The automated testing system also comprises a test report layer, also called a report layer, which is used for storing the generated test report collection, wherein the report is provided with a summary file of the complete UI test report, the test report is integrated with information such as execution quantity, execution time, execution environment, execution result, execution log, failure screenshot and the like of the use case script, and Allure can be independently used for checking the complete execution result, execution screenshot, execution time, execution access and participation and the like.
And S224, pushing the test result to the intelligent terminal corresponding to the APP.
Whether a test group is pushed or not in the configuration file is based on the fact that after a test result is obtained according to assertion, the system can also push the test result to the intelligent terminal corresponding to the APP according to the pushing configuration, specifically, a test pushing selection button is configured in the automatic test system, after the test result is obtained, the automatic test system can obtain whether a pushing requirement is configured in advance for the APP according to a page display element indicated by the test result, the pushing requirement is data corresponding to the test pushing selection button in the system, and when the data in the test pushing selection button is characterized as pushing information, the automatic test system can directly push the test result to the intelligent terminal corresponding to the APP. The push options can be configured according to requirements, so that the automatic test system can execute pushing according to corresponding configuration. The configuration corresponding to the test push select button is also configured in Jenkins.
The intelligent terminal can comprise a nail group or a mobile phone short message of a project affiliate, a specific pushing mode can be determined according to configuration information, specifically, a test result can be pushed to the nail group of the intelligent terminal, or the test result can be pushed in a short message mode, and related contents such as a test progress, a test report and the test result can be pushed.
Further, for convenience of understanding, fig. 3 shows a test execution flow chart corresponding to the APP automation test method provided by the embodiment of the present invention, and as shown in fig. 3, the method first locates a page display element in an APP through an APP, then packages an operation method of the located page display element, then designs a case script based on a pytest, and simultaneously sets whether to push a test result, a test report, and other configurations, and then integrates these configuration parameters in Jenkins. In the test execution stage, case tests are executed through a test execution tool according to an operation method in Jenkins, test results and corresponding test reports are generated, and the test reports corresponding to the test results are pushed to the intelligent terminals corresponding to the APP according to the pushing configuration.
According to the other APP automatic test method provided by the embodiment of the invention, the element positioning of the APP and the operation method based on the APP are subjected to secondary packaging, the executed parameters can be intentionally selected in Jenkins to carry out the automatic test of the APP during execution, corresponding page display elements and scenes can be quickly positioned even if the test regression scenes are more, the manual regression of test personnel is not needed, the key services irrelevant to the current version content are checked, the test manpower is greatly saved, the test efficiency is improved, and the test efficiency is increased in the agile development test process. The embodiment of the invention can also push the automatic test result to the intelligent terminal, so that a user can know the test condition of the APP conveniently.
Furthermore, the Apium tool related in the embodiment of the invention is an open source tool, the cross-platform is a mobile platform testing tool of market mainstream, the related pytest framework is a mainstream open source testing framework, and the plug-in package is abundant; the Jenkins tool is a mainstream continuous integration tool and the technology is mature.
Corresponding to the method embodiment, the embodiment of the invention also provides an APP automatic test device, which is applied to an automatic test system, wherein an element positioning tool and a test execution tool are configured in the automatic test system; fig. 4 shows a schematic structural diagram of an APP automatic testing device, and as shown in fig. 4, the device includes:
and the element determining module 401 is configured to perform positioning operation on the updated page display element of the APP by using an element positioning tool, so as to obtain multiple page display elements corresponding to the APP.
A configuration module 402, configured to configure, according to the obtained multiple page display elements, a function case scenario and an operation method corresponding to each page display element in the automated testing system.
And an executing module 403, configured to execute, by using a test execution tool, an operation method corresponding to the page display element on the APP according to the page display element and the function case scenario corresponding to the page display element.
And the output module 404 is configured to respond to the operation feedback of the APP, obtain an assertion between the operation feedback and a preset operation result according to the operation feedback, and determine the assertion as a test result corresponding to the APP.
The automatic APP testing device provided by the embodiment of the invention has the same technical characteristics as the automatic APP testing method provided by the embodiment, so that the same technical problems can be solved, and the same technical effects can be achieved.
Further, on the basis of fig. 4, another APP automatic testing apparatus is further provided in the embodiments of the present invention, fig. 5 shows a schematic structural diagram of another APP automatic testing apparatus, specifically, as shown in fig. 5, the schematic structural diagram of another APP automatic testing apparatus is further provided, in the apparatus, the configuration module is further configured to store each obtained page display element into a BASE element layer; for each PAGE display element, configuring an operation method corresponding to the PAGE display element in a PAGE method layer corresponding to a BASE element layer; and determining a use case script corresponding to the page display element based on the function use case scene corresponding to the page display element, and storing the use case script into a Testcase layer corresponding to the page display element.
The configuration module 402 is further configured to configure, in a COMMON method layer of the automated testing system, a processing method of COMMON data corresponding to the APP, so that the test execution tool executes a test on the COMMON data of the APP by using the processing method; the processing method of the public data comprises an operation method of a database and/or a reading method of a message agent tool.
The device further comprises a pushing module 405 for pushing the test result to the intelligent terminal corresponding to the APP. The pushing module 405 is further configured to obtain data corresponding to the test pushing selection button, and push a test result to the intelligent terminal corresponding to the APP when the data is represented as pushing information.
The execution module 403 is further configured to determine, for a page display element of the APP, a use case script corresponding to the APP; determining an operation method corresponding to a page display element based on the use case script; and transmitting PAGE display elements of the BASE element layer into a PAGE method layer, calling an operation method corresponding to the PAGE method layer, and executing a step of simulating manual operation on the APP.
The element determining module 401 is further configured to connect the intelligent terminal corresponding to the APP with the automatic test system, and obtain an equipment number corresponding to the intelligent terminal; setting equipment parameters corresponding to the intelligent terminal in the element positioning tool, and positioning the intelligent terminal; searching an APP in the intelligent terminal by using an element positioning tool, and searching various Xpath paths in the APP; and positioning each page display element of the APP according to each Xpath path.
The device also comprises a control module 406 for starting a timing program; and when the timing time of the timing program meets the preset test trigger time, triggering the test execution tool to execute the operation method corresponding to the page display element on the APP.
Furthermore, the embodiment of the invention also provides an automatic test system, wherein an element positioning tool and a test execution tool are configured in the automatic test system; the element positioning tool is used for positioning the page display elements of the APP; the test execution tool is used for configuring an operation method corresponding to the page display element and executing the operation method on the APP; the operation method is determined according to the pre-configured configuration information; the test execution tool is also provided with a test frame, and the test frame is used for integrating the page display elements positioned by the element positioning tool and the operation method for configuring the test execution tool; the test execution tool also stores configuration information, and the configuration information comprises an execution module corresponding to the operation method and an execution environment corresponding to the operation method.
The automatic test system provided by the embodiment of the invention has the same technical characteristics as the APP automatic test method provided by the embodiment, so that the same technical problems can be solved, and the same technical effect can be achieved.
An embodiment of the present invention further provides an electronic device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, the steps of the method shown in fig. 1 to 2 are implemented.
An embodiment of the present invention further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the computer program performs the steps of the methods shown in fig. 1 to 2.
An embodiment of the present invention further provides a schematic structural diagram of an electronic device, as shown in fig. 6, which is the schematic structural diagram of the electronic device, where the electronic device includes a processor 61 and a memory 60, the memory 60 stores computer-executable instructions that can be executed by the processor 61, and the processor 61 executes the computer-executable instructions to implement the methods shown in fig. 1 to fig. 2.
In the embodiment shown in fig. 6, the electronic device further comprises a bus 62 and a communication interface 63, wherein the processor 61, the communication interface 63 and the memory 60 are connected by the bus 62.
The Memory 60 may include a high-speed Random Access Memory (RAM) and may also include a non-volatile Memory (non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 63 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used. The Bus 62 may be an ISA (Industry Standard Architecture) Bus, a PCI (Peripheral Component Interconnect) Bus, an EISA (Extended Industry Standard Architecture) Bus, or the like, and may also be an AMBA (Advanced Microcontroller Bus Architecture) Bus, which defines three types of buses including an APB (Advanced Peripheral Bus) Bus, an AHB (Advanced High-performance Bus) Bus, and an AXI (Advanced eXtensible Interface) Bus. The bus 62 may be divided into an address bus, a data bus, a control bus, and the like. For ease of illustration, only one double-headed arrow is shown in FIG. 6, but that does not indicate only one bus or one type of bus.
The processor 61 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 61. The Processor 61 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the Integrated Circuit may also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic device, or discrete hardware components. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and the processor 61 reads information in the memory, and in combination with hardware thereof, performs the method shown in any one of fig. 1 to 2.
The method, the apparatus and the computer program product for automated testing of APP provided by the embodiments of the present invention include a computer-readable storage medium storing a program code, where instructions included in the program code may be used to execute the method described in the foregoing method embodiments, and specific implementation may refer to the method embodiments, and will not be described herein again.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the system described above may refer to the corresponding process in the foregoing method embodiment, and is not described herein again. In addition, in the description of the embodiments of the present invention, unless otherwise explicitly specified or limited, the terms "mounted," "connected," and "connected" are to be construed broadly, e.g., as meaning either a fixed connection, a removable connection, or an integral connection; can be mechanically or electrically connected; they may be connected directly or indirectly through intervening media, or they may be interconnected between two elements. The specific meanings of the above terms in the present invention can be understood in a specific case to those skilled in the art.
The functions, if implemented in the form of software functional units 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 invention may be embodied in the form of 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 invention. 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.
In the description of the present invention, it should be noted that the terms "center", "upper", "lower", "left", "right", "vertical", "horizontal", "inner", "outer", etc., indicate orientations or positional relationships based on the orientations or positional relationships shown in the drawings, and are only for convenience of description and simplicity of description, but do not indicate or imply that the device or element being referred to must have a particular orientation, be constructed and operated in a particular orientation, and thus, should not be construed as limiting the present invention. Furthermore, the terms "first," "second," and "third" are used for descriptive purposes only and are not to be construed as indicating or implying relative importance.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that the following embodiments are merely illustrative of the present invention, and not restrictive, and the scope of the present invention is not limited thereto: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. The APP automatic test method is characterized by being applied to an automatic test system, wherein an element positioning tool and a test execution tool are configured in the automatic test system;
the method comprises the following steps:
positioning the updated page display elements of the APP by using the element positioning tool to obtain a plurality of page display elements corresponding to the APP;
configuring a function case scene and an operation method corresponding to each page display element in the automatic test system according to the obtained multiple page display elements;
aiming at the page display element and a function case scene corresponding to the page display element, executing an operation method corresponding to the page display element on the APP by using the test execution tool; the method for operating the APP by the test execution tool is determined according to pre-configured configuration information; the configuration information comprises an execution module corresponding to the operation method and an execution environment corresponding to the operation method;
responding the operation feedback of the APP, obtaining assertion between the operation feedback and a preset operation result according to the operation feedback, and determining the assertion as a test result corresponding to the APP.
2. The method of claim 1, wherein the automated test system comprises a test framework comprising a BASE element layer, a PAGE method layer, and a Testcase case layer;
according to the obtained multiple page display elements, configuring a function case scene and an operation method corresponding to each page display element in the automatic test system, wherein the steps comprise:
storing each obtained page display element into the BASE element layer;
configuring an operation method corresponding to each PAGE display element in a PAGE method layer corresponding to the BASE element layer;
and determining a use case script corresponding to the page display element based on the function use case scene corresponding to the page display element, and storing the use case script into a Testcase layer corresponding to the page display element.
3. The method of claim 2, wherein the test framework further comprises a COMMON method layer;
the method further comprises the following steps:
configuring a processing method of public data corresponding to the APP in a COMMON method layer of the automatic test system, so that the test execution tool executes a test of the public data on the APP by using the processing method;
the processing method of the public data comprises an operation method of a database and/or a reading method of a message agent tool.
4. The method of claim 1, further comprising:
and pushing the test result to the intelligent terminal corresponding to the APP.
5. The method of claim 4, wherein a test push selection button is configured in the automated test system;
the step of pushing the test result to the intelligent terminal corresponding to the APP comprises the following steps:
and acquiring data corresponding to the test pushing selection button, and pushing the test result to the intelligent terminal corresponding to the APP when the data is characterized as pushing information.
6. The method according to claim 3, wherein the step of executing the operation method corresponding to the page display element by using the test execution tool for the page display element and the function case scenario corresponding to the page display element includes:
determining a use case script corresponding to the APP aiming at the page display element of the APP;
determining an operation method corresponding to the page display element based on the use case script;
and transmitting PAGE display elements of the BASE element layer into the PAGE method layer, calling an operation method corresponding to the PAGE method layer, and executing simulated manual operation on the APP.
7. The method according to claim 1, wherein the step of performing positioning operation on the page display elements of the APP by using the element positioning tool to obtain the plurality of page display elements corresponding to the APP comprises:
connecting the intelligent terminal corresponding to the APP with the automatic test system, and acquiring a device number corresponding to the intelligent terminal;
setting equipment parameters corresponding to the intelligent terminal in the element positioning tool, and positioning the intelligent terminal;
searching an APP in the intelligent terminal by using the element positioning tool, and searching various Xpath paths in the APP;
and positioning each page display element of the APP according to each Xpath path.
8. The method of claim 1, wherein the automated test system is configured with a timer program; the method further comprises the following steps:
starting the timing program;
and when the timing time of the timing program meets the preset test trigger time, triggering the test execution tool to execute the operation method corresponding to the page display element on the APP.
9. The APP automatic testing device is applied to an automatic testing system, wherein an element positioning tool and a test execution tool are configured in the automatic testing system; the device comprises:
the element determining module is used for positioning the updated page display elements of the APP by using the element positioning tool to obtain a plurality of page display elements corresponding to the APP;
the configuration module is used for configuring a function case scene and an operation method corresponding to each page display element in the automatic test system according to the obtained multiple page display elements;
the execution module is used for executing the operation method corresponding to the page display element on the APP by using the test execution tool aiming at the page display element and the function case scene corresponding to the page display element; the method for operating the APP by the test execution tool is determined according to pre-configured configuration information; the configuration information comprises an execution module corresponding to the operation method and an execution environment corresponding to the operation method;
and the output module is used for responding to the operation feedback of the APP, obtaining assertion between the operation feedback and a preset operation result according to the operation feedback, and determining the assertion as a test result corresponding to the APP.
10. An automatic test system is characterized in that an element positioning tool and a test execution tool are configured in the automatic test system;
the element positioning tool is used for positioning the updated page display element of the APP;
the test execution tool is used for configuring an operation method corresponding to the page display element and executing the operation method on the APP; the operation method is determined according to pre-configured configuration information;
the test execution tool is also provided with a test frame, and the test frame is used for integrating the page display elements positioned by the element positioning tool and the operation method configured by the test execution tool;
configuration information is further stored in the test execution tool, and the configuration information includes an execution module corresponding to the operation method and an execution environment corresponding to the operation method.
CN202310053171.XA 2023-02-03 2023-02-03 APP automatic test method, device and automatic test system Active CN115858397B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310053171.XA CN115858397B (en) 2023-02-03 2023-02-03 APP automatic test method, device and automatic test system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310053171.XA CN115858397B (en) 2023-02-03 2023-02-03 APP automatic test method, device and automatic test system

Publications (2)

Publication Number Publication Date
CN115858397A true CN115858397A (en) 2023-03-28
CN115858397B CN115858397B (en) 2023-06-23

Family

ID=85657491

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310053171.XA Active CN115858397B (en) 2023-02-03 2023-02-03 APP automatic test method, device and automatic test system

Country Status (1)

Country Link
CN (1) CN115858397B (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334449A (en) * 2018-01-26 2018-07-27 北京京东金融科技控股有限公司 A kind of method and apparatus of interface automatic test
CN110851356A (en) * 2019-10-30 2020-02-28 河海大学 Selenium-based Web application automatic test framework and construction method and system thereof
CN115658529A (en) * 2022-11-03 2023-01-31 平安银行股份有限公司 Automatic testing method for user page and related equipment

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108334449A (en) * 2018-01-26 2018-07-27 北京京东金融科技控股有限公司 A kind of method and apparatus of interface automatic test
CN110851356A (en) * 2019-10-30 2020-02-28 河海大学 Selenium-based Web application automatic test framework and construction method and system thereof
CN115658529A (en) * 2022-11-03 2023-01-31 平安银行股份有限公司 Automatic testing method for user page and related equipment

Also Published As

Publication number Publication date
CN115858397B (en) 2023-06-23

Similar Documents

Publication Publication Date Title
CN109828903B (en) Automatic testing method and device, computer device and storage medium
CN111240973B (en) Equipment testing method and system based on simulation and readable storage medium
CN110020381A (en) Method of calibration, device, equipment and computer storage medium based on configuration file
CN109101680B (en) FPGA prototype automatic verification method and system based on GitLab-CI
CN110297760A (en) Building method, device, equipment and the computer readable storage medium of test data
CN112395184A (en) Information acquisition method, equipment and computer storage medium
CN110659870A (en) Business audit test method, device, equipment and storage medium
CN113127347A (en) Interface testing method, device, equipment and readable storage medium
CN112835802A (en) Equipment testing method, device, equipment and storage medium
CN115563002A (en) Data importing method and device, storage medium and computer equipment
CN114860613A (en) Automatic testing method and device
CN115098063A (en) Project development method and device and electronic equipment
JP4595260B2 (en) Method for automatically executing a test program on a portable terminal
CN117493188A (en) Interface testing method and device, electronic equipment and storage medium
CN115858397A (en) APP automatic test method and device and automatic test system
CN117370203A (en) Automatic test method, system, electronic equipment and storage medium
CN113434405B (en) Method and device for determining test file, storage medium and electronic device
CN111767218A (en) Automatic testing method, equipment and storage medium for continuous integration
CN116629173A (en) Verification method and device of network chip, computer equipment and storage medium
KR101039874B1 (en) System for integration platform of information communication
CN115599683A (en) Automatic testing method, device, equipment and storage medium
CN109359044B (en) Codecep-based test-oriented automation system
CN112433946A (en) Interface test management method, device, equipment and storage medium
KR100775102B1 (en) Quality test result estimate system of platform based application on embedded device and method thereof
CN113141366B (en) Message submitting method and device, storage medium and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant