CN-115878469-B - System testing method and device, electronic equipment and storage medium
Abstract
The application discloses a system testing method, a system testing device, electronic equipment and a storage medium, which are used for improving the efficiency of system testing and reducing the testing cost. The method comprises the steps of responding to triggering operation aiming at a page to be tested, obtaining each text and each control on the page, determining the adaptation value of the text and the control aiming at any one text and control, determining the target control corresponding to each text by adopting a trained neural network according to the adaptation value of each text and each control, respectively filling language information corresponding to each text in a received execution command into the corresponding target control, and determining that preliminary test on the page to be tested is successful if filling is successful. The adaptation value of the text and the control is determined through the acquired position information of the text and the control, XML path information and corresponding language information, and the target control corresponding to each text is determined based on the adaptation value, so that the system test method is simple and easy to realize, and the system test efficiency can be improved on the basis of reducing the system test cost.
Inventors
- LIU JUN
- SUN RUICHAO
- PANG YANGUANG
- WANG BOWEI
- XIAO YU
- LI HONGWEI
- SU JUNCHAO
- WU SHIJIE
- Yang Runzhao
Assignees
- 大商所飞泰测试技术有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20221212
- Priority Date
- 20221208
Claims (8)
- 1. A system testing method, the method comprising: responding to triggering operation for a corresponding page to be tested in the system, and acquiring each text and each control in the page to be tested; Determining the relative position relation of the text and the control according to the position information of the text and the control, determining the matching degree of the XML path information of the text and the XML path information of the control according to the path separator in the XML path information of the text and the control, determining the matching degree of the language information of the text and the language information of the control according to the number of characters in the language information of the text and the language information of the control, inputting the relative position relation and the matching degree into a trained neural network model, and obtaining the matching value of the text and the control; Determining target controls corresponding to each text based on the adaptation values of each text in the page to be tested and each control; respectively filling language information corresponding to each text in the received execution command into corresponding target controls; and if the filling is successful, determining that the preliminary test on the page to be tested is successful.
- 2. The method of claim 1, wherein the determining the relative positional relationship of the text and the control based on the respective positional information of the text and the control comprises: determining boundary length information of the text based on the position information of the text, and determining the boundary length information of the control based on the position information of the control; The method comprises the steps of obtaining a position relation of a text relative to a control based on the difference between boundary length information of the text and the control when the boundary of the control is taken as a reference, and determining the position relation of the control relative to the text based on the difference between the text and the boundary length information of the control when the boundary of the text is taken as a reference; And obtaining the relative position relation between the text and the control based on the position relation of the control relative to the text.
- 3. The method of claim 1, wherein the determining the matching degree of the XML path information of the text and the XML path information of the control based on the path delimiters in the XML path information of the text and the XML path information of the control, respectively, comprises: Obtaining a text path character sequence based on the path separator in the XML path information of the text, and obtaining a control path character sequence based on the path separator in the XML path information of the control; Sequentially carrying out matching processing on text path characters in the text path character sequence and control path characters in the control path character sequence until unmatched text path characters and unmatched control path characters are determined; Determining a first number of text path characters after the unmatched text path characters in the text path character sequence, and determining a second number of control path characters after the unmatched control path characters in the control path character sequence; and determining the matching degree of the XML path information of the text and the XML path information of the control based on the matching formulas of the first number, the second number and the XML path information.
- 4. The method of claim 1, wherein the determining the degree of matching of the language information of the text with the language information of the control based on the number of characters in the language information of each of the text and the control comprises: Determining the number of the same characters in the language information of the text and the language information of the control; And determining the matching degree of the language information of the text and the language information of the control based on the number of the same characters, the number of characters in the language information of each of the text and the control and a text matching formula.
- 5. The method of claim 1, wherein after determining the degree of matching of the text to the control based on the extensible markup language XML path information and the language information of the text and the control, respectively, the method further comprises: Determining a text length value of the text and a text end mark value based on the language information of the text; inputting the relative position relation and the matching degree into a trained neural network model to obtain an adaptation value of the text and the control, wherein the adaptation value comprises the following steps: And inputting the relative position relation, the matching degree, the text length value and the text end mark value into a trained neural network model to obtain an adaptation value of the text and the control.
- 6. A system testing apparatus, the apparatus comprising: The acquisition module is used for responding to the triggering operation of the corresponding page to be detected in the system and acquiring each text and each control in the page to be detected; The adaptation value determining module is used for determining the relative position relation between the text and the control according to the position information of the text and the control, determining the matching degree of the XML path information of the text and the XML path information of the control according to the path separator in the XML path information of the text and the control, determining the matching degree of the language information of the text and the language information of the control according to the number of characters in the language information of the text and the language information of the control, inputting the relative position relation and the matching degree into the trained neural network model, and obtaining the adaptation value of the text and the control; the target control determining module is used for determining target controls corresponding to each text based on the adaptation values of each text in the page to be tested and each control; The filling module is used for filling language information corresponding to each text in the received execution command into corresponding target controls respectively; and the preliminary test success determining module is used for determining that the preliminary test on the page to be tested is successful if the filling is successful.
- 7. An electronic device comprising at least one processor, and a memory communicatively coupled to the at least one processor, wherein the memory stores instructions executable by the at least one processor to implement the method of any of claims 1-5.
- 8. A computer storage medium, characterized in that the computer storage medium stores a computer program for enabling a computer to perform the method according to any one of claims 1-5.
Description
System testing method and device, electronic equipment and storage medium Cross Reference to Related Applications The present application claims priority from the chinese patent application filed at month 08 of 2022, the chinese national intellectual property agency, application No. 202211571889.X, application name "a system test method, apparatus, electronic device and storage medium", the entire contents of which are incorporated herein by reference. Technical Field The present application relates to the field of internet technologies, and in particular, to a system testing method, a device, an electronic apparatus, and a storage medium. Background The rapid development of the internet has led to an increase in industry competition, and software product iteration in various fields is also more and more frequent. In some special fields, such as finance, government and the like, the used systems have the characteristics of large number of users and wide influence range. Therefore, after each product iteration, software testing for the new system is necessary to ensure system reliability, and the cost consumption of frequently performing system testing is very expensive for the user. In the related art, the page is scanned by adopting the OCR technology, the positions of the texts and the controls are locked, and the test script is executed based on the positions, but the method is long in time consumption and high in cost. Disclosure of Invention The application aims to provide a system testing method, a system testing device, electronic equipment and a storage medium, which are used for improving the efficiency of system testing and reducing the cost of page testing. In a first aspect, an embodiment of the present application provides a system testing method, where the method includes: responding to triggering operation for a corresponding page to be tested in the system, and acquiring each text and each control in the page to be tested; determining an adaptation value of the text and the control according to the difference between the position information of the text and the control, XML path information and corresponding language information; Determining target controls corresponding to each text based on the adaptation values of each text in the page to be tested and each control; respectively filling language information corresponding to each text in the received execution command into corresponding target controls; and if the filling is successful, determining that the preliminary test on the page to be tested is successful. According to the method, the adaptation value of the text and the control is determined by acquiring the respective position information, the XML path information and the corresponding language information of the text and the control in the webpage to be tested, and the target control corresponding to each text is determined based on the adaptation value. In some possible embodiments, the determining the adaptation value of the text and the control based on the difference between the position information of the text and the control, the XML path information, and the corresponding language information includes: determining the relative position relation between the text and the control based on the respective position information of the text and the control; determining the matching degree of the text and the control based on the XML path information and language information of the text and the control respectively; and inputting the relative position relation and the matching degree into a trained neural network model to obtain an adaptation value of the text and the control. In the application, the adaptation value between the text and the control can be determined through the trained neural network model, and the method is simple and easy to realize. In some possible embodiments, the determining, based on the respective position information of the text and the control, a relative position relationship between the text and the control includes: determining boundary length information of the text based on the position information of the text, and determining the boundary length information of the control based on the position information of the control; The method comprises the steps of obtaining a position relation of a text relative to a control based on the difference between boundary length information of the text and the control when the boundary of the control is taken as a reference, and determining the position relation of the control relative to the text based on the difference between the text and the boundary length information of the control when the boundary of the text is taken as a reference; And obtaining the relative position relation between the text and the control based on the position relation of the control relative to the text. In the embodiment of the application, the relative position relation between the text and the control is determined by the boundary