A web page automatic operation method, device, electronic device and storage medium

By acquiring and converting web page operation data, cross-platform automatic operation import and execution is achieved, which solves the problems of poor compatibility and complex operation requirements in the existing technology, and improves the efficiency and security of web page automation.

CN118520192BActive Publication Date: 2024-10-15SHANDONG YINYAN TECHNOLOGY SERVICE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410989178.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-07-23
Publication Date
2024-10-15
Estimated Expiration
2044-07-23

AI Technical Summary

Technical Problem

Existing web automation tools have poor compatibility across different platforms, are difficult to flexibly respond to complex operational requirements, are not efficient and safe enough, cannot unify recording and playback operations, and lack template conversion mechanisms and security guarantees.

Method used

By obtaining the configuration information of the target web page and platform, recording the operation data, converting it into platform-matching script data according to the action template, and synchronizing it to the target platform, realizing cross-platform automated operation import and execution.

Benefits of technology

It improves the efficiency, flexibility and security of web page operation automation, generates standardized operation records, is suitable for a variety of automation platforms, and solves the problems of poor cross-platform compatibility and complex operation requirements.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118520192B_ABST
    Figure CN118520192B_ABST
Patent Text Reader

Abstract

The embodiment of the present invention discloses a web page automation operation method, device, electronic device and storage medium, which relates to the field of computer technology, wherein the method includes: obtaining a target web page and a target platform, obtaining configuration information of the target web page, recording the operation in the target web page to obtain the operation and corresponding operation data, converting the operation data into script data matching the target platform according to an action template, and synchronizing the script data to the target platform. The present invention realizes cross-platform automated operation import and execution by processing the network request of the interface, so that users can efficiently and flexibly record and replay web page operations, is applicable to a variety of automated platforms, improves the efficiency and applicability of web page operation automation, and solves the problems of poor cross-platform compatibility, inability to flexibly respond to complex operation requirements, and insufficient efficiency and security in the prior art.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a web page automation operation method, device, electronic equipment and storage medium. Background Art

[0002] With the rapid development of the Internet and information technology, web page automation testing and operation are becoming more and more important in software development, testing and operation and maintenance. Existing web page automation tools (such as ChroPath) provide powerful web page element positioning and action recording functions, which can help users record and replay operations on web pages.

[0003] However, existing technologies can usually only generate scripts in a specific format and are only suitable for specific automation platforms, resulting in poor compatibility between different platforms. Users need to manually modify or rewrite scripts to adapt to different automation platforms, which increases workload and complexity. They can usually only record simple user operations, such as clicks and inputs, and it is difficult to capture and process complex user interactions. They cannot flexibly respond to various complex operation requirements, which limits the coverage of automated testing and operations.

[0004] In addition, the existing technology lacks a unified template conversion mechanism, making it difficult to convert recorded operation actions into script templates suitable for different automation platforms. The data transmission method is not unified and lacks security guarantees. It is difficult to effectively transmit the generated templates to the target platform and ensure their correct execution. When importing and executing recorded operation actions in the automation platform, it involves permission information, identity authentication and data security issues. The existing technology lacks effective solutions to these problems.

[0005] Therefore, there is an urgent need for a web page automation operation method that can efficiently and flexibly record and replay web page operations, is applicable to multiple automation platforms, and improves the efficiency, flexibility and security of web page operation automation. Summary of the invention

[0006] The embodiments of the present invention provide a webpage automation operation method to solve the problems of poor cross-platform compatibility, inability to flexibly respond to complex operation requirements, and insufficient efficiency and security in the prior art. The technical solution is as follows:

[0007] According to one aspect of the present invention, a method for automated operation of a web page includes: obtaining a target web page and a target platform; obtaining configuration information of the target web page, and recording operations within the target web page to obtain operations and corresponding operation data; the configuration information includes login credentials, an interface URL, and an action template; converting the operation data into script data matching the target platform according to the action template; and synchronizing the script data to the target platform.

[0008] In one of the embodiments, obtaining the configuration information of the target web page and recording the operations in the target web page to obtain the operations and corresponding operation data are achieved through the following steps: obtaining the corresponding configuration information according to the HTTP request in the target web page; recording the input box and buttons of the target web page according to the configuration information, and obtaining the operation data in the input box and the operation corresponding to the button when the input box and button of the target web page meet the trigger condition.

[0009] In one of the embodiments, recording the input box and button of the target web page according to the configuration information is achieved by the following steps: operating the document object model of the target web page through the content script, adding an input box to the target web page; the input box is used to collect input data; setting properties for the input box and binding events to the input box through the content script, and obtaining the input data in the input box through a callback function; adding a button element to the target web page through the content script and setting a click response event; the button is used to trigger a specific action or event.

[0010] In one of the embodiments, converting the operation data into script data matching the target platform according to the action template is achieved by the following steps: parsing the operation data according to the action template and converting it into operation data structured in a data format; assembling the operation data into script data corresponding to the target platform according to the action template.

[0011] In one of the embodiments, recording the operations in the target web page to obtain the operations and corresponding operation data is achieved through the following steps: obtaining the operations in the target web page; the operations include clicking, opening a web page, and inputting; the operations carry a type identifier and a parameter placeholder; and obtaining the operation data corresponding to the operations according to the parameter placeholder.

[0012] In one of the embodiments, synchronizing the script data to the target platform is achieved by the following steps: transmitting the script data to the target platform through an interface of the target platform according to a POST request.

[0013] In one of the embodiments, the method further comprises the following steps: setting a content script for the target webpage, traversing DOM elements of the target webpage through the content script, and identifying whether there are input boxes and buttons;

[0014] If a button exists, a click event is added to the button through the content script, so that a callback function in the content script is triggered when the button is clicked.

[0015] According to one aspect of the present invention, a web page automation operation device includes: a target acquisition module, used to obtain a target web page and a target platform; a web page recording module, used to obtain configuration information of the target web page, and record operations within the target web page to obtain operations and corresponding operation data; a data conversion module, used to convert the operation data into script data matching the target platform according to the action template; and a data transmission module, used to synchronize the script data to the target platform.

[0016] According to one aspect of the present invention, an electronic device includes at least one processor and at least one memory, wherein the memory stores computer-readable instructions; the computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the web page automation operation method as described above.

[0017] According to one aspect of the present invention, a storage medium stores computer-readable instructions thereon, and the computer-readable instructions are executed by one or more processors to implement the web page automation operation method as described above.

[0018] The beneficial effects brought by the technical solution provided by the present invention are:

[0019] In the above technical scheme, the present invention first obtains the target web page and the target platform, obtains the configuration information of the target web page, records the operations in the target web page to obtain the operations and corresponding operation data, converts the operation data into script data matching the target platform according to the action template, synchronizes the script data to the target platform, generates standardized operation records by recording the user's operations on the web page, and converts these records into script templates suitable for different automation platforms, realizes cross-platform automated operation import and execution by processing the network requests of the interface, so that users can efficiently and flexibly record and replay web page operations, is suitable for a variety of automation platforms, improves the efficiency and applicability of web page operation automation, and can effectively solve the problems of poor cross-platform compatibility of the prior art, inability to flexibly respond to complex operation requirements, and insufficient efficiency and security. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in describing the embodiments of the present invention. Obviously, the drawings described below are only some embodiments of the present invention, and those skilled in the art can obtain other drawings based on these drawings without creative work.

[0021] Figure 1 is a flow chart of a web page automation operation method according to an exemplary embodiment;

[0022] Figure 2 is a schematic diagram of a webpage automation operation method according to an exemplary embodiment;

[0023] Figure 3 yes Figure 2 Flow diagram of newly added interfaces in corresponding application scenarios;

[0024] Figure 4 yes Figure 2 Schematic diagram of using action templates in corresponding application scenarios;

[0025] Figure 5 yes Figure 2 Flow chart of using the wake-up button in the corresponding application scenario;

[0026] Figure 6 yes Figure 2 Schematic diagram of the process of configuring background scripts for plugins in corresponding application scenarios;

[0027] Figure 7 yes Figure 2 Schematic diagram of the process of recording the plugin content script in the corresponding application scenario;

[0028] Figure 8 is a block diagram of a web page automation operation device according to an exemplary embodiment;

[0029] Fig. 9 is a hardware structure diagram of an electronic device according to an exemplary embodiment;

[0030] Fig.10 It is a block diagram of an electronic device according to an exemplary embodiment. DETAILED DESCRIPTION

[0031] Embodiments of the present invention are described in detail below, examples of which are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the present invention, and cannot be interpreted as limiting the present invention.

[0032] It will be understood by those skilled in the art that, unless expressly stated, the singular forms "one", "said", and "the" used herein may also include plural forms. It should be further understood that the term "comprising" used in the specification of the present disclosure refers to the presence of the features, integers, steps, operations, elements, and / or components, but does not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and / or groups thereof. It should be understood that when we refer to an element as being "connected" or "coupled" to another element, it may be directly connected or coupled to the other element, or there may be intermediate elements. In addition, the "connection" or "coupling" used herein may include wireless connection or wireless coupling. The term "and / or" used herein includes all or any unit and all combinations of one or more associated listed items.

[0033] The present invention provides a web page automation operation method, which realizes cross-platform automation operation import and execution by processing interface network requests, so that users can efficiently and flexibly record and replay web page operations, solving the problems of poor cross-platform compatibility, inability to flexibly respond to complex operation requirements, and insufficient efficiency and security in the prior art. The web page automation operation method is suitable for a web page automation operation device, which can be an electronic device. The web page automation operation method in the embodiment of the present invention can be applied to a variety of scenarios, such as web page automation testing, etc.

[0034] See also Figure 1 An embodiment of the present invention provides a method for automatic operation of a web page, which is applicable to an electronic device.

[0035] In the following method embodiments, for ease of description, the execution subject of each step of the method is taken as an electronic device as an example for illustration, but this does not constitute a specific limitation.

[0036] like Figure 1 As shown, the method may include the following steps:

[0037] Step 110, obtaining a target webpage and a target platform.

[0038] Step 130: Obtain configuration information of the target webpage, and record operations in the target webpage to obtain operations and corresponding operation data.

[0039] In one possible implementation, corresponding configuration information is obtained according to the HTTP request in the target web page, the input box and buttons of the target web page are recorded according to the configuration information, and when the input box and buttons of the target web page meet the trigger conditions, the operation data in the input box and the operation corresponding to the button are obtained.

[0040] In one possible implementation, the document object model of the target web page is manipulated through a content script, an input box is added to the target web page, properties are set for the input box, events are bound to the input box through the content script, and input data in the input box is obtained through a callback function. A button element is added to the target web page through the content script and a click response event is set.

[0041] Among them, the input box is used to collect user input data, and the button is used to trigger specific actions or events.

[0042] Step 150: convert the operation data into script data matching the target platform according to the action template.

[0043] In a possible implementation, the operation data is parsed according to the action template and converted into operation data in a structured data format, and the operation data is assembled into script data corresponding to the target platform according to the action template.

[0044] In a possible implementation, an operation in a target webpage is obtained, and operation data corresponding to the operation is obtained according to a parameter placeholder.

[0045] The operations include clicking, opening a web page, and inputting, and the operations carry type identifiers and parameter placeholders.

[0046] Step 170, synchronizing the script data to the target platform.

[0047] In a possible implementation, the script data is transmitted to the target platform through an interface of the target platform according to a POST request.

[0048] In one possible implementation, a content script is set for the target web page, and the DOM elements of the target web page are traversed through the content script to identify whether there are input boxes and buttons; if there are buttons, a click event is added to the button through the content script, so that the callback function in the content script is triggered when the button is clicked.

[0049] Through the above process, the present invention first obtains the target web page and the target platform, obtains the configuration information of the target web page, records the operations in the target web page to obtain the operations and corresponding operation data, converts the operation data into script data matching the target platform according to the action template, synchronizes the script data to the target platform, generates standardized operation records by recording the user's operations on the web page, and converts these records into script templates suitable for different automation platforms, realizes cross-platform automated operation import and execution by processing the network requests of the interface, so that users can efficiently and flexibly record and replay web page operations, is suitable for a variety of automation platforms, improves the efficiency and applicability of web page operation automation, and can effectively solve the problems of poor cross-platform compatibility of the prior art, inability to flexibly respond to complex operation requirements, and insufficient efficiency and security.

[0050] In one application scenario, Figure 2 A flowchart of a web page automation operation method is shown. Figure 3 The flowchart of the newly added interface is shown. Figure 4 Shows a flow chart of using action templates. Figure 5 A flowchart showing the use of the wake-up button. Figure 6 A flowchart showing the background script of the plugin configuration is shown. Figure 7 A flowchart showing how plugin content scripts invoke recording.

[0051] like Figure 2 As shown, the web page automation operation method may include the following steps:

[0052] Step F1: The user inputs the target web page in the browser input box.

[0053] Step F2: The user opens the target web page and starts recording the target web page using the plug-in.

[0054] Step F3: Recognizing that an input operation or the like occurs in the target web page.

[0055] Step F4: Acquire operation data corresponding to the operation.

[0056] Step F5: The plug-in converts the operation data according to the action template corresponding to the operation.

[0057] Step F6: Synchronize the converted operation data to the target platform through the plug-in.

[0058] Specifically, users need to open a browser and enter the target web page, and open a platform website that supports the recording function. The platform allows users to record their operations on other websites through plug-ins. On the platform page, users look for an input box with a specific ID (such as record-openUrl-001) and enter the website URL they want to record operations in it. This URL will serve as the starting point for subsequent visits and recording operations.

[0059] Specifically, after entering the URL, the user clicks a button that triggers the platform's mechanism to load or open the website they want to record, either by opening the URL in a new tab or by presenting the target web page in some way within an area of ​​the platform.

[0060] Specifically, on the target web page, the user starts to perform the actions they want to record, such as entering text, clicking a link or button, etc. These actions will be captured and recorded by the plug-in, and during the recording process, the user continues to perform various actions, including clicking, using the enter key, etc. Each such action will be recorded by the plug-in.

[0061] Specifically, when the user starts the recording function on the platform, the plug-in is automatically invoked and enters the recording mode. At this point, the plug-in begins to capture all operations of the user on the target web page. The plug-in continues to capture all DOM operations and events of the user on the target web page, including but not limited to input, click, scroll, etc. Whenever the plug-in captures the user performing an operation (such as entering text), it will capture the detailed information of this operation, including the type of operation, the time of occurrence, the DOM elements involved, etc. There are one or more model templates inside the plug-in, which are used to define the data structure and processing logic of different types of operations. For each captured operation, the plug-in will find the corresponding template in the template library according to its type. The plug-in will convert and organize the captured operation data in the format required by the platform, including data cleaning, formatting, encoding and other operations to ensure the consistency and accuracy of the data.

[0062] Specifically, the processed data is temporarily stored in the plug-in's internal storage for synchronization or further processing when the recording ends. When the user finishes recording and clicks the stop button, the plug-in stops recording and finally assembles and verifies all recorded data. The plug-in synchronizes this data to the platform through appropriate channels (such as HTTP requests) so that users can view, edit or share their recordings on the platform.

[0063] In the above process, the embodiment of the present invention realizes the recording and synchronization of website operations through plug-ins, which not only improves the user experience and platform functions, but also improves data accuracy and consistency, supports operation records in complex scenarios, promotes community sharing and communication, and facilitates automation and integration, which jointly promotes the development of the platform and the improvement of user satisfaction.

[0064] like Figure 3 As shown, adding a new interface may include the following steps:

[0065] Step A1: Add an import and configuration interface to the target web page.

[0066] Step A2: The target web page initiates a request to itself through the interface.

[0067] Step A3: The interface contains the login credential token, import address URL and action template model.

[0068] Specifically, the Platform Development Interface refers to a set of rules and methods defined during the software or platform development process to achieve data interaction and function calls between different systems, modules or applications. These interfaces allow developers to access services or data provided by the platform through specific request methods (such as HTTP requests) and formats (such as JSON or XML). Interfaces are a very critical part of software architecture, and they promote the decoupling of modules and the scalability of the system.

[0069] Specifically, when a web page is loaded or an event is triggered, a request is initiated to the back-end interface of the same application or service through front-end technologies such as JavaScript. The JavaScript code of the web page requests data or performs operations from the back-end server through technologies such as AJAX (Asynchronous JavaScript and XML) or Fetch API.

[0070] Among them, tokens are usually used for authentication and authorization. When a client (such as a web page) makes a request to a server, a token is included in the request header. The server verifies the validity of the token to determine whether the requester has the right to access specific resources or services.

[0071] url: Uniform Resource Locator, which specifies the specific location of the interface. The client accesses the interface by sending a request to this URL.

[0072] Model action template: A template or instruction carried in an interface request that instructs the backend on how to process the request. For example, it specifies the database operations to be performed (such as adding, deleting, modifying, and querying), the services or functions to be called, and the specific parameters required for these operations.

[0073] In the above process, steps A1 to A3 describe the scenarios of interface usage in platform development, including the definition of the interface, the initiation of the request, and the key elements included in the request.

[0074] like Figure 4 As shown, the use of the action template may include the following steps:

[0075] Step B1: Set the action template. The plug-in needs to assemble the operation data according to the action template and transmit it to the target platform.

[0076] Step B2: The template action contains click.

[0077] Step B3: The template action includes the openwebside action to open a web page.

[0078] Step B4: The template action includes an enter input operation.

[0079] Specifically, the plug-in first identifies a series of action templates defined by the platform, including but not limited to click, open webpage, enter, etc. Each template carries a specific type identifier (such as type: click) and parameter placeholders (such as ${var}), which are used by the plug-in to fill in specific data at runtime.

[0080] For the click action template, the plug-in recognizes that its type is type: click, and understands that the template requires the plug-in to pass the location information of the click element. The plug-in obtains the XPath information of the click element through some means (such as user input, internal logic calculation, or interaction with other services), and fills this information into the ${var} placeholder of the template. After the assembly is completed, the plug-in sends the click action data with complete information to the platform to perform the click operation.

[0081] Similarly, for the open webpage action template, the plug-in identifies its type and understands that the URL of the target webpage needs to be passed. The plug-in obtains this URL through appropriate means and fills it into the corresponding position of the template. After that, the plug-in sends the assembled open webpage action data to the platform so that the platform can open the specified webpage.

[0082] For the enter input operation template, the plug-in recognizes its type and understands that what needs to be passed is the location information of the input target element and the specific text to be entered. The plug-in first obtains the location information of the input element (such as XPath) and the text content to be entered, and then fills this information into the corresponding position of the template. After the assembly is completed, the plug-in sends the input operation data to the platform to enter the text in the specified element.

[0083] As a specific example, the plug-in defines a click template, which carries type: click as the type identifier and reserves ${var} as a placeholder for the XPath information of the click element that the plug-in needs to pass. When the plug-in is running, it obtains the XPath of the target click element through some mechanism (such as user interaction, automated script, etc.) and replaces ${var} in the template with this XPath. Subsequently, the plug-in sends the complete click action data to the platform, and the platform performs the corresponding click operation based on the received data.

[0084] In the above process, the plug-in assembles specific data (such as element positioning information, input text content, etc.) according to the action template provided by the platform, and sends this data to the platform to achieve various complex interactions and operations.

[0085] like Figure 5 As shown, the use of the evoke button may include the following steps:

[0086] Step C1: Add a button to the target web page.

[0087] Step C2: Set the button's id to record-open-001.

[0088] Step C3: Add a new input box to the target web page.

[0089] Step C4: Set the id of the input box to record-openUrl-001.

[0090] Specifically, the plug-in directly manipulates the DOM structure of the web page through its built-in content script, and dynamically adds an input box element at a specified location on the page. This input box is added to collect user input data, such as search keywords, form information, etc. Set a specific ID, class name or other attributes for this input box for subsequent binding and interaction.

[0091] Furthermore, the plugin also uses its content script to add a button element to the page. In order to trigger a specific action or event, such as submitting a form input by the user, calling a function of the plugin, etc. The plugin will ensure the visibility and accessibility of the button so that users can easily interact with it.

[0092] Furthermore, in order to respond to the user's operations in the input box (such as entering text, changing content, etc.), the plug-in adds an event responder to its newly added input box element. The responder can capture various events during user input (such as input, change, etc.) and allow the plug-in to execute the corresponding callback function. Through these callback functions, the plug-in can obtain the user's input data in real time and perform operations such as verification, processing or storage.

[0093] The plug-in will add a click event responder to its newly added button element. When the user clicks this button, the responder will trigger and execute the specific logic defined by the plug-in. This logic may include but is not limited to: calling the plug-in's internal functions, communicating with the plug-in's background scripts, modifying the DOM structure of the web page to display the plug-in's UI interface, etc. In this way, the plug-in can respond to the user's click operations and provide the user with the functions or services they need.

[0094] In the above process, the plug-in directly operates the DOM structure of the web page through its content script, adds new UI elements (such as input boxes and buttons), and binds corresponding event responders to these elements. These operations enable the plug-in to be closely integrated with the web platform, providing users with a richer and more convenient functional experience.

[0095] like Figure 6 As shown, the plugin configuration background script may include the following steps:

[0096] Step D1: Add a background script bg.js to the plugin.

[0097] Step D2: Use chrome.webRequest in the background script to obtain the target web page's actions and action data.

[0098] Step D3: Record the import and configuration requests in the target web page.

[0099] Step D4: Parse the import and configuration request and save it to the plug-in.

[0100] Specifically, a new JavaScript file named bg.js has been added, which will run as the background script of the plugin. The background script continues to run during the life cycle of the plugin and can perform tasks without opening any tabs, such as responding to network requests and managing plugin status.

[0101] Furthermore, in bg.js, the plugin uses the chrome.webRequest API to respond to network requests. This requires the plugin to declare the corresponding permissions in the manifest.json file, and the responder will be able to capture all network requests made by the browser, including those initiated by page scripts, extensions, or other browser components.

[0102] Further, in bg.js, the plugin sets up a specific responder to capture requests with URL paths of import and configuration. The plugin is responding to requests to a specific API endpoint or internal route, which may be used to import settings or configuration information. When such a request is captured, the responder will trigger the corresponding callback function to handle the request.

[0103] In the callback function of the responder, the plug-in will parse the captured import and configuration requests and extract the required data, and save the data to its internal storage, such as chrome.storage.local or chrome.storage.sync.

[0104] like Figure 7 As shown, the plugin content script can invoke recording by the following steps:

[0105] Step E1: Add a content script for the plugin.

[0106] Step E2: Match the content script to the target web page and input the content script to the target web page.

[0107] Step E3: Use the content script to determine whether there is an input box or button in the target web page.

[0108] Step E4: Add response trigger events for buttons and input boxes.

[0109] Step E5: Initiate a web page recording request to the plug-in.

[0110] Step E6: The plug-in starts recording the target web page.

[0111] Specifically, in order to enhance its functions on the target web page or realize specific interactions, the plug-in adds a content script. The plug-in identifies and matches whether the website currently visited by the user is a target web page supported by the plug-in. If the match is confirmed, the plug-in will automatically inject its newly added content script into the page of the website. The plug-in's content script directly operates the DOM elements of the web page and interacts with the web page.

[0112] Furthermore, the content script injected into the target web page will first perform a series of checks and judgment operations, traverse the DOM elements of the page, and identify whether there are input boxes and buttons. For the identified buttons, the content script will add click response operations to them. When the user clicks these buttons on the page, the callback function defined in the content script will be triggered.

[0113] Furthermore, in the button click response callback function, the content script of the plug-in will first execute specific logic, such as obtaining information in the input box, collecting or processing information in the input box, etc., which is not limited here.

[0114] Furthermore, after completing the necessary processing in the click response callback function, the content script of the plug-in uses the chrome.runtime.sendMessage API to send a message to the background script or other components of the plug-in. The message contains the data collected from the input box, the context information of the user operation, or other necessary parameters. In this way, the content script can communicate with other parts of the plug-in to implement more complex functions and logic.

[0115] Among them, after receiving the message from the content script, the background script or other components of the plug-in will perform corresponding operations according to the content of the message. The plug-in will start the corresponding function according to predefined rules and logic, which may be recording the user's browser activity, collecting web page data, or performing other recording-related tasks, etc.

[0116] Through the above process, the embodiment of the present invention first obtains the target web page and the target platform, obtains the configuration information of the target web page, records the operations in the target web page to obtain the operations and corresponding operation data, converts the operation data into script data matching the target platform according to the action template, synchronizes the script data to the target platform, generates standardized operation records by recording the user's operations on the web page, and converts these records into script templates suitable for different automation platforms, realizes cross-platform automated operation import and execution by processing the network requests of the interface, so that users can efficiently and flexibly record and replay web page operations, which is suitable for a variety of automation platforms, improves the efficiency and applicability of web page operation automation, and can effectively solve the problems of poor cross-platform compatibility of the prior art, inability to flexibly respond to complex operation requirements, and insufficient efficiency and security.

[0117] In another application scenario, the embodiment of the present invention includes the following steps:

[0118] The first step is to initialize and configure acquisition.

[0119] Get configuration information: After the plug-in is installed and activated, it first responds to the HTTP request from the Web automation platform. When the platform sends configuration information (including token, URL, model, etc.) through the import and configuration interface, the plug-in captures this request and extracts this information.

[0120] The second step is page element response.

[0121] Respond to page elements: The plugin is injected into the browser page through the content script and responds to input boxes and buttons with a specific ID record-openUrl-001.

[0122] Trigger recording: When the user enters the URL in the input box and clicks the button, the plugin detects this event and prepares to start the recording process.

[0123] The third step is to display the recording interface.

[0124] Pop-up recording interface: The plug-in responds to the trigger event and pops up the recording interface, which allows the user to interact with the web page (such as clicking links, entering text, etc.).

[0125] The fourth step is to record user operations.

[0126] Capture user operations: During the activation of the recording interface, the plug-in captures all user operations, including mouse clicks, keyboard input, etc.

[0127] Parsing operations: Based on the model template obtained from the platform, the plug-in parses user operations and converts them into a structured data format for subsequent processing and synchronization.

[0128] Step 5: Data assembly and synchronization.

[0129] Data assembly: The plug-in assembles test script data that meets platform requirements based on the model template and captured user operation data.

[0130] Synchronize data: Using the token and URL obtained from the import and configuration interface, the plug-in sends the assembled test script data to the interface specified by the platform through a POST request.

[0131] Step 6: End recording.

[0132] Close the recording interface: Once the data is successfully synchronized to the platform, the plug-in closes the recording interface and prepares for the next recording request.

[0133] Through the above process, by acquiring configuration information, responding to page elements, displaying the recording interface, capturing and parsing user operations, assembling and synchronizing test script data, and ending the recording process, the plug-in is used to respond to browser events, parse user operations and interact with the platform, thereby realizing the recording of user operations and the generation of automated test scripts.

[0134] The following is an embodiment of the device of the present invention, which can be used to execute the webpage automation operation method involved in the present invention. For details not disclosed in the embodiment of the device of the present invention, please refer to the method embodiment of the webpage automation operation method involved in the present invention.

[0135] See also Figure 8 , an embodiment of the present invention provides a web page automation operation device 800.

[0136] The web page automation operation device 800 includes but is not limited to: a target acquisition module 810 , a web page recording module 830 , a data conversion module 850 and a data transmission module 870 .

[0137] The target acquisition module 810 is used to acquire the target webpage and the target platform.

[0138] The web page recording module 830 is used to obtain the configuration information of the target web page and record the operations in the target web page to obtain the operations and corresponding operation data.

[0139] The data conversion module 850 is used to convert the operation data into script data matching the target platform according to the action template.

[0140] The data transmission module 870 is used to synchronize the script data to the target platform.

[0141] It should be noted that the web page automation operation provided in the above embodiment is only illustrated by the division of the above functional modules. In actual applications, the above functions can be assigned to different functional modules as needed, that is, the internal structure of the web page automation operation device will be divided into different functional modules to complete all or part of the functions described above.

[0142] In addition, the embodiments of the web page automation operation device and the web page automation operation method provided in the above embodiments belong to the same concept, and the specific manner in which each module performs the operation has been described in detail in the method embodiment and will not be repeated here.

[0143] Fig. 9 The present invention schematically illustrates the structure of an electronic device according to an exemplary embodiment.

[0144] It should be noted that the electronic device is only an example adapted to the present invention and cannot be considered to provide any limitation on the scope of use of the present invention. The electronic device cannot be interpreted as requiring dependence on or having Fig. 9 One or more components of exemplary electronic device 2000 are shown.

[0145] The hardware structure of the electronic device 2000 may vary greatly due to differences in configuration or performance, such as Fig. 9 As shown, the electronic device 2000 includes: a power supply 210 , an interface 230 , at least one memory 250 , and at least one central processing unit (CPU) 270 .

[0146] Specifically, the power supply 210 is used to provide operating voltage for each hardware device on the electronic device 2000 .

[0147] The interface 230 includes at least one wired or wireless network interface 231 for interacting with external devices. Of course, in other examples adapted by the present invention, the interface 230 may further include at least one serial-to-parallel conversion interface 233, at least one input-output interface 235, and at least one USB interface 237, etc. Fig. 9 As shown, this is not intended to be a specific limitation.

[0148] The memory 250 is a carrier for storing resources, which may be a read-only memory, a random access memory, a disk or an optical disk, etc. The resources stored thereon include an operating system 251, an application 253 and data 255, etc. The storage method may be temporary storage or permanent storage.

[0149] Among them, the operating system 251 is used to manage and control various hardware devices and application programs 253 on the electronic device 2000 to enable the central processor 270 to calculate and process the massive data 255 in the memory 250. It can be WindowsServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.

[0150] The application program 253 is a computer-readable instruction that performs at least one specific task based on the operating system 251, and may include at least one module ( Fig. 9 (not shown), each module may respectively contain computer-readable instructions for the electronic device 2000. For example, the web page automation operation device may be regarded as an application 253 deployed on the electronic device 2000.

[0151] The data 255 may be signal information, etc., stored in the memory 250 .

[0152] The central processor 270 may include one or more processors and is configured to communicate with the memory 250 through at least one communication bus to read the computer-readable instructions stored in the memory 250, thereby realizing the operation and processing of the mass data 255 in the memory 250. For example, the webpage automation operation method is completed by the central processor 270 reading a series of computer-readable instructions stored in the memory 250.

[0153] In addition, the present invention can also be implemented by hardware circuits or hardware circuits combined with software. Therefore, the implementation of the present invention is not limited to any specific hardware circuits, software, or a combination of the two.

[0154] See also Fig.10 In an embodiment of the present invention, an electronic device 4000 is provided. The electronic device 4000 may include: a desktop computer, a laptop computer, a server, etc. with sensor recognition capability.

[0155] exist Fig.10 In the embodiment, the electronic device 4000 includes at least one processor 4001 and at least one memory 4003.

[0156] The data interaction between the processor 4001 and the memory 4003 can be realized through at least one communication bus 4002. The communication bus 4002 may include a path for transmitting data between the processor 4001 and the memory 4003. The communication bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus. The communication bus 4002 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Fig.10 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0157] Optionally, the electronic device 4000 may further include a transceiver 4004, which may be used for data interaction between the electronic device and other electronic devices, such as data transmission and / or data reception, etc. It should be noted that in actual applications, the transceiver 4004 is not limited to one, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of the present invention.

[0158] Processor 4001 may be a CPU (Central Processing Unit), a general-purpose processor, a DSP (Digital Signal Processor), an ASIC (Application Specific Integrated Circuit), an FPGA (Field Programmable Gate Array) or other programmable logic devices, transistor logic devices, hardware components or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of the present invention. Processor 4001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0159] The memory 4003 can be a ROM (Read Only Memory) or other types of static storage devices that can store static information and instructions, a RAM (Random Access Memory) or other types of dynamic storage devices that can store information and instructions, or an EEPROM (Electrically Erasable Programmable Read Only Memory), a CD-ROM (Compact Disc Read Only Memory) or other optical disk storage, optical disk storage (including compressed optical disk, laser disk, optical disk, digital versatile disk, Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program instructions or codes in the form of instructions or data structures and can be accessed by the electronic device 4000, but is not limited to this.

[0160] Computer-readable instructions are stored in the memory 4003 , and the processor 4001 can read the computer-readable instructions stored in the memory 4003 through the communication bus 4002 .

[0161] The computer-readable instructions are executed by one or more processors 4001 to implement the web page automation operation method in the above-mentioned embodiments.

[0162] In addition, an embodiment of the present invention provides a storage medium on which computer-readable instructions are stored. The computer-readable instructions are executed by one or more processors to implement the webpage automation operation method as described above.

[0163] A computer program product is provided in an embodiment of the present invention. The computer program product includes computer-readable instructions. The computer-readable instructions are stored in a storage medium. One or more processors of an electronic device read the computer-readable instructions from the storage medium, load and execute the computer-readable instructions, so that the electronic device implements the web page automation operation method as described above.

[0164] Compared with the related art, the present invention has the following beneficial effects:

[0165] 1. The present invention first obtains the target web page and the target platform, obtains the configuration information of the target web page, records the operations in the target web page to obtain the operations and corresponding operation data, converts the operation data into script data matching the target platform according to the action template, synchronizes the script data to the target platform, generates standardized operation records by recording the user's operations on the web page, and converts these records into script templates suitable for different automation platforms, realizes cross-platform automated operation import and execution by processing the network requests of the interface, so that users can efficiently and flexibly record and replay web page operations, is suitable for a variety of automation platforms, improves the efficiency and applicability of web page operation automation, and can effectively solve the problems of poor cross-platform compatibility of the prior art, inability to flexibly respond to complex operation requirements, and insufficient efficiency and security.

[0166] 2. The present invention can achieve cross-platform compatibility: a unified template conversion mechanism is designed to convert the operation actions recorded by ChroPath into script templates suitable for different automation platforms, ensuring cross-platform compatibility and providing a standardized operation record format (such as JSON) to facilitate parsing and execution on different platforms.

[0167] 3. The present invention can enhance the complexity and diversity of operation records: expand the functions of the recording tool, support multiple user operation types (such as clicking, opening a website, inputting, etc.), and flexibly handle complex user interactions.

[0168] Through the variable replacement mechanism (such as ${var}), the recorded operations are more versatile and configurable.

[0169] 4. The present invention has a unified template conversion and data transmission mechanism: a template conversion module is designed to generate compatible script templates based on the syntax and execution logic of the target platform. A secure communication protocol (such as HTTP / HTTPS) is used for data transmission to ensure data security and integrity during the transmission process.

[0170] 5. The present invention has a safe and reliable automatic import action mechanism: the web system of the automatic import action needs to add the function of processing the import and configuration request, including key contents such as permission information, identity authentication and import address. The system strictly verifies the request to ensure the security of permission information and identity information, and correctly parses and stores the imported template steps.

[0171] 6. The present invention can improve the user experience: a new button is added on the web page to call up the recording script, and an event response is added to the button through the plug-in content script to simplify user operations. An intuitive recording and configuration interface is provided to lower the user's usage threshold, improve the convenience of operation and user satisfaction.

[0172] It should be understood that, although the steps in the flowchart of the accompanying drawings are displayed in sequence as indicated by the arrows, these steps are not necessarily executed in sequence in the order indicated by the arrows. Unless otherwise specified herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least a part of the steps in the flowchart of the accompanying drawings may include multiple sub-steps or multiple stages, and these sub-steps or stages are not necessarily executed at the same time, but can be executed at different times, and their execution order is not necessarily sequential, but can be executed in turn or alternately with other steps or at least a part of the sub-steps or stages of other steps.

[0173] The above descriptions are only some embodiments of the present invention. It should be pointed out that, for ordinary technicians in this technical field, several improvements and modifications can be made without departing from the principles of the present invention. These improvements and modifications should also be regarded as the scope of protection of the present invention.

Claims

1. A web page automation operation method, characterized in that: The method comprises: Obtain a target webpage and a target platform, set a content script for the target webpage, traverse the DOM elements of the target webpage through the content script, identify whether there is an input box and a button, and if there is a button, add a click event to the button through the content script, so that when the button is clicked, a callback function in the content script is triggered; Acquire corresponding configuration information according to the HTTP request in the target webpage, operate the document object model of the target webpage through the content script, add an input box to the target webpage, set attributes for the input box and perform event binding on the input box through the content script, and obtain input data in the input box through a callback function; the input box is used to collect input data; Adding a button element to the target webpage through the content script and setting a click response event; the button is used to trigger a specific action or event; When the input box and button of the target webpage meet the trigger condition, the operation data in the input box and the operation corresponding to the button are obtained; the configuration information includes login credentials, interface URL and action template; Obtaining an operation in the target webpage; the operation includes clicking, opening a webpage, and inputting; the operation carries a type identifier and a parameter placeholder; obtaining operation data corresponding to the operation according to the parameter placeholder, parsing the operation data according to the action template and converting the operation data into structured operation data in a data format, and assembling the operation data into script data corresponding to the target platform according to the action template; The script data is transmitted to the target platform through an interface of the target platform according to a POST request.

2. A web page automation operation device, characterized in that: The device is applied to the webpage automation operation method according to claim 1, and the device comprises: A target acquisition module is used to acquire a target web page and a target platform; A web page recording module, used to obtain configuration information of the target web page, and record operations in the target web page to obtain operations and corresponding operation data; A data conversion module, used for converting the operation data into script data matching the target platform according to the action template; A data transmission module is used to synchronize the script data to the target platform.

3. An electronic device, characterized in that: include: at least one processor and at least one memory, wherein: The memory has computer-readable instructions stored thereon; The computer-readable instructions are executed by one or more of the processors, so that the electronic device implements the web page automation operation method as described in claim 1.

4. A storage medium having computer-readable instructions stored thereon, characterized in that: The computer-readable instructions are executed by one or more processors to implement the web page automation operation method as claimed in claim 1.