CN117370203B - Automatic test method, system, electronic equipment and storage medium - Google Patents
Automatic test method, system, electronic equipment and storage medium Download PDFInfo
- Publication number
- CN117370203B CN117370203B CN202311424659.5A CN202311424659A CN117370203B CN 117370203 B CN117370203 B CN 117370203B CN 202311424659 A CN202311424659 A CN 202311424659A CN 117370203 B CN117370203 B CN 117370203B
- Authority
- CN
- China
- Prior art keywords
- test
- page
- target
- data
- operation method
- 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.)
- Active
Links
- 238000010998 test method Methods 0.000 title claims abstract description 22
- 238000012360 testing method Methods 0.000 claims abstract description 416
- 238000000034 method Methods 0.000 claims abstract description 348
- 238000004806 packaging method and process Methods 0.000 claims abstract description 66
- 238000013500 data storage Methods 0.000 claims description 31
- 230000008569 process Effects 0.000 claims description 18
- BUGBHKTXTAQXES-UHFFFAOYSA-N Selenium Chemical compound [Se] BUGBHKTXTAQXES-UHFFFAOYSA-N 0.000 claims description 12
- 229910052711 selenium Inorganic materials 0.000 claims description 12
- 239000011669 selenium Substances 0.000 claims description 12
- 238000004590 computer program Methods 0.000 claims description 11
- 238000012216 screening Methods 0.000 claims description 10
- 239000008186 active pharmaceutical agent Substances 0.000 claims description 9
- 238000012545 processing Methods 0.000 claims description 9
- 238000012544 monitoring process Methods 0.000 claims description 8
- 238000005538 encapsulation Methods 0.000 claims description 6
- 238000012423 maintenance Methods 0.000 abstract description 10
- 238000004891 communication Methods 0.000 description 10
- 238000010586 diagram Methods 0.000 description 5
- 230000006870 function Effects 0.000 description 5
- 238000001545 Page's trend test Methods 0.000 description 3
- 230000008878 coupling Effects 0.000 description 3
- 238000010168 coupling process Methods 0.000 description 3
- 238000005859 coupling reaction Methods 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 3
- 230000007246 mechanism Effects 0.000 description 3
- 238000013515 script Methods 0.000 description 3
- 238000000605 extraction Methods 0.000 description 2
- 230000008439 repair process Effects 0.000 description 2
- 238000012795 verification Methods 0.000 description 2
- 230000006399 behavior Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000008901 benefit Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000013075 data extraction Methods 0.000 description 1
- 230000001419 dependent effect Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000002349 favourable effect Effects 0.000 description 1
- 238000001914 filtration Methods 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 230000003993 interaction Effects 0.000 description 1
- 230000005055 memory storage Effects 0.000 description 1
- 238000010295 mobile communication Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000003287 optical effect Effects 0.000 description 1
- 238000000926 separation method Methods 0.000 description 1
- 239000007787 solid Substances 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012546 transfer Methods 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
Abstract
The embodiment of the application provides an automatic test method, an automatic test system, electronic equipment and a storage medium, and belongs to the technical field of automatic tests. The method comprises the following steps: acquiring test task data; the test task data comprises a target test page; extracting element positioning data from a target test page; a method of inheriting one of the following based on test task data: obtaining a target operation method by an operation method of a public operation class, an operation method of a webpage end operation class or an operation method of an application end operation class; encapsulating the target operation method and the element positioning data to obtain a target page object; packaging based on the target page object and test data corresponding to the target page object to obtain a target test case; and testing according to the target test case. The embodiment of the application can be used for automatic testing of the application end and the webpage end, and reduces the maintenance difficulty of an automatic testing system by packaging the operation method, thereby improving the efficiency of the automatic testing.
Description
Technical Field
The present application relates to the field of automated testing technologies, and in particular, to an automated testing method, an automated testing system, an electronic device, and a storage medium.
Background
At present, an application deployed at an application end is automatically tested by mainly adopting a Appium tool, and an application deployed at a webpage end is automatically tested by mainly adopting a Selenium tool. However, in an actual application scenario, since the project needs to be deployed on the application end and the web page end at the same time, when the project needs to be automatically tested, independent automation frames need to be set up for the application end and the web page end at the same time, and the maintenance difficulty of the two sets of frames is high, so that in some more complex test scenarios, the efficiency of the automation test is low. Therefore, how to improve the efficiency of the automated test becomes a technical problem to be solved.
Disclosure of Invention
The embodiment of the application mainly aims to provide an automatic test method, an automatic test system, electronic equipment and a storage medium, and aims to improve the efficiency of automatic test.
To achieve the above object, a first aspect of an embodiment of the present application provides an automated testing method, including:
Acquiring test task data; the test task data comprises a target test page;
Extracting element positioning data from the target test page;
Inheriting a preset operation method based on the test task data to obtain a target operation method; wherein the preset operation method comprises one of the following steps: the method comprises the steps that a preset public operation method, a preset webpage end operation method or a preset application end operation method are used for packaging the public operation method, wherein the public operation method is a method shared by a webpage end and an application end, the webpage end also has a webpage private operation method, the application end also has an application private operation method, the webpage end operation type is used for packaging the webpage private operation method, and the application end operation type is used for packaging the application private operation method;
the target operation method and the element positioning data are packaged into a page object to obtain a target page object;
Acquiring test data corresponding to the target page object from preset test data storage equipment based on the test task data; the test data storage device is used for storing test data corresponding to the target page object;
performing case packaging based on the target page object and the test data to obtain a target test case;
and testing according to the target test case.
In some embodiments, the testing according to the target test case includes:
monitoring the test process of the target test case to obtain a case execution result;
If the case execution result represents the execution failure condition in the test process of the target test case, calling a failure recording method of the target page object to record an execution failure page, and obtaining test failure report data; the failure recording method is that the target page object is obtained from the public operation class, the webpage end operation class or the application end operation class relay.
In some embodiments, the failure recording method includes a failure screenshot method and a log recording method, the calling the failure recording method of the target page object records an execution failure page to obtain test failure report data, including:
invoking the failed screenshot method to perform screenshot processing on the execution failure page to obtain failed use case screenshot data;
Calling the log recording method to log the execution failure page to obtain failure use case log data;
and generating test failure report data based on the failure case screenshot data and the failure case log data.
In some embodiments, the test task data further includes a task execution sequence, the target page object includes a plurality of page sub-objects, and the test data includes test sub-data corresponding to the page sub-objects; the case packaging is performed based on the target page object and the test data to obtain a target test case, which comprises the following steps:
task packaging is carried out on the page sub-object and the test sub-data corresponding to the page sub-object, so that a test sub-task is obtained;
and carrying out task arrangement on the test subtasks based on the task execution sequence to obtain the target test case.
In some embodiments, the extracting element positioning data from the target test page includes:
extracting page identification information from the target test page;
and acquiring the element positioning data from a preset element information database based on the page identification information.
In some embodiments, the extracting element positioning data from the target test page includes:
performing element identification on the target test page to obtain page element data;
And carrying out element positioning on the page element data to obtain the element positioning data.
In some embodiments, the encapsulating the target operation method and the element positioning data to obtain a target page object includes:
Performing element screening on the element positioning data based on the test task data to obtain target element data;
and carrying out method encapsulation on the target element data and the target operation method to obtain the target page object.
To achieve the above object, a second aspect of an embodiment of the present application proposes an automated test system, the system comprising:
The task acquisition module is used for acquiring test task data; the test task data comprises a target test page;
the positioning data acquisition module is used for extracting element positioning data from the target test page;
An operation method acquisition module, configured to inherit a preset operation method based on the test task data to obtain a target operation method; wherein the preset operation method comprises one of the following steps: the method comprises the steps that a preset public operation method, a preset webpage end operation method or a preset application end operation method are used for packaging the public operation method, wherein the public operation method is a method shared by a webpage end and an application end, the webpage end also has a webpage private operation method, the application end also has an application private operation method, the webpage end operation type is used for packaging the webpage private operation method, and the application end operation type is used for packaging the application private operation method;
The page object packaging module is used for packaging the page object by the target operation method and the element positioning data to obtain a target page object;
The test data acquisition module is used for acquiring test data corresponding to the target page object from preset test data storage equipment based on the test task data; the test data storage device is used for storing test data corresponding to the target page object;
The case generation module is used for carrying out case packaging based on the target page object and the test data to obtain a target test case;
And the case test module is used for testing according to the target test case.
To achieve the above object, a third aspect of the embodiments of the present application proposes an electronic device, including a memory storing a computer program and a processor implementing the method according to the first aspect when the processor executes the computer program.
To achieve the above object, a fourth aspect of the embodiments of the present application proposes a computer-readable storage medium storing a computer program which, when executed by a processor, implements the method of the first aspect.
The application provides an automatic test method, an automatic test system, electronic equipment and a storage medium, wherein test task data are acquired; the test task data comprises a target test page; extracting element positioning data from a target test page; inheriting a preset operation method based on test task data to obtain a target operation method; the preset operation method comprises one of the following steps: the method comprises the steps that a preset public operation class operation method, a preset webpage end operation class operation method or a preset application end operation class operation method is used for packaging a public operation method shared by a webpage end and an application end, the webpage end operation class is used for packaging a webpage private operation method of the webpage end, and the application end operation class is used for packaging an application private operation method of the application end; the target operation method and the element positioning data are packaged into a page object to obtain a target page object; acquiring test data corresponding to a target page object from preset test data storage equipment based on the test task data; the test data storage device is used for storing test data corresponding to the target page object; performing case packaging based on the target page object and the test data to obtain a target test case; and testing according to the target test case. The method can be used for automatic testing of the application end and the webpage end, and by packaging the operation method, the reusability of the test codes is improved, the maintenance difficulty of an automatic test system is reduced, and the efficiency of the automatic test is further improved.
Drawings
FIG. 1 is a flow chart of an automated test method provided by an embodiment of the present application;
Fig. 2 is a flowchart of step S102 in fig. 1;
FIG. 3 is a flow chart of another automated testing method provided by an embodiment of the present application;
fig. 4 is a flowchart of step S104 in fig. 1;
fig. 5 is a flowchart of step S106 in fig. 1;
fig. 6 is a flowchart of step S107 in fig. 1;
fig. 7 is a flowchart of step S602 in fig. 6;
FIG. 8 is a schematic diagram of an automated test system according to an embodiment of the present application;
fig. 9 is a schematic diagram of a hardware structure of an electronic device according to an embodiment of the present application.
Detailed Description
The present application will be described in further detail with reference to the drawings and examples, in order to make the objects, technical solutions and advantages of the present application more apparent. It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the application.
It should be noted that although functional block diagrams are depicted as block diagrams, and logical sequences are shown in the flowchart, in some cases, the steps shown or described may be performed in a different order than the block diagrams in the system. The terms first, second and the like in the description and in the claims and in the above-described figures, are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of the application only and is not intended to be limiting of the application.
First, several nouns involved in the present application are parsed:
Automated testing (Automated Testing) refers to the process of testing and validating web pages or applications by simulating the behavior of a user using automated tools or scripts. The automated test may automatically perform various test tasks including clicking, inputting, verifying, page navigation, etc. to verify whether the page functions properly and meets expectations. The automatic test is widely applied in different stages and environments of software development, including unit test, integrated test, system test and the like, and by simulating the operation of a user and providing various verification and assertion mechanisms to verify the correctness of a page, an automatic script is written, the test case can be repeatedly executed, potential problems can be rapidly found and solved, the quality and stability of products are improved, the efficiency and accuracy of the test are improved, and meanwhile, the human error caused by the input of human resources and manual test is reduced.
Selenium, selenium is an automated test tool that can be used to automatically test Web applications. Selenium are mainly used for simulating operations of users in the browser, such as clicking, filling in forms, submitting and the like, and verifying and asserting page elements. Selenium support multiple programming languages and may be integrated with different browsers and operating systems.
Appium, appium is an open-source mobile application automation test tool that can be used to test native, hybrid, and mobile Web applications on iOS and Android platforms. Appium allow a tester to write test codes using a commonly used test framework, then run the test codes on a real device or simulator, can operate on interface elements of an application, such as clicking buttons, entering text, etc., and can also acquire and verify the status and properties of the application.
Page objects (Page objects), a design model in software test automation, encapsulate different elements of a Page as objects to provide a compact, readable code structure. The page object mode can help testers decouple test logic from page implementation, and improve maintainability and reusability of codes. In the page object mode, each page corresponds to a page object, and the page object encapsulates operation methods and attributes related to the page. By invoking the method of the page object, the tester can trigger the operation of the page directly, such as clicking a button, filling in a form, etc. At the same time, the page object may also provide some query methods for obtaining the status and attributes of the page element to verify whether the test is performed correctly.
At present, an application deployed at an application end is automatically tested by mainly adopting a Appium tool, and an application deployed at a webpage end is automatically tested by mainly adopting a Selenium tool. However, in an actual application scenario, since the project needs to be deployed on the application end and the web page end at the same time, when the project needs to be automatically tested, independent automation frames need to be set up for the application end and the web page end at the same time, and the maintenance difficulty of the two sets of frames is high, so that in some more complex test scenarios, the efficiency of the automation test is low.
The prior advanced technology is to simply integrate Selenium tools and Appium tools in a set of system to achieve the effect of simultaneously compatible with a webpage end and an application end, the original operation method is not subjected to extraction packaging, a process-oriented linear script is adopted in a frame, and the reusability and the maintainability are poor; when the project is slightly complicated, the code in the frame is very tedious and high in repeatability.
Therefore, how to improve the efficiency of the automated test becomes a technical problem to be solved.
Based on the above, the embodiment of the application provides an automatic test method, an automatic test system, electronic equipment and a storage medium, aiming at improving the efficiency of automatic test.
The embodiment of the application provides an automatic test method, an automatic test system, electronic equipment and a storage medium, and specifically, the following embodiment is used for explaining, and the automatic test method in the embodiment of the application is described first.
The embodiment of the application provides an automatic test method, and relates to the technical field of automatic tests. The automatic test method provided by the embodiment of the application can be applied to the terminal, the server and software running in the terminal or the server. In some embodiments, the terminal may be a smart phone, tablet, notebook, desktop, etc.; the server side can be configured as an independent physical server, a server cluster or a distributed system formed by a plurality of physical servers, and a cloud server for providing cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDNs, basic cloud computing services such as big data and artificial intelligent platforms and the like; the software may be an application or the like that implements an automated test method, but is not limited to the above form.
The application is operational with numerous general purpose or special purpose computer system environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet devices, multiprocessor systems, microprocessor-based systems, set top boxes, programmable consumer electronics, network PCs, minicomputers, mainframe computers, distributed computing environments that include any of the above systems or devices, and the like. The application may be described in the general context of computer-executable instructions, such as program modules, being executed by a computer. Generally, program modules include routines, programs, objects, components, data structures, etc. that perform particular tasks or implement particular abstract data types. The application may also be practiced in distributed computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed computing environment, program modules may be located in both local and remote computer storage media including memory storage devices.
FIG. 1 is an alternative flow chart of an automated test provided by an embodiment of the present application, and the method of FIG. 1 may include, but is not limited to, steps S101 through S107.
Step S101, test task data are obtained; the test task data comprises a target test page;
step S102, extracting element positioning data from a target test page;
Step S103, inheriting a preset operation method based on test task data to obtain a target operation method; the preset operation method comprises one of the following steps: the method comprises the steps that a preset public operation method, a preset webpage end operation method or a preset application end operation method are used for packaging the public operation method, wherein the public operation method is a method shared by a webpage end and an application end, the webpage end also has a webpage private operation method, the application end also has an application private operation method, the webpage end operation class is used for packaging the webpage private operation method, and the application end operation class is used for packaging the application private operation method;
Step S104, packaging the page object by the target operation method and the element positioning data to obtain a target page object;
Step S105, acquiring test data corresponding to a target page object from preset test data storage equipment based on the test task data; the test data storage device is used for storing test data corresponding to the target page object;
Step S106, carrying out case packaging based on the target page object and the test data to obtain a target test case;
and step S107, testing according to the target test case.
Step S101 to step S107 shown in the embodiment of the present application, test task data is obtained; the test task data comprises a target test page; extracting element positioning data from a target test page; inheriting a preset operation method based on test task data to obtain a target operation method; the preset operation method comprises one of the following steps: the method comprises the steps that a preset public operation class operation method, a preset webpage end operation class operation method or a preset application end operation class operation method is used for packaging a public operation method shared by a webpage end and an application end, the webpage end operation class is used for packaging a webpage private operation method of the webpage end, and the application end operation class is used for packaging an application private operation method of the application end; the target operation method and the element positioning data are packaged into a page object to obtain a target page object; acquiring test data corresponding to a target page object from preset test data storage equipment based on the test task data; the test data storage device is used for storing test data corresponding to the target page object; performing case packaging based on the target page object and the test data to obtain a target test case; and testing according to the target test case. The method can be used for automatic testing of the application end and the webpage end, and the reusability of the test code is improved by packaging and integrating a public operation method shared by the webpage end and the application end, an application private operation method of the application end and a webpage private operation method of the webpage end; meanwhile, the application end and the webpage end are integrated under one set of automatic test system, so that the maintenance difficulty of the automatic test system is reduced, and the efficiency of automatic test is improved.
In step S101 of some embodiments, the test task data is a task that is provided by a tester and is currently required to be tested, where the test task data may include a test task of a web page end and an application end at the same time, or may include only a test task of the application end or the web page end. Specifically, the testing task of both the web page end and the application end comprises the corresponding target testing page.
It should be noted that, the Web page end refers to an application program deployed on the Web, and may inherit the operation method of the Selenium API interface, while the application end refers to a Web application on the mobile terminal, and the mobile terminal may be a mobile device based on the iOS system or the Android system, and may inherit the operation method of the Appium API interface.
Referring to fig. 2, in some embodiments, step S102 may include, but is not limited to, steps S201 to S202:
step S201, extracting page identification information from a target test page;
Step S202, element positioning data is obtained from a preset element information database based on page identification information.
In the steps S201 to S202 shown in the embodiment of the present application, the element positioning data corresponding to the target test page is stored in the preset element information database, so that the element positioning data corresponding to the target test page can be obtained at any time during the test, the separation of the test page and the page element is realized, and only the page element database needs to be maintained when the page changes, thereby solving the problem of high maintenance cost caused by frequent page changes and improving the robustness of the automatic test system.
It should be noted that, the page identification information refers to a unique identification of a page, and the page identification information may be an address for identifying and locating a web page resource, or may be a title tag of the page, which is not limited in this embodiment.
The element information database is used for providing element positioning data for the page objects, the element positioning data of one page object can be stored in a class file, and the file name of the element positioning data of the page A can be associated with the name of the page object A; when the page is changed, only the element positioning data corresponding to the page name is found from the element information database to be modified, and modified page elements are not required to be found in a plurality of page object files, so that the maintenance cost of the automatic test system is reduced.
It should be noted that, the page identification information is also used for identifying whether the target test page is a page of the application end or a page of the web end, specifically, the element information database also includes an application element information database and a web page element information database, the file name of the element positioning data of the application end page in the application element information database is associated with the name of the application end page object, and the file name of the element positioning data of the web page end page in the web page element information database is associated with the name of the web page end page object, thereby realizing the classified storage of the page elements of the application end and the web page end and improving the maintainability of the automatic test system.
Referring to fig. 3, in some embodiments, step S102 further includes, but is not limited to, steps S301 to S302:
Step S301, carrying out element identification on a target test page to obtain page element data;
step S302, element positioning is carried out on the page element data, and element positioning data are obtained.
In the steps S301 to S302 shown in the embodiment of the present application, when a new page appears, element positioning data corresponding to the page is not stored in the element information database, and then element identification and element positioning are required to be performed on the target test page, so that element positioning data corresponding to the new page is obtained, and applicability of an automatic test method is improved.
In step S301 of some embodiments, the element identification of the target test page may be implemented by a method of identifying an ID attribute, a Class attribute, a label name, or the like of the element, or may be implemented by a CSS selector, which is not limited in the embodiments of the present application.
After step S302 of some embodiments, the method further comprises:
The element location data is stored in an element information database.
By storing the element positioning data into the element information database, the new page is convenient to test later, and the automatic test system is also convenient to maintain.
In step S103 of some embodiments, the automation system includes a common operation class, a web page side operation class, and an application side operation class, and selects which operation class to call specifically according to the requirement of the test task data.
The preset public operation class encapsulates the operation methods supported by the webpage end and the application end at the same time, and each encapsulated function provides a public operation method; the common operation method can directly encapsulate the operations of waiting page elements (calling an intelligent waiting method to wait for the occurrence of the page elements, and the waiting time to be transmitted in a parameter form), searching the page elements (calling a page element searching method, and transmitting specific element positioning information in a parameter form), clicking the page elements (calling Selenium webdriver API a bottom clicking element method, which can process an exception (such as that the element does not exist), recording error information into a log when the exception occurs), and logging methods (recording contents such as page names, operation methods corresponding to pages, page parameters, page method execution results and the like) required by each test case, and failure screenshot (calling a page screenshot method, and page screenshot when the test case fails to execute) into each common operation method. The common operation methods can be repeatedly called by page objects of a plurality of application ends and webpage ends, and the common operation methods are equivalent to methods such as waiting for page elements, searching page elements, clicking page elements, failure screenshot, log record and the like, and the methods are not required to be called independently, so that a large number of repeated codes are reduced.
It should be noted that, the web page private operation method of the web page end is other web page end operation methods except the public operation method in the web page operation methods; the application private operation method of the application terminal is other application terminal operation methods except the public operation method in the application operation methods.
The preset webpage end operation class encapsulates a webpage private operation method of the webpage end, and each encapsulated function provides a webpage private operation method; the webpage private operation method directly encapsulates the operations of waiting page elements, searching page elements, clicking page elements, logging methods and failure screenshot required by each test case into each webpage private operation method. The webpage private operation methods can be repeatedly called by the webpage objects of the webpage ends, and the methods which are equivalent to waiting for the webpage elements, searching the webpage elements, clicking the webpage elements, performing failure screenshot, logging and the like are contained as long as the webpage private operation methods are called, so that the methods do not need to be called independently, and a large number of repeated codes are reduced.
The preset application terminal operation class encapsulates an application private operation method of the application terminal, and each encapsulated function provides an application private operation method; the application private operation method directly encapsulates the operations of waiting page elements, searching page elements and clicking page elements required by each application end page object, the logging method required by each test case and the failure screenshot into each application private operation method. The application private operation methods can be repeatedly called by page objects of a plurality of application ends, and the methods which are equivalent to waiting for page elements, searching for page elements, clicking page elements, failure screenshot, log record and the like are contained as long as the application private operation methods are called, so that the methods do not need to be called independently, and a large number of repeated codes are reduced.
When the automatic test is performed on the page of the webpage end, the operation methods of the public operation class and the operation class of the webpage end can be inherited simultaneously, and the operation method of the public operation class or the operation method of the operation class of the webpage end can be inherited only; when the page of the application terminal is automatically tested, the operation methods of the public operation class and the application terminal operation class can be inherited simultaneously, and the operation method of the public operation class or the operation method of the application terminal operation class can be inherited only.
It should be noted that, the operation methods of the public operation class, the web page end operation class and the application end operation class may be increased according to the test task requirements, so as to meet different test task requirements.
Referring to fig. 4, in some embodiments, step S104 may include, but is not limited to, steps S401 to S402:
step S401, element screening is carried out on element positioning data based on test task data to obtain target element data;
step S402, performing method packaging on the target element data and the target operation method to obtain a target page object.
In the steps S401 to S402 shown in the embodiment of the present application, element screening is performed on element positioning data to obtain target element data required by a test task, and then the target element data and a target operation method are packaged in a method to obtain a target page object, so that maintainability of an automatic test system is improved, and for a commonly used test item, the number of times of repeatedly packaging Chen Yemian objects can be reduced, so that reusability and test efficiency are improved, and a tester can complete corresponding operations only by calling the method of the page object.
In step S401 of some embodiments, since the element positioning data includes element positioning data of all elements of the entire page, and it may not be necessary to use all page elements in a specific test task, element filtering needs to be performed on the element positioning data to filter out target element data required by the test task. Specifically, the element screening may be implemented by a Class selector, a Name attribute selector, or the like, and the specific element screening method is not limited in this embodiment.
In step S402 of some embodiments, after the target element data and the target operation method are packaged to obtain the target page object, the operation on the target element data can be implemented only by instantiating the target page object.
It should be noted that the web page end and the application end respectively have respective corresponding target page objects, and specifically, both the target element data and the target operation method are associated with whether the page corresponds to the web page end or the mobile end.
In step S105 of some embodiments, the test data storage device mainly provides test data required in the test case, where the test data storage device includes a common test data storage unit for storing common test data, a web page test data storage unit, and an application test data storage unit. The public test data storage unit is used for storing public test data such as account numbers, passwords, user names and the like; the webpage test data storage unit is used for storing the private test data of the webpage end page; the application test data storage unit is used for storing the private test data of the application end page.
It should be noted that, the file name of the test data stored in the test data storage device may be associated with the name of the page object to be tested, so as to implement the classified storage of the test data of the application end and the web page end.
Referring to fig. 5, in some embodiments, the test task data further includes a task execution sequence, the target page object includes a plurality of page sub-objects, and step S106 may further include, but is not limited to, steps S501 to S502:
step S501, performing task packaging on the page sub-object and test sub-data corresponding to the page sub-object to obtain a test sub-task;
and step S502, performing task arrangement on the test subtasks based on the task execution sequence to obtain the target test case.
In the steps S501 to S502 shown in the embodiment of the present application, task packaging is performed on a plurality of page sub-objects and test sub-data corresponding to the page sub-objects to obtain test sub-tasks, and finally task scheduling is performed on a plurality of test sub-tasks according to a task execution sequence, so as to obtain a target test case, which can improve the expansibility of the test, quickly locate the position of each test step and verification point, enable the test case to adapt to the change of various requirements, and increase the coverage of the test; and meanwhile, the maintenance of the test case is facilitated.
In step S501 of some embodiments, a test subtask is obtained by calling an operation method of a page sub-object at an application end or a web page end and corresponding test value data to package, or understood as a test sub-case.
It should be noted that, in the test subtasks corresponding to the web page end, the method for starting the browser provided by the Selenium webdriver API interface is called in the precondition; in the test subtasks corresponding to the application end, a method for starting the browser provided by the Appium API interface is called in the precondition.
Referring to fig. 6, in some embodiments, step S107 includes, but is not limited to, steps S601 to S602:
Step S601, monitoring a test process of a target test case to obtain a case execution result;
Step S602, if the case execution result represents that the execution failure condition occurs in the test process of the target test case, calling a failure recording method of the target page object to record an execution failure page, and obtaining test failure report data; the failure recording method is that the target page object is obtained from a common operation class, a webpage end operation class or an application end operation class relay.
In the steps S601 to S602 shown in the embodiment of the present application, the test process of the target test case is monitored to obtain the case execution result, if the case execution result represents the execution failure condition in the test process of the target test case, the failure recording method of the target page object is called to record the execution failure page, so as to obtain test failure report data, so that the test personnel can check the test case and the page according to the test failure report data, which is favorable for tracking and positioning the problem and accelerating the repair of the problem.
In step S601 of some embodiments, the monitoring of the test procedure of the target test case may be implemented by an assertion mechanism or an exception handling mechanism provided by the automated test system, when the assertion fails, the automated test system may throw out an exception that the assertion fails, may capture the failure condition of the test case by capturing the exception and handling, or may determine whether the test case fails by capturing the exception when an unexpected exception or error occurs during the running of the test case.
The test report data is processed, and detailed information including, but not limited to, tester name, test time, test item name, total number of cases executed, test pass number of cases, test fail number of cases, etc. is recorded. And finally, storing the test report into a preset report database, and displaying the test report to a tester.
Referring to fig. 7, in some embodiments, the failure recording method includes a failure screenshot method and a logging method, and step S602 may include, but is not limited to, steps S701 to S703:
step S701, calling a failure screenshot method to perform screenshot processing on an execution failure page to obtain failed use case screenshot data;
Step S702, calling a log recording method to log the execution failure page to obtain the log data of the failure use case;
step S703, generating test failure report data based on the failure case screenshot data and the failure case log data.
In the steps S701 to S703 shown in the embodiment of the present application, a screenshot and log recording are performed on a page with execution failure by calling a failure recording method obtained by a page object from a common operation class, a web page end operation class or an application end operation class relay, so as to generate a test failure report, so that a tester can check a test case and a page according to the test failure report data, which is beneficial to tracking and positioning problems and speeding up the repair of problems.
It should be noted that the failed screenshot method is set in the operation methods of the public operation class, the web page end operation class or the application end operation class, and the failed screenshot method is inherited when the operation methods are inherited, so that the times of calling the failed screenshot method are reduced, the repeated codes are reduced, and the maintainability of the automatic test system is increased.
It should be noted that, the log recording method is set in the operation methods of the public operation class, the web page end operation class or the application end operation class, and the log recording method is inherited when the operation methods are inherited, so that the times of calling the log recording method are reduced, the repeated codes are reduced, and the maintainability of the automatic test system is increased.
In one embodiment, the automated testing of the pages at the web page end may include, but is not limited to, the steps of:
acquiring test task data; the test task data comprises a target test page and a task execution sequence;
extracting page identification information from a target test page, and acquiring element positioning data from a preset element information database based on the page identification information;
Inheriting a preset operation method based on test task data to obtain a target operation method; the preset operation method may include at least one of the following: the method comprises the steps of presetting an operation method of a public operation class and an operation method of a webpage end operation class, wherein the public operation class is used for packaging the public operation method, the public operation method is a method shared by a webpage end and an application end, the webpage end is also provided with a webpage private operation method, and the webpage end operation class is used for packaging the webpage private operation method;
Performing element screening on the element positioning data based on the test task data to obtain target element data;
performing method encapsulation on the target element data and the target operation method to obtain a target page object; wherein the target page object comprises a plurality of page sub-objects;
Acquiring test data corresponding to a target page object from a page test data storage unit in preset test data storage equipment based on test task data;
task packaging is carried out on the page sub-object and test sub-data corresponding to the page sub-object, so that a test sub-task is obtained;
Task arrangement is carried out on the test subtasks based on the task execution sequence, and a target test case is obtained;
monitoring a test process of the target test case to obtain a case execution result;
if the case execution result represents the execution failure condition in the test process of the target test case, calling a failure screenshot method to perform screenshot processing on an execution failure page to obtain failure case screenshot data;
calling a log recording method to log the execution failure page to obtain log data of the failure use case;
generating test failure report data based on the failure case screenshot data and the failure case log data; the failure screenshot method and the log recording method are that the target page object is obtained from a common operation class and a webpage end operation class relay.
In one embodiment, the automatic testing of the page at the application end may include, but is not limited to, the following steps:
acquiring test task data; the test task data comprises a target test page and a task execution sequence;
extracting page identification information from a target test page, and acquiring element positioning data from a preset element information database based on the page identification information;
Inheriting a preset operation method based on test task data to obtain a target operation method; the preset operation method may include at least one of the following: the method comprises the steps of presetting an operation method of a public operation class and an operation method of an application end operation class, wherein the public operation class is used for packaging the public operation method, the public operation method is a method shared by an application end and an application end, the application end also comprises an application private operation method, and the application end operation class is used for packaging the application private operation method;
Performing element screening on the element positioning data based on the test task data to obtain target element data;
performing method encapsulation on the target element data and the target operation method to obtain a target page object; wherein the target page object comprises a plurality of page sub-objects;
Acquiring test data corresponding to a target page object from a page test data storage unit in preset test data storage equipment based on test task data;
task packaging is carried out on the page sub-object and test sub-data corresponding to the page sub-object, so that a test sub-task is obtained;
Task arrangement is carried out on the test subtasks based on the task execution sequence, and a target test case is obtained;
monitoring a test process of the target test case to obtain a case execution result;
if the case execution result represents the execution failure condition in the test process of the target test case, calling a failure screenshot method to perform screenshot processing on an execution failure page to obtain failure case screenshot data;
calling a log recording method to log the execution failure page to obtain log data of the failure use case;
Generating test failure report data based on the failure case screenshot data and the failure case log data; the failure screenshot method and the log recording method are that the target page object is obtained from a common operation class and an application terminal operation class relay.
According to the automatic test method provided by the embodiment of the application, the public operation method shared by the webpage end and the application end, the application private operation method of the application end and the webpage private operation method of the webpage end are packaged and integrated, so that the reusability of test codes is improved; the method can be suitable for automatic test scenes of an application end and a webpage end, ensures the stability and consistency of automatic tests on different platforms, can help testers to improve the test efficiency and the software quality, and accelerates the release of the software.
By separating the test page from the page elements, only the page element database needs to be maintained when the page changes, so that the problem of high maintenance cost caused by frequent page changes is solved, and the robustness of the automatic test system is improved.
And the methods such as waiting page elements, searching page elements, clicking page elements, failure screenshot, log records and the like are packaged in each public operation method, webpage private operation method and application private operation method, and the operation methods can be repeatedly called, so long as the operation methods of public operation classes, webpage end operation classes and application end operation classes are inherited, the methods are equivalent to the methods including waiting page elements, searching page elements, clicking page elements, failure screenshot, log records and the like, and the methods do not need to be called independently, so that a large number of repeated codes are reduced.
Referring to fig. 8, an embodiment of the present application further provides an automated testing system, which can implement the automated testing method, where the system includes:
a task acquisition module 801, configured to acquire test task data; the test task data comprises a target test page;
A positioning data acquisition module 802, configured to extract element positioning data from a target test page;
An operation method obtaining module 803, configured to inherit a preset operation method based on the test task data, to obtain a target operation method; the preset operation method comprises one of the following steps: the method comprises the steps that a preset public operation method, a preset webpage end operation method or a preset application end operation method are used for packaging the public operation method, wherein the public operation method is a method shared by a webpage end and an application end, the webpage end also has a webpage private operation method, the application end also has an application private operation method, the webpage end operation class is used for packaging the webpage private operation method, and the application end operation class is used for packaging the application private operation method;
The page object packaging module 804 is configured to package a page object with the target operation method and the element positioning data to obtain a target page object;
the test data acquisition module 805 is configured to acquire test data corresponding to a target page object from a preset test data storage device based on test task data; the test data storage device is used for storing test data corresponding to the target page object;
the case generation module 806 is configured to perform case packaging based on the target page object and the test data to obtain a target test case;
the case test module 807 is configured to perform a test according to the target test case.
In the positioning data acquisition module 802 of some embodiments, the positioning data acquisition module 802 further includes:
The page identification extraction unit is used for extracting page identification information from the target test page;
the element positioning data extraction unit is used for acquiring element positioning data from a preset element information database based on the page identification information.
In the positioning data acquisition module 802 of some embodiments, the positioning data acquisition module 802 further includes:
the element identification unit is used for carrying out element identification on the target test page to obtain page element data;
The element positioning unit is used for performing element positioning on the page element data to obtain element positioning data.
In the page object encapsulation module 804 of some embodiments, the page object encapsulation module 804 further includes:
The element screening unit is used for carrying out element screening on the element positioning data based on the test task data to obtain target element data;
And the method packaging unit is used for carrying out method packaging on the target element data and the target operation method to obtain a target page object.
In the use case generation module 806 of some embodiments, the use case generation module 806 further includes:
the task packaging unit is used for task packaging the page sub-object and the test sub-data corresponding to the page sub-object to obtain a test sub-task;
And the task arrangement unit is used for carrying out task arrangement on the test subtasks based on the task execution sequence to obtain the target test case.
In case test module 807 of some embodiments, case test module 807 further includes:
The test monitoring unit is used for monitoring the test process of the target test case to obtain a case execution result;
The failure recording unit is used for calling a failure recording method of the target page object to record an execution failure page if the execution failure condition occurs in the test process of the target test case represented by the case execution result, so as to obtain test failure report data; the failure recording method is that the target page object is relayed from a public operation class, a webpage end operation class or an application end operation class.
In the failure recording unit of some embodiments, the failure recording unit further includes:
The screenshot unit is used for calling a failed screenshot method to perform screenshot processing on the execution failure page to obtain failed use case screenshot data;
the log recording unit is used for calling a log recording method to log record the execution failure page to obtain the log data of the failure use case;
and the failure report generating unit is used for generating test failure report data based on the failure case screenshot data and the failure case log data.
The specific implementation of the automated test system is substantially the same as the specific embodiment of the automated test method described above, and will not be described herein.
The embodiment of the application also provides electronic equipment, which comprises a memory and a processor, wherein the memory stores a computer program, and the processor realizes the automatic test method when executing the computer program. The electronic equipment can be any intelligent terminal including a tablet personal computer, a vehicle-mounted computer and the like.
Referring to fig. 9, fig. 9 illustrates a hardware structure of an electronic device according to another embodiment, the electronic device includes:
The processor 901 may be implemented by a general purpose CPU (central processing unit), a microprocessor, an application specific integrated circuit (ApplicationSpecificIntegratedCircuit, ASIC), or one or more integrated circuits, etc. for executing related programs, so as to implement the technical solution provided by the embodiments of the present application;
the memory 902 may be implemented in the form of read-only memory (ReadOnlyMemory, ROM), static storage, dynamic storage, or random access memory (RandomAccessMemory, RAM), among others. The memory 902 may store an operating system and other application programs, and when the technical solutions provided in the embodiments of the present disclosure are implemented by software or firmware, relevant program codes are stored in the memory 902, and the processor 901 invokes an automated test method for executing the embodiments of the present disclosure;
An input/output interface 903 for inputting and outputting information;
the communication interface 904 is configured to implement communication interaction between the device and other devices, and may implement communication in a wired manner (e.g. USB, network cable, etc.), or may implement communication in a wireless manner (e.g. mobile network, WIFI, bluetooth, etc.);
a bus 905 that transfers information between the various components of the device (e.g., the processor 901, the memory 902, the input/output interface 903, and the communication interface 904);
Wherein the processor 901, the memory 902, the input/output interface 903 and the communication interface 904 are communicatively coupled to each other within the device via a bus 905.
The embodiment of the application also provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program realizes the automatic test method when being executed by a processor.
The memory, as a non-transitory computer readable storage medium, may be used to store non-transitory software programs as well as non-transitory computer executable programs. In addition, the memory may include high-speed random access memory, and may also include non-transitory memory, such as at least one magnetic disk storage device, flash memory device, or other non-transitory solid state storage device. In some embodiments, the memory optionally includes memory remotely located relative to the processor, the remote memory being connectable to the processor through a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The embodiment of the application provides an automatic test method, an automatic test system, electronic equipment and a storage medium, which are used for acquiring test task data; the test task data comprises a target test page; extracting element positioning data from a target test page; inheriting a preset operation method based on test task data to obtain a target operation method; the preset operation method comprises one of the following steps: the method comprises the steps that a preset public operation class operation method, a preset webpage end operation class operation method or a preset application end operation class operation method is used for packaging a public operation method shared by a webpage end and an application end, the webpage end operation class is used for packaging a webpage private operation method of the webpage end, and the application end operation class is used for packaging an application private operation method of the application end; the target operation method and the element positioning data are packaged into a page object to obtain a target page object; acquiring test data corresponding to a target page object from preset test data storage equipment based on the test task data; the test data storage device is used for storing test data corresponding to the target page object; performing case packaging based on the target page object and the test data to obtain a target test case; and testing according to the target test case. The method can be used for automatic testing of the application end and the webpage end, and by packaging the operation method, the reusability of the test codes is improved, the maintenance difficulty of an automatic test system is reduced, and the efficiency of the automatic test is further improved.
The embodiments described in the embodiments of the present application are for more clearly describing the technical solutions of the embodiments of the present application, and do not constitute a limitation on the technical solutions provided by the embodiments of the present application, and those skilled in the art can know that, with the evolution of technology and the appearance of new application scenarios, the technical solutions provided by the embodiments of the present application are equally applicable to similar technical problems.
It will be appreciated by persons skilled in the art that the embodiments of the application are not limited by the illustrations, and that more or fewer steps than those shown may be included, or certain steps may be combined, or different steps may be included.
The system embodiments described above are merely illustrative, in that the units illustrated as separate components may or may not be physically separate, i.e., may be located in one place, or may be distributed over a plurality of network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
Those of ordinary skill in the art will appreciate that all or some of the steps of the methods, systems, functional modules/units in the devices disclosed above may be implemented as software, firmware, hardware, and suitable combinations thereof.
The terms "first," "second," "third," "fourth," and the like in the description of the application and in the above figures, if any, 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 application described herein may be implemented in sequences other than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
It should be understood that in the present application, "at least one (item)" means one or more, and "a plurality" means two or more. "and/or" for describing the association relationship of the association object, the representation may have three relationships, for example, "a and/or B" may represent: only a, only B and both a and B are present, wherein a, B may be singular or plural. The character "/" generally indicates that the context-dependent object is an "or" relationship. "at least one of" or the like means any combination of these items, including any combination of single item(s) or plural items(s). For example, at least one (one) of a, b or c may represent: a, b, c, "a and b", "a and c", "b and c", or "a and b and c", wherein a, b, c may be single or plural.
In the several embodiments provided by the present application, it should be understood that the disclosed systems and methods may be implemented in other ways. For example, the system embodiments described above are merely illustrative, e.g., the division of the above elements is merely a logical functional division, and there may be additional divisions in actual implementation, e.g., multiple elements or components may be combined or integrated into another system, or some features may be omitted, or not performed. Alternatively, the coupling or direct coupling or communication connection shown or discussed with each other may be through some interface, system or unit indirect coupling or communication connection, which may be in electrical, mechanical or other form.
The units described above as separate components may or may not be physically separate, and components shown as units may or may not be physical units, may be located in one place, or may be distributed over a plurality of network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional unit in the embodiments of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units may be implemented in hardware or in software functional units.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present application may be embodied in essence or a part contributing to the prior art or all or part of the technical solution in the form of a software product stored in a storage medium, including multiple instructions to cause a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method of the various embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (Random Access Memory RAM), a magnetic disk, or an optical disk, or other various media capable of storing a program.
The preferred embodiments of the present application have been described above with reference to the accompanying drawings, and are not thereby limiting the scope of the claims of the embodiments of the present application. Any modifications, equivalent substitutions and improvements made by those skilled in the art without departing from the scope and spirit of the embodiments of the present application shall fall within the scope of the claims of the embodiments of the present application.
Claims (10)
1. An automated testing method, the method comprising:
Acquiring test task data; the test task data comprises a target test page;
Extracting element positioning data from the target test page;
Inheriting a preset operation method based on the test task data to obtain a target operation method; the preset operation method comprises the following steps: the method comprises the steps of a preset operation method of a public operation class, a preset operation method of a webpage end operation class and a preset operation method of an application end operation class, wherein the public operation class is used for packaging the public operation method, the public operation method is a method shared by the webpage end and the application end, and each public operation method comprises the following steps: waiting for a page element, searching the page element, clicking the page element, logging and performing failure screenshot; the webpage end is an application program deployed on the Web, the webpage end also has a webpage private operation method, the webpage private operation method is an operation method of Selenium API interfaces, the application end is a Web application deployed on the mobile terminal, the application end also has an application private operation method, the application private operation method is an operation method of Appium API interfaces, the webpage end operation class is used for packaging the webpage private operation method, and the application end operation class is used for packaging the application private operation method;
the target operation method and the element positioning data are packaged into a page object to obtain a target page object;
Acquiring test data corresponding to the target page object from preset test data storage equipment based on the test task data; the test data storage device is used for storing test data corresponding to the target page object;
performing case packaging based on the target page object and the test data to obtain a target test case;
and testing according to the target test case.
2. The method of claim 1, wherein the testing according to the target test case comprises:
monitoring the test process of the target test case to obtain a case execution result;
If the case execution result represents the execution failure condition in the test process of the target test case, calling a failure recording method of the target page object to record an execution failure page, and obtaining test failure report data; the failure recording method is that the target page object is obtained from the public operation class, the webpage end operation class or the application end operation class relay.
3. The method according to claim 2, wherein the failure recording method includes a failure screenshot method and a log recording method, the calling the failure recording method of the target page object records an execution failure page to obtain test failure report data, and the method includes:
invoking the failed screenshot method to perform screenshot processing on the execution failure page to obtain failed use case screenshot data;
Calling the log recording method to log the execution failure page to obtain failure use case log data;
and generating test failure report data based on the failure case screenshot data and the failure case log data.
4. The method of claim 1, wherein the test task data further comprises a task execution order, the target page object comprises a plurality of page sub-objects, and the test data comprises test sub-data corresponding to the page sub-objects; the case packaging is performed based on the target page object and the test data to obtain a target test case, which comprises the following steps:
task packaging is carried out on the page sub-object and the test sub-data corresponding to the page sub-object, so that a test sub-task is obtained;
and carrying out task arrangement on the test subtasks based on the task execution sequence to obtain the target test case.
5. The method of any of claims 1-4, wherein the extracting element positioning data from the target test page comprises:
extracting page identification information from the target test page;
and acquiring the element positioning data from a preset element information database based on the page identification information.
6. The method of any of claims 1-4, wherein the extracting element positioning data from the target test page comprises:
performing element identification on the target test page to obtain page element data;
And carrying out element positioning on the page element data to obtain the element positioning data.
7. The method according to any one of claims 1-4, wherein said encapsulating the target operation method and the element positioning data into a page object to obtain a target page object includes:
Performing element screening on the element positioning data based on the test task data to obtain target element data;
and carrying out method encapsulation on the target element data and the target operation method to obtain the target page object.
8. An automated test system, the automated test system comprising:
The task acquisition module is used for acquiring test task data; the test task data comprises a target test page;
the positioning data acquisition module is used for extracting element positioning data from the target test page;
An operation method acquisition module, configured to inherit a preset operation method based on the test task data to obtain a target operation method; the preset operation method comprises the following steps: the method comprises the steps of a preset operation method of a public operation class, a preset operation method of a webpage end operation class and a preset operation method of an application end operation class, wherein the public operation class is used for packaging the public operation method, the public operation method is a method shared by the webpage end and the application end, and each public operation method comprises the following steps: waiting for a page element, searching the page element, clicking the page element, logging and performing failure screenshot; the webpage end is an application program deployed on the Web, the webpage end also has a webpage private operation method, the webpage private operation method is an operation method of Selenium API interfaces, the application end is a Web application deployed on the mobile terminal, the application end also has an application private operation method, the application private operation method is an operation method of Appium API interfaces, the webpage end operation class is used for packaging the webpage private operation method, and the application end operation class is used for packaging the application private operation method;
The page object packaging module is used for packaging the page object by the target operation method and the element positioning data to obtain a target page object;
The test data acquisition module is used for acquiring test data corresponding to the target page object from preset test data storage equipment based on the test task data; the test data storage device is used for storing test data corresponding to the target page object;
The case generation module is used for carrying out case packaging based on the target page object and the test data to obtain a target test case;
And the case test module is used for testing according to the target test case.
9. An electronic device comprising a memory storing a computer program and a processor that when executing the computer program implements the automated test method of any of claims 1 to 7.
10. A computer readable storage medium storing a computer program, characterized in that the computer program, when executed by a processor, implements the automated test method of any of claims 1 to 7.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311424659.5A CN117370203B (en) | 2023-10-27 | 2023-10-27 | Automatic test method, system, electronic equipment and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202311424659.5A CN117370203B (en) | 2023-10-27 | 2023-10-27 | Automatic test method, system, electronic equipment and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN117370203A CN117370203A (en) | 2024-01-09 |
CN117370203B true CN117370203B (en) | 2024-07-02 |
Family
ID=89407538
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202311424659.5A Active CN117370203B (en) | 2023-10-27 | 2023-10-27 | Automatic test method, system, electronic equipment and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN117370203B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN117573561B (en) * | 2024-01-15 | 2024-04-26 | 成方金融科技有限公司 | Automatic test system, method, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110941546A (en) * | 2019-10-12 | 2020-03-31 | 平安健康保险股份有限公司 | Automatic test method, device, equipment and storage medium for WEB page case |
CN112100536A (en) * | 2020-09-21 | 2020-12-18 | 杭州安恒信息安全技术有限公司 | Webpage access method, device and equipment and readable storage medium |
Family Cites Families (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108628741B (en) * | 2018-04-10 | 2021-10-01 | 平安科技(深圳)有限公司 | Webpage testing method and device, electronic equipment and medium |
CN113778898B (en) * | 2021-09-26 | 2024-02-20 | 杭州安恒信息技术股份有限公司 | User interface automatic test method and device, electronic equipment and storage medium |
-
2023
- 2023-10-27 CN CN202311424659.5A patent/CN117370203B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110941546A (en) * | 2019-10-12 | 2020-03-31 | 平安健康保险股份有限公司 | Automatic test method, device, equipment and storage medium for WEB page case |
CN112100536A (en) * | 2020-09-21 | 2020-12-18 | 杭州安恒信息安全技术有限公司 | Webpage access method, device and equipment and readable storage medium |
Also Published As
Publication number | Publication date |
---|---|
CN117370203A (en) | 2024-01-09 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN109302522B (en) | Test method, test device, computer system, and computer medium | |
CN107908541B (en) | Interface testing method and device, computer equipment and storage medium | |
CN109828903B (en) | Automatic testing method and device, computer device and storage medium | |
US10769228B2 (en) | Systems and methods for web analytics testing and web development | |
CN107526676B (en) | Cross-system test method and device | |
US9189377B1 (en) | Automation testing using descriptive maps | |
CN109783388B (en) | UI (user interface) automatic testing method and device and electronic equipment | |
CN109710508A (en) | Test method, test device, test equipment and computer readable storage medium | |
CN108628748B (en) | Automatic test management method and automatic test management system | |
CN110750458A (en) | Big data platform testing method and device, readable storage medium and electronic equipment | |
CN113778898B (en) | User interface automatic test method and device, electronic equipment and storage medium | |
CN117370203B (en) | Automatic test method, system, electronic equipment and storage medium | |
CN112241360A (en) | Test case generation method, device, equipment and storage medium | |
US11829278B2 (en) | Secure debugging in multitenant cloud environment | |
CN114546738A (en) | Server general test method, system, terminal and storage medium | |
CN113760730B (en) | Automatic test method and device | |
CN109739704A (en) | A kind of interface test method, server-side and computer readable storage medium | |
CN113377667A (en) | Scene-based testing method and device, computer equipment and storage medium | |
CN111708712A (en) | User behavior test case generation method, flow playback method and electronic equipment | |
CN111752820A (en) | Pressure testing method of gPC interface, computer equipment and storage medium | |
US10042638B2 (en) | Evaluating documentation coverage | |
CN111159028A (en) | Webpage testing method and device | |
CN116383025A (en) | Performance test method, device, equipment and medium based on Jmeter | |
CN115514677A (en) | Server dial testing method and system | |
CN112559278A (en) | Method and device for acquiring operation data |
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 |