Automatic testing method and device, electronic equipment and medium
Through the automated testing method, the test cases and mark elements generated by manual testing behaviors are used to automatically test the front-end project, which solves the problems of heavy testing workload and difficult detection of logical errors in the existing technology, and achieves high testing efficiency and accuracy.
Patent Information
- Application Number
- CN202310274893.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-21
- Publication Date
- 2024-09-20
AI Technical Summary
The existing front-end project testing method requires developers to write multiple sets of test programs, which has a high technical threshold, resulting in a heavy workload, and cannot effectively ensure that the project's logic errors in the production environment increase the workload of developers and testers.
By obtaining test cases generated by manual testing behaviors, identify and mark page elements, and use marked elements to automatically operate on front-end project pages to achieve automated testing and reduce testers' workload and time.
It improves testing efficiency and accuracy, reduces testing costs, is suitable for more actual projects, has a wide range of applications, can complete a large number of tests in a short time, and reduces the workload of development and test personnel.
Smart Images

Figure CN118672887A
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of software testing, and in particular to a front-end project automated testing method, a front-end project automated testing device, and electronic equipment and a storage medium. Background Art
[0002] When the application software is developed, in order to ensure that a front-end project can be launched with as few vulnerabilities as possible, it is necessary to manually test the program in the development environment and the test environment. Only after the test is completed can it be officially launched in the production environment. However, once the project developer leaves, because the subsequent person who takes over the project does not understand the logical relationship between the project, if the code is slightly modified, it may cause other program logic errors. In addition, when the front-end project is released to the test environment, the tester generally only tests the currently modified or newly added modules, and cannot ensure that the logic of other modules is correct. When the front-end project is released to the production environment, those programs that were previously running well will cause new bugs due to subsequent changes. At this time, they have been released to the production environment, and users will find feedback to the developers. The developers will readjust and test according to user feedback, which greatly increases the workload of developers and testers. In addition, if only the faulty module is adjusted, the terminal project on the device may still have new logical faults.
[0003] Front-end projects refer to projects that build and develop user interfaces and user experiences, also known as "client-side projects". These projects usually use front-end technologies, such as HTML, CSS, and JavaScript, to create and design the appearance and interactive functions of websites or Web (World Wide Web) applications. At present, there are two main ways to test front-end projects: unit testing and e2e end-to-end testing. Unit testing starts from the perspective of developers. Developers write test code in the smallest functional logic unit and then quickly locate vulnerabilities. The main technologies used in unit testing are Mocha, Karma, etc. E2e end-to-end testing mainly starts from the user's perspective and writes test code in the form of user behaviors such as logging in and adding a shopping cart. The main technologies used in e2e end-to-end testing are Seleninum, NightwatchJS, Cypress, etc.
[0004] The above two testing methods require developers to write two or even three sets of programs, namely: programs to implement functions, unit test programs, and e2e end-to-end test programs. On the one hand, bugs and changes in requirements are very likely to occur, requiring developers to rewrite and debug programs, increasing the workload of developers. On the other hand, writing unit test programs and e2e end-to-end test programs has certain technical barriers and requires developers with solid testing technology and experience in writing test programs. Therefore, unit testing and e2e end-to-end testing are only used in a very small number of enterprises and open source projects, and are not applicable to most actual projects. Summary of the invention
[0005] The present invention aims to solve at least one of the technical problems existing in the prior art. To this end, one object of the present invention is to provide a front-end project automated testing method. The front-end project automated testing method can reduce the workload of developers and testers, greatly improve testing efficiency, and has a wide range of applications.
[0006] The second objective of the present invention is to provide a front-end project automated testing device.
[0007] A third objective of the present invention is to provide an electronic device.
[0008] A fourth object of the present invention is to provide a computer-readable storage medium.
[0009] In order to achieve the above-mentioned objectives, the front-end project automated testing method of the first aspect of the embodiment of the present invention includes: obtaining a test case generated according to the manual testing behavior of the target front-end project; obtaining element attribute information in the test case; determining the element type according to the element attribute information; obtaining a marking element according to the element type; and automatically operating the page of the target front-end project according to the marking element to realize automatic testing.
[0010] According to the front-end project automated testing method of the embodiment of the present invention, the test cases generated by the target front-end project based on manual testing behaviors are directly called, and the marking elements in the test cases can be used to automatically operate the pages of the target front-end project to realize automatic testing, which can complete a large number of tests in a short time, greatly improve the testing efficiency, reduce the workload of developers and testers, save testing time and testing costs, and the method has a low technical threshold for testing programs, can be applied to more actual projects, and has a wide range of applications.
[0011] In some embodiments, obtaining a test case generated based on manual testing behavior of a target front-end project includes: detecting manual testing behavior for the target front-end project page; capturing changes in content displayed in the target front-end project page; identifying test case elements based on changes in content displayed on the page, and marking the test case elements to generate marking elements; after the manual test is completed, generating a test case for the target front-end project based on all marking elements and saving the test case, thereby achieving generation of test cases in an automated manner, reducing the workload of testers, and improving testing efficiency and accuracy.
[0012] In some embodiments, the marking elements include use case input, event triggering and manual test results, and test case elements are identified according to changes in the page display content, and the test case elements are marked to generate marking elements, including: if the input item in the page display content inputs content, then the input item is marked as the use case input; if the trigger item element in the page display content is triggered, then the trigger item element is marked as the event trigger; and all elements that change in the page display content are obtained and marked as manual test results.
[0013] In some embodiments, automatically operating the page of the target front-end project according to the markup element to achieve automatic testing includes: automatically filling in the input value of the input item element of the page in the target front-end project according to the use case input.
[0014] In some embodiments, automatically operating the page of the target front-end project according to the marking element to achieve automatic testing also includes: determining the location information of the event trigger in the test case; triggering the trigger item element at the corresponding position in the page of the target front-end project according to the location information.
[0015] In some embodiments, the automatic operation of the page of the target front-end project according to the marking element to achieve automatic testing also includes: responding to the trigger instruction of the trigger item element, obtaining all changed elements in the page of the target front-end project and generating automatic test results; comparing the automatic test results with the manual test results; if the automatic test results are inconsistent with the manual test results, the test fails and a test error prompt is given.
[0016] In some embodiments, the front-end project automated testing method also includes: obtaining update information, the update information being information generated by re-manually testing the program errors and / or requirement changes of the target front-end project; updating the test cases according to the update information, thereby avoiding the testers from testing all the details of the front-end project simply because of a program error and / or requirement change in a certain place, greatly reducing the workload of the testers.
[0017] In order to achieve the above-mentioned purpose, the front-end project automated testing device of the second aspect of the embodiment of the present invention includes: a test case acquisition module, used to acquire test cases generated according to the manual testing behavior of the target front-end project; a marking element acquisition module, used to acquire marking elements in the test case; and a testing module, used to automatically test the target front-end project according to the marking elements.
[0018] According to the front-end project automation testing device of the embodiment of the present invention, the test case is generated by the test case acquisition module based on the manual testing behavior of the target front-end project. The testing module automatically tests the target front-end project by reading the marking elements in the test case. A large number of tests can be completed in a short time, which greatly improves the testing efficiency, reduces the workload of developers and testers, saves testing time and testing costs, and the device has a low technical threshold for testing programs, can be applied to more actual projects, and has a wide range of applications.
[0019] In order to achieve the above-mentioned purpose, the electronic device of the embodiment of the third aspect of the present invention includes: at least one processor; a memory communicatively connected to the at least one processor; the memory stores a computer program that can be executed by the at least one processor, and when the at least one processor executes the computer program, it implements the front-end project automated testing method described in the above embodiment.
[0020] In the electronic device according to the embodiment of the present invention, the processor is communicatively connected with the memory, and the processor implements the front-end project automated testing method described in the above embodiment by executing the computer program in the memory, which can complete a large number of tests in a short time, greatly improve the testing efficiency, reduce the workload of developers and testers, save testing time and testing costs, and has low requirements for test program writing technology, can be applied to more projects, and has a wide range of applications.
[0021] In order to achieve the above-mentioned purpose, the computer-readable storage medium of the fourth aspect of the present invention stores a computer program thereon, and when the computer program is executed by a processor, it implements the front-end project automated testing method described in the above embodiment.
[0022] Additional aspects and advantages of the present invention will be given in part in the following description and in part will be obvious from the following description, or will be learned through practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] The above and / or additional aspects and advantages of the present invention will become apparent and easily understood from the description of the embodiments in conjunction with the following drawings, in which:
[0024] Figure 1 is a block diagram of a front-end project testing system according to an embodiment of the present invention;
[0025] Figure 2 is a flowchart of a front-end project automated testing method according to an embodiment of the present invention;
[0026] Figure 3 is a schematic diagram of a login page process test according to an embodiment of the present invention;
[0027] Figure 4 is a flowchart of a front-end project automated testing method according to an embodiment of the present invention;
[0028] Figure 5 is a block diagram of a front-end project automated testing device according to an embodiment of the present invention;
[0029] Figure 6 is a block diagram of an electronic device according to an embodiment of the present invention.
[0030] Reference numerals:
[0031] Front-end project testing system 100;
[0032] Electronic device 1; Server 2;
[0033] Processor 11; Memory 12;
[0034] Front-end project automated testing device 200;
[0035] Test case acquisition module 201; tag element acquisition module 202; test module 203. DETAILED DESCRIPTION
[0036] Embodiments of the present invention are described in detail below. The embodiments described with reference to the accompanying drawings are exemplary. Embodiments of the present invention are described in detail below.
[0037] The front-end project automated testing method provided by the present invention can be applied to Figure 1In the application environment shown. The front-end project automated testing method is applied to a front-end project testing system. The front-end project testing system includes an electronic device 1 and a server 2. The electronic device 1 and the server 2 communicate through a network. Test cases for the target front-end project are generated through manual testing behaviors. When the target front-end project is tested, the test cases are directly called to obtain the marking elements in the test cases, and then the target front-end project can be automatically tested according to the marking elements. The electronic device 1 can be, but is not limited to, various personal computers, laptops, smart phones, tablet computers, and portable wearable devices, and the server 2 can be implemented with an independent server or a server cluster consisting of multiple servers.
[0038] Reference below Figure 2-Figure 4 A front-end project automated testing method according to an embodiment of the present invention is described.
[0039] Figure 2 is a flow chart of a front-end project automated testing method according to an embodiment of the present invention. Figure 2 As shown, the front-end project automated testing method of the embodiment of the present invention includes at least the following steps S1-S5.
[0040] S1, obtains test cases generated according to the manual testing behavior of the target front-end project.
[0041] Among them, manual testing behavior can be the tester simulating the user's real operation behavior when testing the target front-end project, such as entering data in the user interface, clicking buttons, scrolling pages, pulling down to refresh, etc. By simulating the user's real operation behavior, it can better simulate the user's usage scenarios of the front-end project, thereby better discovering potential problems and defects.
[0042] There are usually many ways to record manual testing behaviors, such as manual recording, screen recording, automated testing tool recording, and program recording.
[0043] Manual recording: Testers manually record information such as test steps, test data, and test results, usually using software such as Excel spreadsheets or test management tools.
[0044] Screen recording: Use screen recording software to record the screen operated by the tester for playback and analysis of test results.
[0045] Automated testing tools: Using automated testing tools, such as Selenium and Appium, you can automatically simulate user operation behaviors, record test results and logs, generate test reports, etc.
[0046] Program recording: Use the program to monitor the target front-end project and record the behavior and results of the tester's operations.
[0047] In some embodiments of the present invention, a page monitoring program can be used to record and monitor the operation behavior of the tester in real time. By analyzing and classifying these operation behaviors, corresponding test cases can be automatically generated, and the test cases of the target front-end project can be saved, and the test cases can be directly called when performing automated testing. In other embodiments, the test cases can be saved on the server, and when performing automated testing on the target front-end project, they can be directly called from the server.
[0048] S2, obtain the element attribute information in the test case.
[0049] The test cases include various elements of the front-end project page, such as user operation behavior and various information items of the page. Each element has element attribute information, such as the element's tag name, id, class, and other information.
[0050] S3, determining the element type according to the element attribute information.
[0051] Specifically, the test case includes various types of elements, among which the element type can be set, and the element type can be used as an information in the element attribute information. The element type can be determined from the element attribute information, for example, including key elements and other elements. The key elements can be elements that affect the front-end project test, such as user operation elements, etc. The key elements can be marked when obtaining the test case.
[0052] S4, obtaining a marked element according to the element type.
[0053] The marking element refers to an element or a group of elements in a test case, which is used to identify key elements in the test case. For example, the marking element may be the key element marked in the test case mentioned above.
[0054] In some embodiments, the marking element can be obtained by page monitoring, and page monitoring can be implemented by browser plug-ins or other tools. Therefore, through page monitoring, the element attribute information of the page element of the target front-end project can be obtained, such as the element's tag name, id, class and other attributes, and the corresponding key elements are marked, thereby obtaining the marking element in the test case.
[0055] S5, automatically operates the pages of the target front-end project according to the marked elements to achieve automatic testing.
[0056] Specifically, the test cases are automatically acquired and their marking elements are extracted, and the target front-end project's page is automatically operated according to the type of marking elements, such as inputting values, triggering corresponding positions, etc. The test results can be automatically recorded and analyzed during the test process, thereby realizing automated testing of the target front-end project and saving a lot of time and effort in manual testing.
[0057] According to the front-end project automated testing method of the embodiment of the present invention, the test case generated by the target front-end project based on the manual testing behavior is directly called, and the marking elements in the test case can be used to automatically operate the page of the target front-end project to realize automatic testing. It can complete a large number of tests in a short time, greatly improve the testing efficiency, reduce the workload of developers and testers, save testing time and testing costs, and the method has a low technical threshold for the testing program, can be applied to more actual projects, and has a wide range of applications.
[0058] The following further describes the process of generating test cases according to the manual test behavior of the target front-end project in an embodiment of the present invention.
[0059] In some embodiments, manual testing behaviors (such as input, click, slide, etc.) on the target front-end project page can be detected based on the page monitoring tool, and the time, location, input content, and other information of these operations can be recorded.
[0060] Furthermore, for each operation, changes in the displayed content in the target front-end project page are captured in response to the above manual testing behavior, and the time, location and content of these changes are recorded.
[0061] Furthermore, test case elements are identified according to changes in the page display content, and the test case elements are marked to generate marked elements; after the manual test is completed, test cases for the target front-end project are generated according to all marked elements and the test cases are saved.
[0062] Specifically, the changes in the page display content are matched with the test case elements to identify the elements of each test case, such as input box input, button trigger, etc. At the same time, these test case elements are marked, and then, after the manual test is completed, all marked elements are integrated into test cases, and finally a test case report is generated for subsequent automated testing.
[0063] In some embodiments, the marking elements include use case input, event triggering, and manual test results. Figure 3 The process of identifying test case elements according to changes in page display content and marking the test case elements to generate marked elements according to an embodiment of the present invention is further described.
[0064] like Figure 3 As shown, if after the user enters content in the username input box in the login page display content, the page has not changed except for the additional input content in the username input box (each comparison is only compared with the latest page), the username input box element is marked as a use case input. Similarly, if after the user enters content in the password input box in the login page display content, the page has not changed except for the additional input content in the password input box (each comparison is only compared with the latest page), the password input box element is also marked as a use case input.
[0065] Furthermore, when the user clicks the login button, the page will jump and the URL (Uniform Resource Locator) in the address bar will change. Therefore, the login button, a triggering element, can be marked as an event trigger.
[0066] Furthermore, when the page jumps, the page display content changes, and there may be prompt information of successful login or failed login, such as successful login or wrong username and password, etc. All elements that change in the page display content can be obtained and marked as manual test results.
[0067] Therefore, by using page monitoring tools to detect manual testing behaviors on the target front-end project pages, and marking use case inputs, event triggers, and manual test results, a test case report can be generated and automated testing can be performed.
[0068] The following further describes the process of automatically operating the page of the target front-end project according to the marking elements to achieve automatic testing in an embodiment of the present invention. Figure 4 is a flow chart of a front-end project automated testing method according to an embodiment of the present invention. Figure 4 As shown, the front-end project automated testing method of the embodiment of the present invention includes at least the following steps S10-S17.
[0069] S10, obtaining a test case input element in the test case, and automatically filling in the input value of the input item element of the page in the target front-end project according to the test case input.
[0070] In an embodiment, a login operation is performed on the page, and the test case requires the input of a username and password. The automated testing tool can locate the input boxes of the username and password based on the input item element tags, and then simulate keyboard input to automatically fill in the corresponding username, password and other information.
[0071] S11, determining the location information of the event triggering in the test case.
[0072] S12, triggering a trigger item element at a corresponding position in the page of the target front-end project according to the position information.
[0073] In an embodiment, to perform a login operation on a page, the test case needs to click a "Login" button. The automated testing tool will find the location information of the "Login" button based on the marking elements in the test case, and move the mouse to the corresponding position for clicking.
[0074] S13, in response to the trigger instruction of the trigger item element, obtaining all changed elements in the page of the target front-end project and generating automatic test results.
[0075] In the embodiment, in the login page, when we click the "Login" button, there may be multiple situations, such as successful login, wrong username or password, etc. The automated testing tool can determine whether the login is successful based on the page changes, and whether it jumps to the correct page after successful login.
[0076] S14, comparing the automatic test result with the manual test result.
[0077] S15, if the automatic test result is inconsistent with the manual test result, the test fails and a test error prompt is given.
[0078] In an embodiment, the automated testing tool will detect whether the changes in the page are consistent with the previously recorded manual test results of the user. If not, the automated testing tool will prompt that the test has failed, the test action will stop, and the console will prompt a test error message to facilitate the developer to repair it.
[0079] S16, obtaining update information, where the update information is information generated by re-manual testing of program errors and / or requirement changes of the target front-end project.
[0080] S17, update the test case according to the updated information.
[0081] In an embodiment, if a program error occurs in the login page, for example, the user enters the correct username and password, but the system cannot verify it and the login fails, the update information includes modification or repair of the login verification process, and then, only the program error is manually retested and the test case is re-executed to ensure that the error has been corrected.
[0082] In an embodiment, if a requirement change occurs in the login page, such as adding a new verification code input box, the automated testing tool will obtain update information, which includes modifications to the login page, and then update the previously generated manual test behavior, generate new test cases by detecting the new manual test behavior, and re-execute the test cases to ensure that the new requirements are met.
[0083] In summary, the tester conducts manual testing manually, and captures and records manual testing behaviors through page monitoring, marks the page elements of the target front-end project according to the three elements of case input, event triggering, and manual test results, and generates a test case report. Then, the automated testing tool automatically fills in the input values in the test case through keyboard input according to the test case report, simulates the user clicking on the corresponding element through mouse movement to test, and detects whether the changes on the page are consistent with the previously recorded manual test results. If not, the test fails, the test action stops, and the console prompts the test error information. During the test process, if a program error or requirement change occurs, the developer can modify the program, run the test program generated by the automated testing tool, and re-perform manual testing for program errors and requirement changes. Then, update the previous manual test behavior and generate a new test case report. When it is necessary to re-test the project comprehensively, only the updated test case needs to be executed, so that a large number of tests can be completed in a short time, greatly improving the test efficiency, reducing the workload of developers and testers, reducing the probability of program logic errors, ensuring the quality of front-end project development, saving test time and test costs, and improving economic benefits.
[0084] The following describes a front-end project automated testing device according to an embodiment of the second aspect of the present invention.
[0085] Figure 5 is a block diagram of a front-end project automated testing device according to an embodiment of the present invention. Figure 5 As shown, the front-end project automated testing device 200 includes: a test case acquisition module 201 , a mark element acquisition module 202 and a testing module 203 .
[0086] In the embodiment of the present invention, the front-end project automated testing device 200 may be an automated testing tool established based on test cases generated based on manual testing behaviors of the target front-end project.
[0087] The test case acquisition module 201 is used to acquire test cases generated according to the manual test behavior of the target front-end project. Specifically, the test case acquisition module monitors the tester in the manual test of the front-end project, simulates the user's operation behavior, such as mouse clicks, keyboard input, etc., automatically generates test cases according to these operation behaviors, and saves the test cases in the test case library.
[0088] The tag element acquisition module 202 is used to acquire the tag elements in the test case. Specifically, the tag element acquisition module acquires the test case that needs to be automated tested from the test case library, parses the tag elements in the test case, such as case input, event triggering, manual test results, etc., acquires the corresponding page element information according to the tag elements, and saves it in the element library.
[0089] The test module 203 is used to automatically test the target front-end project according to the marked elements. Specifically, the test module 203 obtains the page element information that needs to be operated from the element library, automatically fills in the test case input element in the test case, and executes the event trigger element in the test case, such as clicking the "login" button, etc., and then generates an automatic test result, and detects whether the automatic test result is consistent with the manual test result in the test case. If it is inconsistent, the test fails and a test error prompt is given.
[0090] According to the front-end project automation testing device 200 of the embodiment of the present invention, the test case acquisition module 201 generates the test case based on the manual testing behavior of the target front-end project, and the testing module 203 automatically tests the target front-end project by reading the marking elements in the test case. A large number of tests can be completed in a short time, which greatly improves the testing efficiency, reduces the workload of developers and testers, saves testing time and testing costs, and the device has a low technical threshold for testing programs, can be applied to more actual projects, and has a wide range of applications.
[0091] The following describes an electronic device according to an embodiment of the third aspect of the present invention.
[0092] Figure 6 is a block diagram of an electronic device according to an embodiment of the present invention, such as Figure 6 As shown, the electronic device 1 includes: at least one processor 11 and a memory 12 communicatively connected to the at least one processor 11 .
[0093] The memory 12 stores a computer program that can be executed by at least one processor 11 , and when at least one processor 11 executes the computer program, the front-end project automated testing method of the above embodiment is implemented.
[0094] According to the electronic device 1 of the embodiment of the present invention, the processor 11 is communicatively connected with the memory 12. The processor 11 implements the front-end project automation testing method described in the above embodiment by executing the computer program in the memory 12. A large number of tests can be completed in a short time, which greatly improves the testing efficiency, reduces the workload of developers and testers, saves testing time and testing costs, and has low requirements for test program writing technology, can be applied to more projects, and has a wide range of applications.
[0095] The embodiment of the present invention also provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the front-end project automated testing method described in the above embodiment is implemented. The specific implementation process of the front-end project automated testing method can refer to the description of the above embodiment.
[0096] Wherein, in an embodiment, the above front-end project automated testing method can be embodied by a computer-readable storage medium storing a computer program, which can be embodied by a computer-readable code, and the computer-readable code includes instructions that can be executed by at least one computing device. The computer-readable storage medium can be associated with any data storage device capable of storing data, and the data can be read by a computer system. Computer-readable storage media for example may include read-only memory, random access memory, CD-ROM, HDD, DVD, magnetic tape, and optical data storage device, etc. The computer-readable storage medium can also be distributed in computer systems connected via a network, so that the computer-readable code can be distributedly stored and executed.
[0097] In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "illustrative embodiments", "examples", "specific examples", or "some examples" means that the specific features, structures, materials, or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example.
[0098] Although the embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the claims and their equivalents.
Claims
1. A front-end project automated testing method, characterized in that: include: Get test cases generated based on the manual testing behavior of the target front-end project; Obtaining element attribute information in the test case; Determine the element type according to the element attribute information; Obtain a marked element according to the element type; as well as The page of the target front-end project is automatically operated according to the marking element to realize automatic testing.
2. The front-end project automated testing method according to claim 1, characterized in that: Get test cases generated based on the manual testing behavior of the target front-end project, including: Detecting manual testing behavior on the target front-end project page; capturing changes in displayed content in the target front-end project page in response to the manual testing behavior; Identifying a test case element according to a change in the displayed content of the page, and marking the test case element to generate a marking element; After the manual test is completed, a test case of the target front-end project is generated according to all the marked elements and the test case is saved.
3. The front-end project automated testing method according to claim 2, characterized in that: The marking elements include use case input, event triggering and manual test results, identifying test case elements according to changes in the page display content, and marking the test case elements to generate marking elements, including: If the input item in the page display content inputs content, marking the input item as the use case input; If a triggering element in the page display content is triggered, marking the triggering element as the event trigger; and All elements that have changed in the displayed content of the page are obtained and marked as manual test results.
4. The front-end project automated testing method according to claim 3, characterized in that: The automatically operating the page of the target front-end project according to the marking element to realize automatic testing includes: Automatically fill in the input value of the input item element of the page in the target front-end project according to the use case input.
5. The front-end project automated testing method according to claim 4, characterized in that: The automatically operating the page of the target front-end project according to the marking element to realize automatic testing also includes: Determine the location information of the event triggering in the test case; Trigger the trigger item element at the corresponding position in the page of the target front-end project according to the position information.
6. The front-end project automated testing method according to claim 5, characterized in that: The automatically operating the page of the target front-end project according to the marking element to realize automatic testing also includes: In response to the trigger instruction of the trigger item element, all elements changed in the page of the target front-end project are obtained and automatic test results are generated; comparing the automatic test result with the manual test result; If the automatic test result is inconsistent with the manual test result, the test fails and a test error prompt is given.
7. The front-end project automated testing method according to any one of claims 1 to 6, characterized in that: The front-end project automated testing method also includes: Acquire update information, where the update information is information generated by manually retesting program errors and / or requirement changes of the target front-end project; The test case is updated according to the update information.
8. A front-end project automated testing device, characterized in that: include: A test case acquisition module is used to acquire test cases generated according to the manual test behavior of the target front-end project; A marking element acquisition module, used to acquire the marking elements in the test case; A testing module is used to automatically test the target front-end project according to the marking element.
9. An electronic device, characterized in that: include: at least one processor; a memory communicatively coupled to the at least one processor; The memory stores a computer program that can be executed by the at least one processor, and when the at least one processor executes the computer program, the front-end project automated testing method described in any one of claims 1-7 is implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the front-end project automated testing method according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Semi-automatic test method for automatic filling function of password manager
CN119415395A
A semi-automated testing method for the automatic filling function of a password manager
CN119415395B
