Browser control method, browser control device and readable storage medium

By displaying the interface extraction configuration interface in the browser, the system automatically detects and extracts interface request information, solving the problem of the tedious and error-prone nature of manually searching for interface information and achieving efficient interface information acquisition.

CN118643243BActive Publication Date: 2024-11-22SHENZHEN SMARTCITY TECH DEV GRP CO LTD +1
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202411118352.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-08-15
Publication Date
2024-11-22
Estimated Expiration
2044-08-15

AI Technical Summary

Technical Problem

In existing technologies, manually searching for the corresponding interface information for webpage request information is a complicated process, which makes the interface information prone to errors and inefficient.

Method used

By displaying the interface information extraction configuration interface in the browser, the system receives user configuration data, determines the target test interface, and executes the interface information extraction rules based on the configuration data to automatically detect and extract interface request information.

Benefits of technology

It enables browsers to automatically extract and process interface information, improving the accuracy and efficiency of interface information detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118643243B_ABST
    Figure CN118643243B_ABST
Patent Text Reader

Abstract

The present invention relates to the field of electronic digital data processing technology, and in particular to a browser control method, a browser control device, and a readable storage medium. The method outputs an interface extraction information configuration interface when a configuration process is triggered; after the interface extraction information configuration interface receives configuration data, a target test interface is determined based on the configuration data; according to the configuration data corresponding to the target test interface, a configuration operation is performed on an interface information extraction rule corresponding to the target test interface; when the browser enters a page access process or receives a URL, an interface request of the current web page is detected; when it is detected that the interface request of the current web page is an interface request corresponding to the target test interface, the configured interface information extraction rule corresponding to the target test interface is called to extract the interface information corresponding to the interface request. The method realizes the automatic extraction and processing of interface information by the browser.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electronic digital data processing, and in particular to a browser control method, a browser control device and a readable storage medium. Background Art

[0002] Before conducting a web interface test, the user needs to use the browser developer tools to obtain the interface information corresponding to the interface request from the web request, and convert the interface information corresponding to the target interface into the target format according to the format requirements of the web interface testing tool, and then copy it to the web interface testing tool to test the web interface.

[0003] This method requires users to search for interface information corresponding to web page request information through browser developer tools, which needs to be completed manually by users. Since the process of searching for interface information corresponding to web page request information is complicated, the obtained interface information is prone to errors and the efficiency of obtaining interface information is low.

[0004] The above contents are only used to assist in understanding the technical solution of the present invention and do not constitute an admission that the above contents are prior art. Summary of the invention

[0005] The main purpose of the present invention is to provide a browser control method, which aims to solve the problem that the process of manually searching for interface information corresponding to web page request information is relatively complicated, which leads to the problem that the interface information obtained is prone to errors and the efficiency of obtaining the interface information is low.

[0006] To achieve the above object, the present invention provides a browser control method, which comprises the following steps:

[0007] When the configuration process is triggered, the output interface extracts the information configuration interface;

[0008] After the interface extraction information configuration interface receives the configuration data, determining the target test interface based on the configuration data;

[0009] According to the configuration data corresponding to the target test interface, performing a configuration operation on the interface information extraction rule corresponding to the target test interface;

[0010] When the browser enters the page access process, or receives a URL, it detects the interface request of the current web page;

[0011] When it is detected that the interface request of the current webpage is the interface request corresponding to the target test interface, the configured interface information extraction rule corresponding to the target test interface is called to extract the interface information corresponding to the interface request.

[0012] Optionally, when the browser enters the page access process or receives the URL, after the step of detecting the interface request of the current web page, the method further includes:

[0013] After detecting the interface request of the webpage, verifying whether the interface request is an interface request corresponding to the target test interface;

[0014] If not, outputting selection information of whether to use the interface corresponding to the interface request as the target test interface;

[0015] After receiving the confirmation information of the response, the interface corresponding to the interface request is used as the target test interface, and the step of outputting the interface extraction information configuration interface when the configuration process is triggered is performed;

[0016] After receiving a negative response, the interface corresponding to the interface request is used as a non-test interface, and when the interface request is detected again, the step of outputting the selection information of whether to use the interface corresponding to the interface request as the target test interface is not performed.

[0017] Optionally, after detecting the interface request of the webpage, the step of verifying whether the interface request is an interface request corresponding to the target test interface includes:

[0018] Determine a corresponding interface type based on the interface request;

[0019] When the interface type corresponding to the interface request matches the interface type corresponding to the target test interface, determining that the interface request is the interface request corresponding to the target test interface;

[0020] When the interface type corresponding to the interface request does not match the interface type corresponding to the target test interface, it is determined that the interface request is not the interface request corresponding to the target test interface.

[0021] Optionally, the step of performing a configuration operation on an interface information extraction rule corresponding to the target test interface according to the configuration data corresponding to the target test interface includes:

[0022] According to the type of the configuration data, calling a corresponding configuration strategy;

[0023] Based on the configuration policy and the configuration data, a configuration operation is performed on the interface information extraction rule corresponding to the target test interface.

[0024] Optionally, the step of calling a corresponding configuration policy according to the type of the configuration data includes:

[0025] When the type of the configuration data is the configuration data selected based on the interface extraction information configuration interface, calling a configuration strategy for performing a configuration operation according to the selected configuration data;

[0026] When the type of the configuration data is a regular expression, calling a regular expression configuration strategy;

[0027] When the type of the configuration data is text data, a configuration strategy based on a natural language model is called.

[0028] Optionally, the step of performing a configuration operation on an interface information extraction rule corresponding to the target test interface based on the configuration policy and the configuration data includes:

[0029] When the configuration strategy is the configuration strategy based on the natural language model, calling a pre-trained natural language model;

[0030] Inputting the configuration data into the natural language model as an input parameter of the natural language model to obtain an execution code corresponding to the configuration data;

[0031] According to the execution code, a configuration operation is performed on the interface information extraction rule corresponding to the target test interface.

[0032] Optionally, when it is detected that the interface request of the webpage is the interface request corresponding to the target test interface, calling the configured interface information extraction rule corresponding to the target test interface, the step of extracting the interface information corresponding to the interface request includes:

[0033] Call the configured interface information extraction rule corresponding to the target test interface, match the target interface information corresponding to the interface request, and extract the target interface information, wherein the target interface information includes at least one of the request URL, request method, request header, and request parameters.

[0034] Optionally, when detecting that the interface request of the webpage is the interface request corresponding to the target test interface, calling the configured interface information extraction rule corresponding to the target test interface to extract the interface information corresponding to the interface request further includes:

[0035] Determine the export format of the interface information according to the bound interface testing tool;

[0036] Exporting the interface information into interface test data in the export format and saving it as a collection file;

[0037] The collection file is input into the interface testing tool to obtain the test result of the target test interface.

[0038] In addition, to achieve the above-mentioned purpose, the present invention also provides a browser control device, which includes a memory, a processor, and a browser control program stored in the memory and executable on the processor, and the browser control program implements the steps of the browser control method described above when executed by the processor.

[0039] In addition, to achieve the above-mentioned purpose, the present invention also provides a computer-readable storage medium, on which a browser control program is stored, and when the browser control program is executed by a processor, the steps of the browser control method described above are implemented.

[0040] The embodiment of the present invention provides a browser control method, a browser control device and a readable storage medium, which receive configuration information configured by a user for interface extraction information rules and a target test interface specified by the user through an output interface extraction information configuration interface. After receiving the configuration data input by the user, the interface extraction information configuration interface parses the configuration data and determines the target test interface, and then determines the interface information extraction rule that needs to perform the configuration operation later. According to the configuration data corresponding to the target test interface, the configuration operation of the interface information extraction rule is performed. That is, according to the characteristics and requirements of the user for the target test interface, the interface information extraction rule is configured to improve the correctness of the interface request detected in the subsequent detection of the interface request and the extraction of the interface information, and the correctness of the extracted interface information. When the browser enters the page access process or receives the URL, the interface request of the current webpage is detected, and when it is detected that the interface request is the interface request corresponding to the target test interface, the configured interface information extraction rule is called to extract the interface information of the interface corresponding to the interface request. The automatic extraction and processing of the interface information by the browser is realized, so that the browser can automatically extract the interface information of the target test interface. BRIEF DESCRIPTION OF THE DRAWINGS

[0041] The drawings herein are incorporated into and constitute a part of the specification, illustrate embodiments consistent with the present invention, and together with the specification are used to explain the principles of the present invention. In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the description of the embodiments are briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative labor.

[0042] Figure 1 A schematic diagram of the architecture of the hardware operating environment of the browser control device involved in the embodiment of the present invention;

[0043] Figure 2 A schematic flow chart of a first embodiment of a method for controlling a browser of the present invention;

[0044] Figure 3 A schematic flow chart of a second embodiment of a method for controlling a browser of the present invention;

[0045] Figure 4 FIG. 4 is a flow chart of a third embodiment of a browser control method of the present invention.

[0046] The realization of the purpose, functional features and advantages of the present invention will be further explained in conjunction with embodiments and with reference to the accompanying drawings. DETAILED DESCRIPTION

[0047] The control method of the browser of the present application is as follows: when the configuration process is triggered, an interface extraction information configuration interface is output; after the interface extraction information configuration interface receives configuration data, a target test interface is determined based on the configuration data; according to the configuration data corresponding to the target test interface, a configuration operation is performed on the interface information extraction rule corresponding to the target test interface; when the browser enters the page access process or receives a URL, an interface request of the current web page is detected; when it is detected that the interface request of the current web page is an interface request corresponding to the target test interface, the configured interface information extraction rule corresponding to the target test interface is called to extract the interface information corresponding to the interface request. The automatic extraction and processing of interface information by the browser is realized.

[0048] In order to better understand the above technical solution, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments described herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0049] As an implementation plan, Figure 1 The schematic diagram is a schematic diagram of the architecture of the hardware operating environment of the browser control device involved in the embodiment of the present invention.

[0050] like Figure 1 As shown, the control device of the browser may include: a processor 101, such as a core processor, a memory 102, and a communication bus 103. The memory 102 may be a high-speed random access memory (RAM) memory, or a stable non-volatile memory (NVM), such as a disk memory. The memory 102 may optionally be a storage device independent of the aforementioned processor 101. The communication bus 103 is used to realize the connection and communication between these components.

[0051] Those skilled in the art will understand that Figure 1 The structure shown in the figure does not constitute a limitation on the control device of the browser, and may include more or less components than those shown in the figure, or combine certain components, or arrange the components differently.

[0052] like Figure 1 As shown, the memory 102 as a computer-readable storage medium may include an operating system, a data storage module, a network communication module, a user interface module, and a browser control program.

[0053] exist Figure 1 In the browser control device shown, the processor 101 and the memory 102 may be arranged in the browser control device, and the browser control device calls the browser control program stored in the memory 102 through the processor 101, and performs the following operations:

[0054] When the configuration process is triggered, the output interface extracts the information configuration interface;

[0055] After the interface extraction information configuration interface receives the configuration data, determining the target test interface based on the configuration data;

[0056] According to the configuration data corresponding to the target test interface, performing a configuration operation on the interface information extraction rule corresponding to the target test interface;

[0057] When the browser enters the page access process, or receives a URL, it detects the interface request of the current web page;

[0058] When it is detected that the interface request of the current webpage is the interface request corresponding to the target test interface, the configured interface information extraction rule corresponding to the target test interface is called to extract the interface information corresponding to the interface request.

[0059] In one embodiment, the processor 101 may be used to call a control program of the browser stored in the memory 102 and perform the following operations:

[0060] After detecting the interface request of the webpage, verifying whether the interface request is an interface request corresponding to the target test interface;

[0061] If not, outputting selection information of whether to use the interface corresponding to the interface request as the target test interface;

[0062] After receiving the confirmation information of the response, the interface corresponding to the interface request is used as the target test interface, and the step of outputting the interface extraction information configuration interface when the configuration process is triggered is performed;

[0063] After receiving a negative response, the interface corresponding to the interface request is used as a non-test interface, and when the interface request is detected again, the step of outputting the selection information of whether to use the interface corresponding to the interface request as the target test interface is not performed.

[0064] In one embodiment, the processor 101 may be used to call a control program of the browser stored in the memory 102 and perform the following operations:

[0065] Determine a corresponding interface type based on the interface request;

[0066] When the interface type corresponding to the interface request matches the interface type corresponding to the target test interface, determining that the interface request is the interface request corresponding to the target test interface;

[0067] When the interface type corresponding to the interface request does not match the interface type corresponding to the target test interface, it is determined that the interface request is not the interface request corresponding to the target test interface.

[0068] In one embodiment, the processor 101 may be used to call a control program of the browser stored in the memory 102 and perform the following operations:

[0069] According to the type of the configuration data, calling a corresponding configuration strategy;

[0070] Based on the configuration policy and the configuration data, a configuration operation is performed on the interface information extraction rule corresponding to the target test interface.

[0071] In one embodiment, the processor 101 may be used to call a control program of the browser stored in the memory 102 and perform the following operations:

[0072] When the type of the configuration data is the configuration data selected based on the interface extraction information configuration interface, calling a configuration strategy for performing a configuration operation according to the selected configuration data;

[0073] When the type of the configuration data is a regular expression, calling a regular expression configuration strategy;

[0074] When the type of the configuration data is text data, a configuration strategy based on a natural language model is called.

[0075] In one embodiment, the processor 101 may be used to call a control program of the browser stored in the memory 102 and perform the following operations:

[0076] When the configuration strategy is the configuration strategy based on the natural language model, calling a pre-trained natural language model;

[0077] Inputting the configuration data into the natural language model as an input parameter of the natural language model to obtain an execution code corresponding to the configuration data;

[0078] According to the execution code, a configuration operation is performed on the interface information extraction rule corresponding to the target test interface.

[0079] In one embodiment, the processor 101 may be used to call a control program of the browser stored in the memory 102 and perform the following operations:

[0080] Call the configured interface information extraction rule corresponding to the target test interface, match the target interface information corresponding to the interface request, and extract the target interface information, wherein the target interface information includes at least one of the request URL, request method, request header, and request parameters.

[0081] In one embodiment, the processor 101 may be used to call a control program of the browser stored in the memory 102 and perform the following operations:

[0082] Determine the export format of the interface information according to the bound interface testing tool;

[0083] Exporting the interface information into interface test data in the export format and saving it as a collection file;

[0084] The collection file is input into the interface testing tool to obtain the test result of the target test interface.

[0085] Based on the hardware architecture of the above-mentioned browser control device, an embodiment of the browser control method of the present invention is proposed.

[0086] Reference Figure 2 In a first embodiment, the browser control method comprises the following steps:

[0087] Step S100: When the configuration process is triggered, the output interface extracts the information configuration interface.

[0088] In this embodiment, when the configuration process of the browser test interface is triggered, the browser outputs an interface extraction information configuration interface. It should be noted that the interface extraction information configuration interface here provides an interactive operation interface for the user to receive the configuration data input by the user and the relevant information for configuring and setting the target test interface.

[0089] Based on the interface extraction information configuration interface, users can enter specific configuration data, such as selecting the target test interface, and whether to extract the target test interface's URL, request method, request header, request parameters and other information. Through the interface extraction information configuration interface, users can configure information extraction according to actual needs and the characteristics of the target test interface, thus ensuring that the required interface test information can be extracted.

[0090] Step S200: After the interface extraction information configuration interface receives configuration data, a target test interface is determined based on the configuration data.

[0091] In this embodiment, after the interface extraction information configuration interface receives the configuration data of the browser test interface, the interface identifier in the configuration data is read, and then the target test interface is determined based on the interface identifier. Optionally, the target test interface can be a login interface, a registration interface, a password retrieval interface, a payment interface, etc. It should be noted that the selection of the target test interface is determined based on specific needs and system characteristics, and can be adjusted according to actual conditions. It can be understood that the target test interface here refers to a specific interface that needs to be tested in the web page accessed by the browser.

[0092] Step S300: According to the configuration data corresponding to the target test interface, a configuration operation is performed on the interface information extraction rule corresponding to the target test interface.

[0093] In this embodiment, after determining the target test interface, the interface information extraction rule corresponding to the target test interface is matched, and then, according to the configuration data corresponding to the target test interface in the configuration data, the configuration action is executed on the interface information extraction rule of each target test interface.

[0094] Optionally, before executing configuration actions on the interface information extraction rules of each target test interface, the corresponding configuration strategy is called according to the type of the configuration data, and then the configuration operation is executed on the interface information extraction rules corresponding to the target test interface based on the configuration strategy and the configuration data.

[0095] Specifically, when the type of the configuration data is the configuration data selected based on the interface extraction information configuration interface, a configuration strategy is called to perform configuration operations according to the selected configuration data; when the type of the configuration data is a regular expression, a regular expression configuration strategy is called; when the type of the configuration data is text data, a configuration strategy based on a natural language model is called.

[0096] Since the configuration data selected through the interface information extraction configuration interface are predefined options and parameters, specific configuration operations need to be performed based on these option parameters. Therefore, if the type of configuration data is configuration data selected based on the interface information extraction configuration interface, it is necessary to call a configuration strategy that performs configuration operations based on the selected configuration data to configure the interface information extraction rules of each target test interface. Since regular expressions are used to match and extract text information in a specific format, if the type of configuration data is a regular expression, it is necessary to call a regular expression configuration strategy to define matching rules through regular expressions during the configuration process of the interface information extraction rules, and then configure the interface information extraction rules to extract the information of the target interface. When the type of configuration data is text data, by calling a configuration strategy based on a natural language model, the configuration data can be parsed and understood through natural language processing technology and machine learning algorithms, so that configuration operations can be automatically performed according to the configuration data.

[0097] The purpose of this is to select the corresponding configuration strategy to perform the configuration operation according to the type of configuration data, so as to ensure that the interface information extraction rule corresponding to the target test interface can be correctly configured. This further enhances the control function of the browser, so that the browser can automatically perform the action of extracting the interface information of the target test interface.

[0098] As an optional implementation, when the configuration strategy is a configuration strategy for performing configuration operations based on selected configuration data, the configuration options selected in the configuration data are extracted, and the parameters in the interface information extraction rules of the target test interface are matched; then, based on the configuration options selected in the configuration data, the parameters in the interface information extraction rules of the target test interface are configured to implement the configuration operation on the interface information extraction rules corresponding to the target test interface.

[0099] As another optional implementation, when the configuration strategy is a regular expression configuration strategy, an analysis action is performed on the received regular expression to determine the request URL, request method, request header, request parameters and other information of the target interface that needs to be extracted; then, according to the information of the target interface that needs to be extracted, the corresponding parameters in the interface information extraction rules of the target test interface are configured to implement the configuration operation on the interface information extraction rules corresponding to the target test interface.

[0100] As another optional implementation, when the configuration strategy is the configuration strategy based on the natural language model, a pre-trained natural language model is called; then, the configuration data is input into the natural language model as an input parameter of the natural language model to obtain an execution code corresponding to the configuration data; and then, according to the execution code, a configuration operation is performed on the interface information extraction rule corresponding to the target test interface.

[0101] Call the pre-trained natural language model, use the configuration data as natural language input, and obtain the execution code corresponding to the configuration requirements. In this way, even if the configuration requirements change or some specific interface information extraction rules are added, the interface information extraction rules can be adjusted directly by modifying the configuration data of the text data type, without rewriting and adjusting the regular expression rules. The purpose of this is to convert the configuration data into execution code through the pre-trained natural language model, simplify the configuration operation, improve the accuracy and efficiency of the configuration, and make the configuration process of the interface information extraction rules more intelligent and automated.

[0102] Step S400: When the browser enters the page access process or receives a URL, it detects the interface request of the current web page.

[0103] In this embodiment, after completing the configuration operation of the interface information extraction rules corresponding to the target test interface, the monitoring process of the browser is entered. When the browser is monitored to enter the page access process or receive the URL, the interface request of the current web page is detected.

[0104] When the browser starts loading a web page and rendering it, it will obtain page-related resources through network requests. These include the web page's HTML (Hyper Text Markup Language), CSS (Cascading Style Sheets), JavaScript files, and other external resources. During this process, the browser will send HTTP (Hypertext Transfer Protocol) requests to obtain these resources, and load and display the web page content through the received responses. During this process, if the web page being loaded contains an interface request for the target test interface, it will be detected by the browser's control method.

[0105] Step S500: when it is detected that the interface request of the current webpage is the interface request corresponding to the target test interface, the configured interface information extraction rule corresponding to the target test interface is called to extract the interface information corresponding to the interface request.

[0106] In this embodiment, when the interface request of the current webpage is detected, it is first verified whether the interface request is the interface request corresponding to the target test interface. Only when the interface request of the current webpage is the interface request corresponding to the target test interface, the configured interface information extraction rule corresponding to the target test interface is called to extract the interface information corresponding to the interface request.

[0107] It should be noted that the extracted interface information will be used for interface testing. Optionally, if the function of the interface corresponding to the interface request is to be tested, the extracted interface information includes interface information such as user interaction data, data interaction data or system operation data; if the performance of the interface corresponding to the interface request is to be tested, the extracted interface information includes interface response time or concurrent processing time and other interface information.

[0108] Optionally, when it is detected that the interface request of the web page is an interface request corresponding to the target test interface, the configured interface information extraction rule corresponding to the target test interface is called to match the target interface information corresponding to the interface request, and extract the target interface information, wherein the target interface information includes at least one of the request URL, request method, request header, and request parameters.

[0109] In the technical solution provided in this embodiment, the configuration information configured by the user for the interface extraction information rule and the target test interface specified by the user are received through the output interface extraction information configuration interface. After the interface extraction information configuration interface receives the configuration data input by the user, the configuration data is parsed and the target test interface is determined, and then the interface information extraction rule that needs to perform the configuration operation in the future is determined. According to the configuration data corresponding to the target test interface, the configuration operation of the interface information extraction rule is performed. That is, according to the characteristics and requirements of the user for the target test interface, the interface information extraction rule is configured to improve the correctness of the interface request detected in the subsequent detection of the interface request and the extraction of the interface information, and the correctness of the extracted interface information. When the browser enters the page access process or receives the URL, the interface request of the current webpage is detected, and when it is detected that the interface request is the interface request corresponding to the target test interface, the configured interface information extraction rule is called to extract the interface information of the interface corresponding to the interface request. The automatic extraction and processing of the interface information by the browser is realized, so that the browser can automatically extract the interface information of the target test interface.

[0110] Reference Figure 3 Based on the above embodiment, in the second embodiment, after the step of detecting the interface request of the current web page when the browser enters the page access process or receives the URL, it also includes:

[0111] Step S610: after detecting the interface request of the webpage, verify whether the interface request is an interface request corresponding to the target test interface;

[0112] Step S620: If not, outputting selection information of whether to use the interface corresponding to the interface request as the target test interface;

[0113] Step S630: after receiving the confirmation information of the response, taking the interface corresponding to the interface request as the target test interface, and executing the step of outputting the interface extraction information configuration interface when the configuration process is triggered;

[0114] Step S640: After receiving a negative response, the interface corresponding to the interface request is used as a non-test interface, and when the interface request is detected again, the step of outputting the selection information of whether to use the interface corresponding to the interface request as the target test interface is not executed.

[0115] In this embodiment, after detecting the interface request of the current web page, the browser needs to first verify whether the interface request is an interface request corresponding to the target test interface.

[0116] As an optional implementation, the corresponding interface type is determined based on the interface request, and then it is verified whether the interface type corresponding to the interface request matches the interface type corresponding to the target test interface. When the interface type corresponding to the interface request matches the interface type corresponding to the target test interface, the interface request is determined to be the interface request corresponding to the target test interface; when the interface type corresponding to the interface request does not match the interface type corresponding to the target test interface, the interface request is determined to be the interface request not corresponding to the target test interface. Among them, the type of the interface can be determined by analyzing the parameters, path, method and other information of the interface request.

[0117] Optionally, interfaces are classified according to their purpose and implementation methods, and the interface types include database interfaces, file interfaces, and third-party interfaces. The database interface here refers to an interface used to interact with a database system and perform database query, update, insert, and delete operations. Database interfaces include but are not limited to JDBC (Java Database Connectivity) and ODBC (Open Database Connectivity). The file interface here refers to an interface used to read and write local or remote files, access the structure, folders, and files of a file system, and operate on them. The file interface includes but is not limited to the API (Application Programming Interface) and FTP (File Transfer Protocol) of a file management system. The third-party interface here refers to an interface used to obtain external services, such as payment, maps, social media, etc., or to exchange data.

[0118] By determining the interface type corresponding to the interface request, and then verifying whether the interface type corresponding to the interface request matches the interface type corresponding to the target test interface. The purpose of this is to implement the screening and determination of interface requests, avoid misjudging irrelevant interface requests as requests of the target test interface, ensure that the browser only extracts interface information for interface requests corresponding to the target test interface, and further improve the accuracy of interface information extraction.

[0119] In this embodiment, after determining that the interface request is not an interface request corresponding to the target test interface, the browser outputs selection information on whether to use the interface corresponding to the interface request as the target test interface. The user can choose whether to use the interface corresponding to the interface request as the target test interface through the output selection information, and then return the result of the selection to the browser as a response to the selection information. After the browser receives the confirmation information of the response, the interface corresponding to the interface request is used as the target test interface, and the step of outputting the interface extraction information configuration interface when the configuration process is triggered is executed, and then the operation of configuring the interface information extraction rules corresponding to the interface request is executed. After the browser receives the negative information of the response, the interface corresponding to the interface request is used as a non-test interface, and when the interface request is detected again, the step of outputting the selection information on whether to use the interface corresponding to the interface request as the target test interface is not executed.

[0120] In the technical solution provided in this embodiment, by verifying whether the interface request is a request for the target test interface, it is decided whether to perform the subsequent interface information extraction operation. By outputting selection information when the interface request is not the target test interface, asking the user whether to use the interface as the target test interface to adapt to possible changes, the user is allowed to dynamically select the interface to be tested during operation, thereby increasing the flexibility and scalability of interface information extraction. By using the interface request as the target test interface when the interface request is confirmed to be the target test interface, and executing the configuration process of the interface information extraction rule, the interface information of the interface corresponding to the interface request is extracted. By marking the interface request as a non-test interface after receiving the negative information, the step of outputting the selection information is no longer executed, thereby avoiding repeated selection inquiries for non-target test interfaces, and improving the efficiency of interface information extraction.

[0121] Reference Figure 4 Based on the above embodiment, in a third embodiment, when it is detected that the interface request of the webpage is the interface request corresponding to the target test interface, the configured interface information extraction rule corresponding to the target test interface is called, and after the step of extracting the interface information corresponding to the interface request, the step further includes:

[0122] Step S710: Determine the export format of the interface information according to the bound interface testing tool;

[0123] Step S720: exporting the interface information into interface test data in the export format, and saving it as a collection file;

[0124] Step S730: input the collection file into the interface testing tool to obtain the test result of the target test interface.

[0125] In this embodiment, after the interface information is extracted, the extracted interface information is exported as interface test data. The interface test data here may include information such as the URL, request method, request parameters, and expected response of the interface. Then, the exported interface test data is input into the interface test tool, the test is executed, and the test result of the target test interface is obtained.

[0126] In this embodiment, since different interface testing tools may use different interface testing data formats, such as JSON, XML, CSV, etc., it is necessary to determine the export format of the interface information according to the bound interface testing tool.

[0127] The interface testing tool can send requests based on the exported interface test data and verify whether the responses are as expected to evaluate the performance, stability, and accuracy of the target test interface.

[0128] For example, suppose there is a website named "example.com" which contains multiple pages and related interfaces. After the interface information extraction rule is configured, when a browser accesses a page of "example.com", the interface request of the page is detected and the interface information corresponding to the interface request is extracted.

[0129] Assume that the user clicks the "Login" button on the website, triggering a request for the login interface. The browser detects the interface request and extracts the corresponding login interface request URL, request method, request header, request parameters and other information.

[0130] Assuming that the format of the input file of the bound interface test tool is XML format, the export format of the interface information is determined to be XML format. Then the browser converts the extracted interface information into interface test data in XML format and saves it as an XML collection file. Then, the XML collection file is imported into the bound interface test tool to test and analyze the login interface and obtain the corresponding test results.

[0131] In the technical solution provided in this embodiment, by determining the export format, it can be ensured that the interface information can be correctly parsed and used in subsequent test tools. By exporting the extracted interface information into interface test data in a specified format and saving it as a collection file. The collection file contains test data for multiple interfaces to implement batch execution of interface tests. By inputting the exported collection file into the interface test tool, it is used to perform interface testing to obtain the test results of the target test interface.

[0132] The interface information is extracted from the detected target test interface request, and according to the export format corresponding to the interface test tool, the interface information is exported as interface test data and input into the interface test tool for testing to verify whether the function and performance of the target test interface meet expectations. The interface information corresponding to the interface request of the web page is automatically extracted and converted into data compatible with the format of each interface test tool, which can then be directly imported into each interface test tool for use.

[0133] In addition, it can be understood by those skilled in the art that all or part of the processes in the method for implementing the above embodiment can be completed by instructing the relevant hardware through a computer program. The computer program includes program instructions, and the computer program can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the control device of the browser to implement the process steps of the embodiment of the above method.

[0134] Therefore, the present invention further provides a computer-readable storage medium, wherein the computer-readable storage medium stores a browser control program, and when the browser control program is executed by a processor, the various steps of the browser control method described in the above embodiment are implemented.

[0135] The computer-readable storage medium may be a USB flash drive, a mobile hard disk, a read-only memory (ROM), a magnetic disk, or an optical disk, etc., which are computer-readable storage media that can store program codes.

[0136] It should be noted that since the storage medium provided in the embodiment of the present application is the storage medium used to implement the method of the embodiment of the present application, based on the method introduced in the embodiment of the present application, the person skilled in the art can understand the specific structure and deformation of the storage medium, so it is not repeated here. All storage media used in the method of the embodiment of the present application belong to the scope of protection of this application.

[0137] It should be understood by those skilled in the art that the embodiments of the present invention may be provided as methods, systems or computer program products. Therefore, the present invention may take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0138] The present invention is described with reference to flowcharts and / or block diagrams of methods, devices (systems), and computer program products according to embodiments of the present invention. It should be understood that each process and / or block in the flowchart and / or block diagram, as well as the combination of processes and / or blocks in the flowchart and / or block diagram, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing device to produce a machine, so that the instructions executed by the processor of the computer or other programmable data processing device generate instructions for implementing the processes in the flowchart and / or block diagram. Figure 1 A process or multiple processes and / or boxes Figure 1 A device that provides the functions specified in a block or multiple blocks.

[0139] These computer program instructions may also be stored in a computer-readable memory capable of directing a computer or other programmable data processing device to operate in a specific manner, so that the instructions stored in the computer-readable memory produce an article of manufacture comprising an instruction device, which implements the process Figure 1 A process or multiple processes and / or boxes Figure 1 A function specified in one or more boxes.

[0140] These computer program instructions can also be loaded onto a computer or other programmable data processing device so that a series of operating steps are executed on the computer or other programmable device to produce a computer-implemented process, thereby providing instructions for implementing the process. Figure 1 A process or multiple processes and / or boxes Figure 1 The steps for the functions specified in one or more boxes.

[0141] It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claim. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means may be embodied by one and the same item of hardware. The use of the words first, second and third etc. does not indicate any order. These words may be interpreted as names.

[0142] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0143] Obviously, those skilled in the art can make various changes and modifications to the present invention without departing from the spirit and scope of the present invention. Thus, if these modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.

Claims

1. A method for controlling a browser, characterized in that: The browser control method comprises the following steps: When the configuration process is triggered, the output interface extracts the information configuration interface; After the interface extraction information configuration interface receives the configuration data, determining the target test interface based on the configuration data; When the type of the configuration data is the configuration data selected based on the interface extraction information configuration interface, calling a configuration strategy for performing a configuration operation according to the selected configuration data; Based on the configuration policy and the configuration data, performing a configuration operation on an interface information extraction rule corresponding to the target test interface; When the type of the configuration data is text data, calling a configuration strategy based on a natural language model and calling a pre-trained natural language model, inputting the configuration data into the natural language model as an input parameter of the natural language model, and obtaining an execution code corresponding to the configuration data; According to the execution code, a configuration operation is performed on the interface information extraction rule corresponding to the target test interface; When the browser enters the page access process or receives a URL, it detects the interface request of the current web page; After detecting the interface request of the webpage, determining the corresponding interface type based on the interface request; when the interface type corresponding to the interface request does not match the interface type corresponding to the target test interface, determining that the interface request is not an interface request corresponding to the target test interface, and outputting selection information on whether to use the interface corresponding to the interface request as the target test interface; After receiving the confirmation information of the response, the interface corresponding to the interface request is used as the target test interface, and the step of outputting the interface extraction information configuration interface when the configuration process is triggered is performed; When it is detected that the interface request of the current webpage is the interface request corresponding to the target test interface, the configured interface information extraction rule corresponding to the target test interface is called to extract the interface information corresponding to the interface request.

2. The browser control method according to claim 1, characterized in that: After the step of determining that the interface request is not an interface request corresponding to the target test interface when the interface type corresponding to the interface request does not match the interface type corresponding to the target test interface, and outputting the selection information of whether to use the interface corresponding to the interface request as the target test interface, the method further includes: After receiving a negative response, the interface corresponding to the interface request is used as a non-test interface, and when the interface request is detected again, the step of outputting the selection information of whether to use the interface corresponding to the interface request as the target test interface is not performed.

3. The browser control method according to claim 2, characterized in that: After the step of detecting the interface request of the webpage and determining the corresponding interface type based on the interface request, the method further includes: When the interface type corresponding to the interface request matches the interface type corresponding to the target test interface, the interface request is determined to be the interface request corresponding to the target test interface.

4. The browser control method according to claim 1, characterized in that: After the step of performing a configuration operation on the interface information extraction rule corresponding to the target test interface based on the configuration policy and the configuration data, the method further includes: When the type of the configuration data is a regular expression, a regular expression configuration strategy is called.

5. The browser control method according to claim 1, characterized in that: The step of calling the configured interface information extraction rule corresponding to the target test interface to extract the interface information corresponding to the interface request when detecting that the interface request of the webpage is the interface request corresponding to the target test interface comprises: Call the configured interface information extraction rule corresponding to the target test interface, match the target interface information corresponding to the interface request, and extract the target interface information, wherein the target interface information includes at least one of the request URL, request method, request header, and request parameters.

6. The browser control method according to claim 1, characterized in that: After the step of calling the configured interface information extraction rule corresponding to the target test interface to extract the interface information corresponding to the interface request when detecting that the interface request of the webpage is the interface request corresponding to the target test interface, the method further includes: Determine the export format of the interface information according to the bound interface testing tool; Exporting the interface information into interface test data in the export format and saving it as a collection file; The collection file is input into the interface testing tool to obtain the test result of the target test interface.

7. A browser control device, characterized in that: The browser control device comprises: a memory, a processor, and a browser control program stored in the memory and executable on the processor, wherein the browser control program is configured to implement the steps of the browser control method according to any one of claims 1 to 6.

8. A readable storage medium, characterized in that: The readable storage medium stores a browser control program, and when the browser control program is executed by a processor, the steps of the browser control method according to any one of claims 1 to 6 are implemented.

Citation Information

Patent Citations

  • Abnormal application interface prediction method and device, equipment and storage medium

    CN113608962A

  • Interface calling method and device, electronic equipment and storage medium

    CN115185717A

  • Query demand processing method and device, computer equipment and storage medium

    CN117827923A