Methods, apparatus, equipment, storage media, and program products for submitting test reports
Patent Information
- Application Number
- CN202510308258.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-14
- Publication Date
- 2026-09-15
Smart Images

Figure CN122757134A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of computer technology, and more specifically, to a method, apparatus, device, storage medium, and program product for submitting a test report. Background Technology
[0002] In existing technology, users test the active tab in a browser. After testing, users need to submit a test report for the active tab to a faulty system (server). The process of submitting the test report for the active tab to the faulty system includes: users manually collecting test data for the active tab; users manually generating a test report for the active tab based on the test data; and users manually entering the test report for the active tab into the faulty system. The manual operations in the above process consume a lot of users' time, resulting in low efficiency in submitting test reports. Summary of the Invention This disclosure addresses the shortcomings of existing methods by proposing a method, apparatus, device, computer-readable storage medium, and computer program product for submitting test reports, aiming to solve the problem of how to improve the efficiency of test report submission.
[0003] Firstly, this disclosure provides a method for submitting a test report, including: In response to a target action on the activated tab, a preset target menu item is displayed, which is used to trigger the generation of a test report for the activated tab; In response to a triggered action on the target menu item, generate an embedded frame in the browser using the target plugin in the browser; The test-related information of the activated tab is obtained through the target plugin. The test-related information includes multiple test items. Based on the test-related information of the activated tab and the embedded frame, determine the updated embedded frame; Based on the updated embedded framework, a test report page for the test of the active tab is generated and displayed on the active tab. The test report page includes test-related information. Based on the test report page, obtain information content corresponding to at least one of the multiple test items, and submit the test report based on the test report page and the obtained information content corresponding to each test item to the server.
[0004] In one embodiment, in response to a triggered action on a target menu item, generating an embedded frame in the browser via a target plugin in the browser includes: In response to a triggered action on a target menu item, the active tab is determined from all tabs in the browser via a background script in the target plugin; The first message is generated by the background script in the target plugin and provided to the content script in the target plugin. The first message is used to instruct the content script to generate the browser's inline frame on the active tab. When the content script receives the first message provided by the background script, it generates an embedded frame on the active tab. The resource attributes of the embedded frame include the address of the target hypertext markup language file in the content script. The target hypertext markup language file includes multiple test items.
[0005] In one embodiment, multiple test items include the page title of the activated tab, the page address of the activated tab, a screenshot of the activated tab, a problem description of the activated tab, the network request of the activated tab, and the page title of the test report page. Test-related information also includes network request information corresponding to the network request of the activated tab, title information corresponding to the page title of the activated tab, and address information corresponding to the page address of the activated tab. Obtain test-related information about the activated tab through the target plugin, including: Obtain the network request information corresponding to the network request of the active tab through the background script in the target plugin; The content script in the target plugin generates the title information corresponding to the page title of the activated tab and the address information corresponding to the page address of the activated tab. Obtain multiple test items from the target hypertext markup language file in the target plugin.
[0006] In one embodiment, the embedded frame includes target areas corresponding to each test item in multiple test items, as well as target areas corresponding to network request information, header information, and address information, respectively. Based on the test-related information of the activated tab and the embedded frame, the updated embedded frame is determined, including: Each test item is embedded into its corresponding target area, and network request information, header information, and address information are also embedded into their respective target areas to obtain the updated embedded frame.
[0007] In one embodiment, based on the updated embedded frame, a test report page for testing the active tab is generated and displayed on the active tab, including: The updated embedded frame is rendered using the front-end framework, and a test report page for testing the activated tab is generated and displayed on the activated tab.
[0008] In one embodiment, at least one test item includes a screenshot of the activated tab, a description of the problem with the activated tab, and a page title of the test report page; Based on the test report page, obtain information content corresponding to at least one of the multiple test items, and submit a test report based on the test report page and the obtained information content corresponding to each test item to the server, including: Obtain information content corresponding to at least one test item from the test report page; In response to a save operation on the test report page, the test report page is converted into a parameter array, which is used to represent the information content corresponding to multiple test items; Send the parameter array to the server so that the server can parse the parameter array to obtain a test report for the activated tab.
[0009] In one embodiment, before generating the browser's inline frame via the target plugin in the browser in response to a triggered action on the target menu item, the method further includes: Create the target menu item using the background script in the target plugin.
[0010] Secondly, this disclosure provides an apparatus for submitting a test report, comprising: The first processing module is used to respond to the target operation on the activated tab and display the preset target menu item, which is used to trigger the generation of a test report for the activated tab. The second processing module is used to generate the browser's embedded frame in response to the triggered operation for the target menu item by using the target plugin in the browser. The third processing module is used to obtain test-related information of the activated tab through the target plugin. The test-related information includes multiple test items. The fourth processing module is used to determine the updated embedded frame based on the test-related information of the activated tab and the embedded frame; The fifth processing module is used to generate and display a test report page for the test of the activated tab based on the updated embedded frame. The test report page includes test-related information. The sixth processing module is used to obtain information content corresponding to at least one of the multiple test items based on the test report page, and submit the test report based on the test report page and the obtained information content corresponding to each test item to the server.
[0011] Thirdly, this disclosure provides an electronic device, including: a processor, a memory, and a bus; A bus is used to connect the processor and memory; Memory, used to store operation instructions; A processor for executing the method of submitting a test report according to the first aspect of this disclosure by invoking operation instructions.
[0012] Fourthly, this disclosure provides a computer-readable storage medium storing a computer program that is used to execute the method for submitting a test report according to the first aspect of this disclosure.
[0013] Fifthly, this disclosure provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the method for submitting a test report as described in the first aspect of this disclosure.
[0014] The technical solutions provided in this disclosure have at least the following beneficial effects: In response to a target action on the activated tab, a preset target menu item is displayed. This target menu item triggers the generation of a test report for the activated tab. In response to the triggered action on the target menu item, an embedded frame is generated in the browser via a target plugin. Test-related information for the activated tab is obtained through the target plugin, including multiple test items. Based on the test-related information and the embedded frame, an updated embedded frame is determined. Based on the updated embedded frame, a test report page for the activated tab is generated and displayed on the activated tab, including test-related information. Based on the test report... The system retrieves information from at least one of multiple test items on the test report page and submits a test report based on the retrieved information for each test item to the server. This eliminates the need for frequent page switching. Instead, it automatically retrieves relevant test information (such as page title, page address, network requests, etc.) from the active tab (current page) of the browser based on the user's click on a target menu item (e.g., "Submit a Bug Report"), and provides a test report page (bug report) for user interaction. This enables real-time data collection and test report submission, thus improving the efficiency of test report submission. Attached Figure Description
[0015] To more clearly illustrate the technical solutions in the embodiments of this disclosure, the accompanying drawings used in the description of the embodiments of this disclosure will be briefly introduced below.
[0016] Figure 1 A schematic diagram of the system architecture for submitting test reports provided in this embodiment of the disclosure; Figure 2 A flowchart illustrating a method for submitting a test report provided in an embodiment of this disclosure; Figure 3 A schematic diagram illustrating the submission of a test report as provided in an embodiment of this disclosure; Figure 4 A schematic diagram illustrating the submission of a test report as provided in an embodiment of this disclosure; Figure 5 A schematic diagram illustrating the submission of a test report as provided in an embodiment of this disclosure; Figure 6 A flowchart illustrating a method for submitting a test report provided in an embodiment of this disclosure; Figure 7 A schematic diagram of a device for submitting a test report provided in an embodiment of this disclosure; Figure 8 This is a schematic diagram of the structure of an electronic device provided in an embodiment of this disclosure. Detailed Implementation
[0017] The embodiments of this disclosure are described below with reference to the accompanying drawings. It should be understood that the embodiments described below with reference to the accompanying drawings are exemplary descriptions for explaining the technical solutions of the embodiments of this disclosure, and do not constitute a limitation on the technical solutions of the embodiments of this disclosure.
[0018] Those skilled in the art will understand that, unless specifically stated otherwise, the singular forms “a,” “an,” “the,” and “the” used herein may also include the plural forms. It should be further understood that the terms “comprising” and “including” as used in embodiments of this disclosure mean that the corresponding feature can be implemented as the presented feature, information, data, step, operation, element, and / or component, but do not exclude implementation as other features, information, data, step, operation, element, component, and / or combinations thereof supported by the art. It should be understood that when we say that an element is “connected” or “coupled” to another element, the one element can be directly connected or coupled to the other element, or it can mean that the one element and the other element are connected through an intermediate element. Furthermore, “connected” or “coupled” as used herein can include wireless connection or wireless coupling. The term “and / or” as used herein indicates at least one of the items defined by the term; for example, “A and / or B” indicates implementation as “A,” or implementation as “B,” or implementation as “A and B.”
[0019] It is understood that in the specific embodiments of this disclosure, data related to the submission of test reports is required. When the above embodiments of this disclosure are applied to specific products or technologies, user permission or consent is required, and the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions.
[0020] To make the objectives, technical solutions, and advantages of this disclosure clearer, the embodiments of this disclosure will be described in further detail below with reference to the accompanying drawings.
[0021] This disclosure provides a method for submitting test reports, which relates to fields such as page testing.
[0022] To better understand and explain the solutions of the embodiments of this disclosure, some technical terms involved in the embodiments of this disclosure will be briefly explained below.
[0023] Tab pages: Tab pages typically refer to HTML (HyperText Markup Language) pages displayed in a browser in the form of tabs; this design allows users to open multiple tab pages simultaneously within a single browser window.
[0024] iframe: iframe is a tag in HTML. iframe is used to nest another page within another page, thereby achieving hierarchical display of pages or integration of content.
[0025] Browser plugins: Browser plugins are small software programs that can extend and enhance the functionality of a browser, thereby helping users to perform more personalized operations, improve work efficiency, or enhance the browsing experience.
[0026] manifest.json file: The manifest.json file is the core configuration file of the plugin. The manifest.json file is used to configure the plugin's basic information, permissions, scripts, icons, browser behavior and many other aspects.
[0027] background.js file: The background.js file is the plugin's background service. Through functions such as interaction with the browser, event monitoring, and message passing, the background.js file provides powerful backend support for the plugin.
[0028] The content.js file is the plugin's front-end service. It implements various front-end functions through direct interaction with the webpage and communicates with the background.js file to work together.
[0029] body: The body of a page is a core element in an HTML document. It defines the main body of the HTML document and includes all the content that the user can see. In an HTML document, the body element is located inside the `<body>` element and immediately follows the `<body>` element. The body is the container for page content and can include various content such as text, images, audio, and video.
[0030] React: React is a JavaScript library for building user interfaces. React is primarily used for building single-page applications and provides an efficient, declarative view layer solution.
[0031] Vue: Vue is a progressive framework for building user interfaces using JavaScript. Vue is primarily used for developing single-page applications and features core characteristics such as reactive data binding, component-based development, and a virtual DOM mechanism.
[0032] In the existing technology, software bug detection mainly relies on manual operation. The steps that testers need to follow when discovering a bug include: (1) Recording bug characteristics: Testers need to manually record the problem characteristics and possible erroneous behaviors that affect the normal operation of the software; (2) Reproducing the process: Testers try to reproduce the bug problem under different conditions and record the operation steps in detail; (3) Preserving evidence: This may include manually taking screenshots, copying error messages, saving logs, etc.; (4) Filling out a bug report: Using a bug detection system or email, fill in the detailed information of the bug. The detailed information of the bug includes description, reproduction steps, expected results and actual results, etc.; (5) Submitting a bug report: Submit the bug report (test report) to the relevant development team and wait for a response. The disadvantages of the existing technology include: 1. Inefficiency: Manual operation consumes a lot of testers' time, especially in the process of capturing, recording and reporting bugs; 2. Prone to errors: Manual operation may result in the omission or error of key information; 3. Incomplete information: Manual operation records may sometimes not provide all the necessary information required to reproduce the bug; 4. Inability to respond quickly: Bug reports may not be submitted in a timely manner, hindering the process of fixing bugs promptly; 5. Repetitive work: For the same type of bug, testers may need to repeatedly fill out reports.
[0033] Based on this, the present disclosure provides a method, apparatus, device, computer-readable storage medium, and program product for submitting test reports, and the specific technical solutions will be described in detail below.
[0034] The solutions provided in this disclosure relate to sample detection technology. The technical solutions of this disclosure are described in detail below with specific embodiments. These specific embodiments can be combined with each other, and the same or similar concepts or processes may not be repeated in some embodiments. The embodiments of this disclosure will now be described with reference to the accompanying drawings.
[0035] To better understand the solution provided in this disclosure, the solution will be described below in conjunction with a specific application scenario.
[0036] In one embodiment, Figure 1The diagram illustrates the architecture of a system for submitting test reports, applicable to embodiments of this disclosure. It is understood that the method for submitting test reports provided in this disclosure can be applied to, but is not limited to, applications such as... Figure 1 In the application scenarios shown.
[0037] In this example, as Figure 1 As shown, the architecture of the system for submitting test reports in this example may include, but is not limited to, server 10, terminal 20, and database 30. Server 10, terminal 20, and database 30 can interact via network 40.
[0038] In response to a target operation on the activated tab, the browser on terminal 20 displays a preset target menu item, which triggers the generation of a test report for the activated tab. In response to the triggered operation on the target menu item, the browser on terminal 20 generates an embedded frame using a target plugin. The browser on terminal 20 obtains test-related information for the activated tab through the target plugin, including multiple test items. Based on the test-related information and the embedded frame, the browser on terminal 20 determines an updated embedded frame. Based on the updated embedded frame, the browser on terminal 20 generates and displays a test report page for the activated tab, which includes test-related information. Based on the test report page, the browser on terminal 20 obtains information corresponding to at least one of the multiple test items and submits the test report, based on the test report page and the obtained information corresponding to each test item, to server 10. Server 10 stores the test report in database 30.
[0039] It is understood that the above is only one example, and this embodiment is not limited here.
[0040] Terminals include, but are not limited to, smartphones (such as Android phones, iOS phones, etc.), mobile phone emulators, tablets, laptops, digital broadcast receivers, MIDs (Mobile Internet Devices), PDAs (Personal Digital Assistants), smart voice interaction devices, smart home appliances, and in-vehicle terminals.
[0041] A server can be a standalone physical server, a server cluster or distributed system consisting of multiple physical servers, or a cloud server or server cluster that provides basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, CDN (Content Delivery Network), and big data and artificial intelligence platforms.
[0042] The aforementioned networks may include, but are not limited to, wired networks and wireless networks. Wired networks include local area networks (LANs), metropolitan area networks (MANs), and wide area networks (WANs). Wireless networks include Bluetooth, Wi-Fi, and other networks that enable wireless communication. Specific details can be determined based on actual application scenario requirements and are not limited here.
[0043] See Figure 2 , Figure 2 This illustration shows a flowchart of a method for submitting a test report according to an embodiment of this disclosure. This method can be executed by any electronic device, such as a terminal. As an optional implementation, the method can be executed by a terminal. For ease of description, in the following description of some optional embodiments, execution by a browser on the terminal will be used as an example of the method's execution subject. Figure 2 As shown in the embodiments of this disclosure, the method for submitting a test report includes the following steps: S201, in response to a target operation on the activated tab, a preset target menu item is displayed, which is used to trigger the generation of a test report for the activated tab.
[0044] Specifically, for example, a browser can open multiple tabs simultaneously, with one tab being the active tab. The target action for the active tab is, for example, a user right-clicking on the active tab.
[0045] For example, such as Figure 3 As shown, when a user right-clicks on the activated tab, a context menu pops up, displaying a target menu item: "Submit a Bug Report." This item triggers the generation of a test report for the activated tab. Clicking this item generates and displays a test report page (Quick Bug Report) for the activated tab. Figure 4 and Figure 5 As shown; Figure 4 As shown, the test report page (Quick Submission) is displayed on the activation tab. If the user clicks "Save" on the test report page, the browser will submit the test report to the server.
[0046] S202, in response to a triggered action on a target menu item, generates an embedded frame in the browser via the target plugin in the browser.
[0047] Specifically, the triggering action for the target menu item is, for example, a user clicking on the target menu item. The target plugin is a browser plugin, such as a Chrome extension. For example, when a user clicks the target menu item, the target plugin in the browser generates an embedded iframe.
[0048] For example, the target plugin includes configuration files (manifest.json file), background scripts (background.js file), content scripts (content.js file), target hypertext markup language files (HTML files), etc.
[0049] S203 obtains test-related information about the activated tab through the target plugin. The test-related information includes multiple test items.
[0050] Specifically, for example, test-related information for activating a tab includes multiple test items.
[0051] For example, the test-related information for activating a tab includes multiple test items and information content corresponding to certain test items among them.
[0052] For example, multiple test items include the page title of the activated tab, the page address of the activated tab, a screenshot of the activated tab, a description of the problem with the activated tab, the network request for the activated tab, the page title of the test report page, and the person who handled the activated tab test.
[0053] The information content corresponding to the test items includes, for example, the network request information corresponding to the network request for activating the tab, the title information corresponding to the page title of the activating tab, the address information corresponding to the page address of the activating tab, the screenshot information corresponding to the screenshot of the activating tab, the problem description information corresponding to the problem description of the activating tab, the title information corresponding to the page title of the test report page, and the information of the person who handled the activating tab test.
[0054] S204, Based on the test-related information of the activated tab and the embedded frame, determine the updated embedded frame.
[0055] Specifically, for example, the test-related information for activating a tab includes multiple test items, and the embedded frame includes the target area corresponding to each test item among the multiple test items; by embedding each test item among the multiple test items into its corresponding target area, the updated embedded frame is obtained.
[0056] For example, the test-related information for activating a tab includes multiple test items and information content corresponding to some of the test items. The embedded frame includes the target area corresponding to each test item and the target area corresponding to the information content of some test items. Each test item is embedded into its corresponding target area, and the information content of some test items is embedded into its corresponding target area to obtain the updated embedded frame.
[0057] S205, based on the updated embedded frame, generates and displays a test report page for the active tab test on the active tab, which includes test-related information.
[0058] Specifically, for example, such as Figure 5 As shown, the test report page (quick submission) includes test-related information, which includes multiple test items and information corresponding to certain test items. The multiple test items include: page title (the title of the activated tab's page), page address (the address of the activated tab's page), handler: please select a handler (the handler for the activated tab's test), title: please enter the title (the title of the test report page), screenshot: whether a screenshot is needed (a screenshot of the activated tab), problem description: please enter a problem description (a problem description for the activated tab), network request (network requests for the activated tab), etc. The information content corresponding to the page title is "Overview - Console - M11", and the information content corresponding to the page address is http: / / cmgt.tce31011test.fsphere.cn / . The information content corresponding to the handler is displayed to the user in the form of a handler list, including Zhang San, Li Si, Wang Wu, etc. The user (the submitter, i.e., the user who submits the test report) can select a handler from the handler list. The information content corresponding to the network request includes URL (Uniform Resource Locator). The Uniform Resource Locator (URL of the network request), the return code (the return code of the network request, i.e., the response returned by the server to the browser), the input parameters (the input parameters of the network request, i.e., the data sent by the browser to the server), and the output parameters (the output parameters of the network request, i.e., the data sent by the server to the browser) are all part of the network request. Users can select at least one network request from multiple network requests. For example, if a network request fails, and the user clicks "Save" on the test report page, the browser will submit the test report to the server. The test report includes information about at least one network request.
[0059] S206, Based on the test report page, obtain information content corresponding to at least one of the multiple test items, and submit the test report based on the test report page and the obtained information content corresponding to each test item to the server.
[0060] Specifically, for example, such as Figure 5 As shown, users fill in the information corresponding to the problem description in the input box corresponding to the problem description, fill in the information corresponding to the title in the input box corresponding to the title, and check the "Screenshot required?" checkbox. That is, the information content corresponding to at least one test item includes the information content corresponding to the problem description (the problem description information corresponding to the problem description of the activated tab), the information content corresponding to the title (the title information corresponding to the page title of the test report page), and the screenshot (the screenshot information corresponding to the screenshot of the activated tab).
[0061] In this embodiment of the disclosure, in response to a target operation on the activated tab, a preset target menu item is displayed, which is used to trigger the generation of a test report for the activated tab; in response to the trigger operation on the target menu item, an embedded frame of the browser is generated through a target plugin in the browser; test-related information of the activated tab is obtained through the target plugin, which includes multiple test items; based on the test-related information of the activated tab and the embedded frame, an updated embedded frame is determined; based on the updated embedded frame, a test report page for testing the activated tab is generated and displayed on the activated tab, and the test report page includes test-related information; On the test report page, information content corresponding to at least one of multiple test items is obtained, and the test report based on the test report page and the obtained information content corresponding to each test item is submitted to the server. In this way, without frequently switching pages, the test-related information (such as page title, page address, network requests, etc.) of the active tab (current page) of the browser is automatically obtained based on the user clicking the target menu item (such as the menu item "Submit a bug report"), and a test report page (bug report) is provided for user interaction, realizing real-time data collection and submission of test reports, thereby improving the efficiency of test report submission.
[0062] In one embodiment, in response to a triggered action on a target menu item, generating an embedded frame in the browser via a target plugin in the browser includes: In response to a triggered action on a target menu item, the active tab is determined from all tabs in the browser via a background script in the target plugin; The first message is generated by the background script in the target plugin and provided to the content script in the target plugin. The first message is used to instruct the content script to generate the browser's inline frame on the active tab. When the content script receives the first message provided by the background script, it generates an embedded frame on the active tab. The resource attributes of the embedded frame include the address of the target hypertext markup language file in the content script. The target hypertext markup language file includes multiple test items.
[0063] Specifically, for example, creating a target plugin and installing it into the browser. The target plugin includes a configuration file (manifest.json file), a background script (background.js file), a content script (content.js file), a target hypertext markup language file (HTML file), etc.
[0064] For example, a user creates a manifest.json file in the target plugin to configure the plugin's basic information, permissions, scripts, etc. The permissions must declare activeTab (used to retrieve the currently active tab in the browser), tabs (used to retrieve all tabs open simultaneously in the browser), contextMenus (used to create a right-click menu), and webRequest (used to retrieve network requests, such as network requests sent by the browser to a server).<all_urls> (For screenshots) etc.
[0065] For example, a user creates a `background.js` file within the target plugin. In `background.js`, the file monitors the `onInstalled` event, which is the plugin installation event—the event when the target plugin is installed into the browser. When the target plugin is installed in the browser, i.e., when the `onInstalled` event is detected, the first callback function in `background.js` is executed. Within this first callback function, the `chrome.contextMenus.create` method is used to create a right-click menu item (the target menu item), and the title of the right-click menu item is set to something like... Figure 3 The "Bug Report" shown sets the context of the right-click menu item to "all," meaning the right-click menu item is displayed in all situations. It should be noted that during the installation of the target plugin into the browser, the browser creates... Figure 3 Other menu items in the right-click menu shown; after the target plugin is installed in the browser, the target plugin creates items such as... Figure 3 The "Submit a Bug Report" option in the right-click menu is shown; the background.js file monitors the chrome.contextMenus.onClicked event, which is an event listener used to monitor the context menu (such as...). Figure 3The right-click menu item (as shown) triggers a click event. When the user clicks the right-click menu item, i.e., when the `chrome.contextMenus.onClicked` event is detected, the second callback function in the `background.js` file is executed. In the second callback function of `background.js`, the `chrome.tabs.query` method is used to query all tabs in the browser. If the query condition is empty, it means querying all tabs, and the query result returns an array containing all tabs. From the query result (the array containing all tabs), the tab marked as `activeTab` is selected, i.e., the currently active tab is determined. The target plugin sends a first message from `background.js` to `content.js`, with the message content `{action: 'createIframe'}`. This triggers the target plugin's `content.js` file to perform related operations on the active tab. For example, the `content.js` file creates an iframe to achieve... Figure 3 The "Submit a Bug Report" function is shown; the background.js file monitors the chrome.webRequest.onBeforeRequest event to obtain all network requests and sends the network requests to the content.js file via a fourth message (which includes the network requests). For example, a user creates a `content.js` file (a front-end script) within the plugin to handle scripts executed by the plugin on the page (a tab page, i.e., the currently active tab page). Within `content.js`, the file monitors the first message sent by `background.js`. When `content.js` receives the first message, it executes a third callback function. This third callback function determines whether the message content of the first message is `{ action: 'createIframe'}`. If the message content is `{ action: 'createIframe'}`, the `createIframe` function is called. Within the `createIframe` function: the URL of the specified page (HTML file) in the target plugin is obtained using the `chrome.runtime.getURL` method. The URL is the path of the HTML file within the target plugin; for example, `src / pages / tapd / index.html`, where `index.html` is an HTML file. An iframe is then created, and its styles and attributes are set. The iframe's position is fixed; its width and height are set; its position on the page (active tab) is set; its z-index is set to ensure it sits above other elements on the page (active tab), preventing it from being covered by other elements; its border and background colors are set; and its src attribute is set to the URL of the HTML file (setting the iframe's resource attribute to the address of the target HTML file), so that the iframe loads the specified page (HTML file) based on the URL. It's important to note that the content.js file obtains the HTML file's URL, creates an iframe, and sets a src attribute (the HTML file's URL) for it. The iframe can then load the HTML file's URL through this src attribute; that is, the iframe retrieves the HTML file from the target plugin based on the HTML file's URL. When the content.js file creates the iframe, the browser triggers the iframe to load the HTML file. Within the current page (active tab), the content.js file monitors for a second message from the iframe; when content...When the JavaScript file receives the second message, it executes the fourth callback function. In this function, it checks if the message content of the second message is "requestParentInfo". `requestParentInfo` indicates the need to retrieve the title (the title information corresponding to the active tab's page title) and address (the address information corresponding to the active tab's page address). If the message content is "requestParentInfo", the `content.js` file creates an object containing the title and address, and sends this object to the iframe. The `content.js` file then monitors the fourth message (which includes a network request) sent from the `background.js` file. After receiving the network request from the fourth message, the `content.js` file monitors the third message from the iframe. When it receives the third message, it executes the fifth callback function. In this function, it checks if the message content of the third message is "requestNetworkinfo". `requestNetworkinfo` indicates the need to retrieve a network request. If the message content of the third message is "requestNetworkinfo", it executes the fifth callback function. The content.js file will then send a network request to the iframe, embedding the iframe into the body of the current page (the active tab).
[0066] It should be noted that on the active tab of the browser, based on the user clicking the target menu item (such as the right-click menu item "Submit a bug report"), an embedded iframe is generated in the browser through the target plugin. Based on the embedded iframe, the test-related information of the active tab (such as page title, page address, network requests, etc.) is automatically obtained, and a test report page (bug report) is provided for user interaction, real-time data collection, and submission of test reports, thereby improving the efficiency of test report submission.
[0067] In one embodiment, multiple test items include the page title of the activated tab, the page address of the activated tab, a screenshot of the activated tab, a problem description of the activated tab, the network request of the activated tab, and the page title of the test report page. Test-related information also includes network request information corresponding to the network request of the activated tab, title information corresponding to the page title of the activated tab, and address information corresponding to the page address of the activated tab. Obtain test-related information about the activated tab through the target plugin, including: Obtain the network request information corresponding to the network request of the active tab through the background script in the target plugin; The content script in the target plugin generates the title information corresponding to the page title of the activated tab and the address information corresponding to the page address of the activated tab. Obtain multiple test items from the target hypertext markup language file in the target plugin.
[0068] Specifically, for example, such as Figure 5 As shown, the test report page includes test-related information, which includes multiple test items and information corresponding to certain test items. The multiple test items include: Page Title (the title of the active tab's page), Page Address (the address of the active tab's page), Processor: Please select a processor (the processor for the active tab test), Title: Please enter the title (the page title of the test report page), Screenshot: Do you need a screenshot (a screenshot of the active tab), Problem Description: Please enter a problem description (a problem description for the active tab), Network Request (network requests for the active tab), etc. The information corresponding to the page title (the title information corresponding to the active tab's page title) is "Overview - Console - M11", and the information corresponding to the page address (the address information corresponding to the active tab's page address) is http: / / cmgt.tce31011test.fspher e.cn / ; The information corresponding to the processor is displayed to the user in the form of a processor list, which includes Zhang San, Li Si, Wang Wu, etc. The user (the person submitting the test report) can select a processor from the processor list; The information corresponding to the network request (the network request information corresponding to the network request that activates the tab) includes the URL (the URL of the network request), the return code (the return code of the network request, that is, the response returned by the server to the browser), the input parameters (the input parameters of the network request, that is, the data sent by the browser to the server), and the output parameters (the output parameters of the network request, that is, the data sent by the server to the browser). The user can select at least one network request from multiple network requests. If at least one network request is an error, and the user clicks "Save" on the test report page, the browser will submit the test report to the server. The test report includes the information corresponding to at least one network request.
[0069] For example, in the current page (active tab), the content.js file monitors the second message from the iframe. When the content.js file receives the second message, it executes the fourth callback function. In the fourth callback function, it checks whether the message content of the second message is "requestParentInfo". requestParentInfo is used to indicate the title (the title information corresponding to the title of the active tab's page) and the address (the address information corresponding to the address of the active tab's page). If the message content of the second message is "requestParentInfo", the content.js file creates an object that includes the title (the title information corresponding to the title of the active tab's page) and the address (the address information corresponding to the address of the active tab's page), and sends this object to the iframe through the content.js file.
[0070] For example, the content.js file monitors the fourth message sent by the background.js file (which includes a network request). After receiving the network request in the fourth message, the content.js file monitors the third message from the iframe. When the content.js file receives the third message, it executes the fifth callback function. In the fifth callback function, the content.js file checks whether the message content of the third message is "requestNetworkinfo". requestNetworkinfo is used to indicate obtaining a network request. If the message content of the third message is "requestNetworkinfo", then the content.js file sends the network request to the iframe.
[0071] For example, the content.js file obtains the URL of the HTML file, creates an iframe, and sets a src attribute (the URL of the HTML file) for the iframe. The iframe can then load the HTML file's URL through this src attribute. In other words, the iframe obtains the HTML file from the target plugin based on the HTML file's URL. When the content.js file creates the iframe, the browser will trigger the iframe to load the HTML file.
[0072] It should be noted that on the active tab of the browser, based on the user clicking the target menu item, an embedded iframe is generated in the browser through the target plugin. The target plugin obtains the test-related information of the active tab. In other words, the target plugin provides the iframe with the test-related information of the active tab. Based on the test-related information of the active tab and the iframe, the test-related information of the active tab is automatically obtained, and a test report page is provided for user interaction, real-time data collection, and test report submission, thereby improving the efficiency of test report submission.
[0073] In one embodiment, the embedded frame includes target areas corresponding to each test item in multiple test items, as well as target areas corresponding to network request information, header information, and address information, respectively. Based on the test-related information of the activated tab and the embedded frame, the updated embedded frame is determined, including: Each test item is embedded into its corresponding target area, and network request information, header information, and address information are also embedded into their respective target areas to obtain the updated embedded frame.
[0074] Specifically, for example, multiple test items include the page title of the activated tab, the page address of the activated tab, a screenshot of the activated tab, a problem description of the activated tab, network requests of the activated tab, and the page title of the test report page. Test-related information also includes network request information corresponding to the network requests of the activated tab, title information corresponding to the page title of the activated tab, and address information corresponding to the page address of the activated tab. The page title of the activated tab, the page address of the activated tab, the screenshot of the activated tab, the problem description of the activated tab, network requests of the activated tab, and the page title of the test report page are embedded into their respective target areas, and the network request information corresponding to the network requests of the activated tab, the title information corresponding to the page title of the activated tab, and the address information corresponding to the page address of the activated tab are embedded into their respective target areas, resulting in the updated embedded frame.
[0075] It should be noted that on the active tab of the browser, based on the user clicking the target menu item, an embedded iframe is generated in the browser through the target plugin. The target plugin obtains the test-related information of the active tab. In other words, the target plugin provides the iframe with the test-related information of the active tab. Based on the test-related information of the active tab and the iframe, the test-related information of the active tab is automatically obtained, and a test report page is provided for user interaction, real-time data collection, and test report submission, thereby improving the efficiency of test report submission.
[0076] In one embodiment, based on the updated embedded frame, a test report page for testing the active tab is generated and displayed on the active tab, including: The updated embedded frame is rendered using the front-end framework, and a test report page for testing the activated tab is generated and displayed on the activated tab.
[0077] Specifically, front-end frameworks such as React and Vue. For example, the updated embedded framework is rendered by the front-end framework in the browser to obtain bug reports (such as...). Figure 5 The test report page shown in the image displays a bug report in the browser.
[0078] For example, within a browser's iframe, during iframe initialization, the iframe sends a second message to the content.js file. The iframe retrieves the title (the title information corresponding to the active tab's page title) and address (the address information corresponding to the active tab's page address) of the current page (the active tab). Simultaneously, the front-end framework renders the page (iframe), displaying the title and address within the page (iframe). The front-end framework also handles the dropdown selection; when the user clicks the dropdown, it calls the API (Application Programming Interface). The application programming interface (API) obtains all handlers for the user to select; it draws an input box for the title (page title of the test report page) for the user to enter the title; it draws an input box for the problem description for the user to describe the problem; it draws a checkbox for whether a screenshot is required, and if the user selects this box, a screenshot of the current page will be attached to the bug report when submitting the bug report; it draws a network request table, which contains all network requests for the current page. The information for each network request includes the URL (the URL of the network request), the return code (the return code of the network request, i.e., the response returned by the server to the browser), the input parameters (the input parameters of the network request, i.e., the data sent by the browser to the server), and the output parameters (the output parameters of the network request, i.e., the data sent by the server to the browser). The bug report submitter can select network requests with errors based on the error code (error in the return code) or whether there is an error in the output parameter (error in the data sent by the server to the browser).
[0079] It should be noted that the updated embedded framework is rendered by the front-end framework, and a test report page for testing the activated tab is generated and displayed on the activated tab. The test report page is provided for user interaction, real-time data collection and test report submission, thereby improving the efficiency of test report submission.
[0080] In one embodiment, at least one test item includes a screenshot of the activated tab, a description of the problem with the activated tab, and a page title of the test report page; Based on the test report page, obtain information content corresponding to at least one of the multiple test items, and submit a test report based on the test report page and the obtained information content corresponding to each test item to the server, including: Obtain information content corresponding to at least one test item from the test report page; In response to a save operation on the test report page, the test report page is converted into a parameter array, which is used to represent the information content corresponding to multiple test items; Send the parameter array to the server so that the server can parse the parameter array to obtain a test report for the activated tab.
[0081] Specifically, the information content corresponding to at least one test item includes, for example, the problem description entered by the user in the problem description input box, or the title entered by the user in the title (page title of the test report page) input box.
[0082] For example, when a user clicks "Save" on the test report page, the browser converts the test report page into summary information (parameter array). The summary information is like this: {url:””, urltitle:””, networkinfo:[], img:””, description:””, bugtitle:””, handler:””}. Here, url represents the page address of the active tab, urltitle represents the page title of the active tab, networkinfo represents the network request for the active tab, img represents the screenshot of the active tab, description represents the problem description of the active tab, bugtitle represents the title of the test report page (bug request), and handler represents the name of the handler. The browser uses the parameters in the summary information to call the "submit a bug request" API through a network request, sending the network request including the summary information to the bug system (server). The bug system parses the summary information in the network request to obtain the bug report, which is the test report for the active tab. It should be noted that generating and displaying a test report page for testing the activated tab on the activated tab page provides a test report page for user interaction, real-time data collection, and test report submission, thereby improving the efficiency of test report submission.
[0083] In one embodiment, before generating the browser's inline frame via the target plugin in the browser in response to a triggered action on the target menu item, the method further includes: Create the target menu item using the background script in the target plugin.
[0084] Specifically, for example, the user creates a `background.js` file in the target plugin. Within `background.js`, the file monitors the `onInstalled` event, which is the plugin installation event—the event when the target plugin is installed into the browser. When the target plugin is installed in the browser, i.e., when the `onInstalled` event is detected, the first callback function in `background.js` is executed. In the first callback function of `background.js`, a right-click menu item (the target menu item) is created using the `chrome.contextMenus.create` method, and its title is set to something like... Figure 3 The "Bug Report" option shown has its right-click menu item context set to "all". "All" means that the right-click menu item will be displayed in all situations.
[0085] It should be noted that during the process of installing the target plugin into the browser, the browser creates a process such as... Figure 3 Other menu items in the right-click menu shown; after the target plugin is installed in the browser, the target plugin creates items such as... Figure 3 The "Submit a bug report" option is shown in the right-click menu.
[0086] Applying the embodiments of this disclosure has at least the following beneficial effects: On the active tab of the browser, based on the user clicking the target menu item (such as the right-click menu item "Submit a bug report"), an embedded iframe is generated in the browser through the target plugin. The target plugin obtains the test-related information of the active tab and provides it to the iframe, thereby automatically obtaining the test-related information of the active tab (such as page title, page address, network requests, etc.), providing a test report page (bug report) for user interaction, real-time data collection, and submission of test reports, thus improving the efficiency of test report submission.
[0087] To better understand the methods provided in the embodiments of this disclosure, the solutions of the embodiments of this disclosure will be further explained below with reference to specific application scenarios.
[0088] In one embodiment, for example, such as Figure 3 As shown, when a user right-clicks on the active tab, a context menu pops up. This menu includes a target menu item: "Submit a Bug Report." This target menu item triggers the generation of a test report for the active tab. Other menu items include options such as "Greater than" and "Save As." For example, as... Figure 4 As shown, when a user clicks the target menu item, a test report page (quick order) for testing the activation tab is generated and displayed on the activation tab in the browser. For example, as... Figure 5 As shown, the test report page includes test-related information, which includes multiple test items and information corresponding to certain test items. The multiple test items include: Page Title (the title of the active tab's page), Page Address (the address of the active tab's page), Processor: Please select a processor (the processor for the active tab test), Title: Please enter the title (the page title of the test report page), Screenshot: Do you need a screenshot (screenshot of the active tab), Problem Description: Please enter the problem description (the problem description of the active tab), Network Request (the network request of the active tab), etc. The information content corresponding to the page title (the title information corresponding to the active tab's page title) is "Overview - Console - M11", and the information content corresponding to the page address (the address information corresponding to the active tab's page address) is http: / / cmgt.tce3101 1test.fsphere.cn / ; The information corresponding to the processor is displayed to the user in the form of a processor list, which includes Zhang San, Li Si, Wang Wu, etc. The user (the person who submits the test report) can select a processor from the processor list; The information corresponding to the network request (the network request information corresponding to the network request that activates the tab) includes the URL (the URL of the network request), the return code (the return code of the network request, that is, the response returned by the server to the browser), the input parameters (the input parameters of the network request, that is, the data sent by the browser to the server), and the output parameters (the output parameters of the network request, that is, the data sent by the server to the browser). The user can select at least one network request from multiple network requests. If at least one network request fails, such as an error in the network request, and the user clicks "Save" on the test report page, the browser will submit the test report to the server.
[0089] In a specific application scenario, such as submitting a test report, see [link to example]. Figure 6 This illustrates the processing flow of a method for submitting test reports, such as... Figure 6As shown, the processing flow of the method for submitting a test report provided in this embodiment includes the following steps: S601, the browser installs the target plugin and creates the target menu item through the target plugin.
[0090] Specifically, for example, the background.js file in the target plugin monitors the onInstalled event. The onInstalled event is the plugin installation event, that is, the event when the target plugin is installed into the browser. When the target plugin is installed into the browser, that is, when the onInstalled event is detected, the first callback function in the background.js file is executed. In the first callback function of the background.js file, the chrome.contextMenus.create method is used to create a right-click menu item (the target menu item), and the title of the right-click menu item is set to, for example, ... Figure 3 The "Bug Report" option shown has its right-click menu item context set to "all". "All" means that the right-click menu item will be displayed in all situations.
[0091] S602, the browser responds to the user's right-click on the active tab in the browser by popping up a right-click menu and displaying the target menu item in the right-click menu.
[0092] Specifically, for example, such as Figure 3 As shown, when a user right-clicks on the active tab, a context menu pops up. This context menu includes a target menu item called "Submit a Bug Report," which is used to trigger the generation of a test report for the active tab. Other menu items in the context menu include options such as "Greater than" and "Save As."
[0093] S603, in response to a triggered action on a target menu item, the browser generates an embedded frame in the browser using the content script of the target plugin in the browser.
[0094] Specifically, for example, the target plugin sends a first message from the background.js file to the content.js file. The content of the first message is `{ action: 'createIframe'}`. This will trigger the target plugin's content.js file to perform related operations on the active tab. These operations might include the content.js file creating an iframe to achieve... Figure 3 The "Submit a Bug Report" function is shown.
[0095] For example, the `content.js` file monitors the first message sent by the `background.js` file. When `content.js` receives the first message, it executes the third callback function within `content.js`. In this third callback function, it determines whether the message content of the first message is `{ action: 'createIframe'}`. If the message content is `{ action: 'createIframe'}`, it calls the `createIframe` function. Within the `createIframe` function: it retrieves the URL of the specified page (HTML file) in the target plugin using the `chrome.runtime.getURL` method. The URL is the path of the HTML file in the target plugin; for example, `src / pages / tapd / index.html`, where `index.html` is an HTML file. Then, it creates an iframe and sets its styles and attributes. This document sets the iframe's position to fixed, its width and height, its position on the page (active tab), and its z-index to ensure it sits above other elements on the page (active tab), preventing it from being covered. It also sets the iframe's border and background colors, and its src attribute to the HTML file's URL (setting the iframe's resource attribute to the target HTML file's address). This allows the iframe to load the specified page (HTML file) based on the URL. It's important to note that the `content.js` file obtains the HTML file's URL, creates an iframe, and sets its src attribute (the HTML file's URL). The iframe can then load the HTML file using this src attribute. In other words, the iframe retrieves the HTML file from the target plugin based on its URL. When the `content.js` file creates the iframe, the browser triggers the iframe to load the HTML file.
[0096] S604, the browser obtains test-related information of the activated tab through the target plugin. The test-related information includes multiple test items and information content corresponding to some of the test items.
[0097] Specifically, for example, multiple test items include the page title of the activated tab, the page address of the activated tab, a screenshot of the activated tab, a problem description of the activated tab, the network request of the activated tab, and the page title of the test report page. Some of these test items contain information such as the network request information corresponding to the network request of the activated tab, the title information corresponding to the page title of the activated tab, and the address information corresponding to the page address of the activated tab. For example, such as... Figure 5 As shown, the test report page includes test-related information, which includes multiple test items and information corresponding to some of these test items. The multiple test items include: Page Title (the title of the active tab's page), Page Address (the address of the active tab's page), Processor: Please select a processor (the processor for the active tab test), Title: Please enter the title (the page title of the test report page), Screenshot: Do you need a screenshot (a screenshot of the active tab), Problem Description: Please enter a problem description (a problem description for the active tab), Network Request (network requests for the active tab), etc. The information corresponding to the page title (the title information corresponding to the active tab's page title) is "Overview - Console - M11", and the information corresponding to the page address (the address information corresponding to the active tab's page address) is http: / / cmgt.tce31011test.fspher e.cn / ; The information corresponding to the processor is displayed to the user in the form of a processor list, which includes Zhang San, Li Si, Wang Wu, etc. The user (the person submitting the test report) can select a processor from the processor list; The information corresponding to the network request (the network request information corresponding to the network request that activates the tab) includes the URL (the URL of the network request), the return code (the return code of the network request, that is, the response returned by the server to the browser), the input parameters (the input parameters of the network request, that is, the data sent by the browser to the server), and the output parameters (the output parameters of the network request, that is, the data sent by the server to the browser). The user can select at least one network request from multiple network requests. If at least one network request is an error, and the user clicks "Save" on the test report page, the browser will submit the test report to the server. The test report includes the information corresponding to at least one network request.
[0098] S605: Based on the test-related information and embedded frames of the activated tab, the browser generates and displays a test report page for the activated tab test.
[0099] Specifically, for example, based on the test-related information of the activated tab and the embedded frame, the updated embedded frame is determined, and the updated embedded frame is rendered by the front-end frame in the browser to obtain the test report page for the activated tab test.
[0100] S606, the browser obtains information content corresponding to at least one test item based on the test report page.
[0101] Specifically, the information content corresponding to at least one test item includes, for example, the problem description entered by the user in the problem description input box, or the title entered by the user in the title (page title of the test report page) input box.
[0102] For example, within a browser's iframe, during iframe initialization, the iframe sends a second message to the content.js file. The iframe retrieves the title (the title information corresponding to the active tab's page title) and address (the address information corresponding to the active tab's page address) of the current page (the active tab). Simultaneously, the front-end framework renders the page (iframe), displaying the title and address within the page (iframe). The front-end framework also handles the dropdown selection; when the user clicks the dropdown, it calls the API (Application Programming Interface). The application programming interface (API) obtains all handlers for the user to select; it draws an input box for the title (page title of the test report page) for the user to enter the title; it draws an input box for the problem description for the user to describe the problem; it draws a checkbox for whether a screenshot is required, and if the user selects this box, a screenshot of the current page will be attached to the bug report when submitting the bug report; it draws a network request table, which contains all network requests for the current page. The information for each network request includes the URL (the URL of the network request), the return code (the return code of the network request, i.e., the response returned by the server to the browser), the input parameters (the input parameters of the network request, i.e., the data sent by the browser to the server), and the output parameters (the output parameters of the network request, i.e., the data sent by the server to the browser). The bug report submitter can select network requests with errors based on the error code (error in the return code) or whether there is an error in the output parameter (error in the data sent by the server to the browser).
[0103] In S607, in response to a save operation on the test report page, the browser converts the test report page into a parameter array, which represents the information content corresponding to multiple test items.
[0104] Specifically, the parameter array is a summary information, such as {url:””, urltitle:””, networkinfo:[], img:””, description:””, bugtitle:””, handler:””}; where url represents the page address of the activated tab, urltitle represents the page title of the activated tab, networkinfo represents the network request of the activated tab, img represents the screenshot of the activated tab, description is the problem description of the activated tab, bugtitle represents the title of the test report page (bug report), and handler represents the name of the person who handled the bug.
[0105] In S608, the browser sends a network request, which includes an array of parameters, to the server.
[0106] Specifically, the parameter array contains summary information; for example, the browser uses a network request to call the "bug report" API, sending the network request containing the summary information to the bug system (server).
[0107] S609, the server parses the parameter array in the received network request and obtains a test report for the activated tab.
[0108] Specifically, the parameter array contains summary information; for example, the bug system (server) parses the summary information in the network request to obtain a bug report, which is a test report for the activated tab.
[0109] Applying the embodiments of this disclosure has at least the following beneficial effects: On the active tab of the browser, based on the user clicking the target menu item (such as the right-click menu item "Submit a bug report"), an embedded iframe is generated in the browser through the target plugin. The target plugin obtains the test-related information of the active tab and provides it to the iframe, thereby automatically obtaining the test-related information of the active tab (such as page title, page address, network requests, etc.), providing a test report page (bug report) for user interaction, real-time data collection, and submission of test reports, thus improving the efficiency of test report submission.
[0110] This disclosure also provides an apparatus for submitting a test report, the structural schematic diagram of which is shown below. Figure 7 As shown, the device 70 for submitting test reports includes a first processing module 701, a second processing module 702, a third processing module 703, a fourth processing module 704, a fifth processing module 705, and a sixth processing module 706.
[0111] The first processing module 701 is used to respond to the target operation on the activated tab and display a preset target menu item, which is used to trigger the generation of a test report for the activated tab. The second processing module 702 is used to generate the browser's embedded frame through the target plugin in the browser in response to the triggered operation for the target menu item. The third processing module 703 is used to obtain test-related information of the activated tab through the target plugin. The test-related information includes multiple test items. The fourth processing module 704 is used to determine the updated embedded frame based on the test-related information of the activated tab and the embedded frame; The fifth processing module 705 is used to generate and display a test report page for the test of the activated tab page based on the updated embedded frame. The test report page includes test-related information. The sixth processing module 706 is used to obtain information content corresponding to at least one of multiple test items based on the test report page, and submit the test report based on the test report page and the obtained information content corresponding to each test item to the server.
[0112] In one embodiment, the second processing module 702 is specifically used for: In response to a triggered action on a target menu item, the active tab is determined from all tabs in the browser via a background script in the target plugin; The first message is generated by the background script in the target plugin and provided to the content script in the target plugin. The first message is used to instruct the content script to generate the browser's inline frame on the active tab. When the content script receives the first message provided by the background script, it generates an embedded frame on the active tab. The resource attributes of the embedded frame include the address of the target hypertext markup language file in the content script. The target hypertext markup language file includes multiple test items.
[0113] In one embodiment, multiple test items include the page title of the activated tab, the page address of the activated tab, a screenshot of the activated tab, a problem description of the activated tab, the network request of the activated tab, and the page title of the test report page. Test-related information also includes network request information corresponding to the network request of the activated tab, title information corresponding to the page title of the activated tab, and address information corresponding to the page address of the activated tab. The third processing module 703 is specifically used for: Obtain the network request information corresponding to the network request of the active tab through the background script in the target plugin; The content script in the target plugin generates the title information corresponding to the page title of the activated tab and the address information corresponding to the page address of the activated tab. Obtain multiple test items from the target hypertext markup language file in the target plugin.
[0114] In one embodiment, the embedded frame includes target areas corresponding to each test item among multiple test items, as well as target areas corresponding to network request information, header information, and address information, respectively. The fourth processing module 704 is specifically used for: Each test item is embedded into its corresponding target area, and network request information, header information, and address information are also embedded into their respective target areas to obtain the updated embedded frame.
[0115] In one embodiment, the fifth processing module 705 is specifically used for: The updated embedded frame is rendered using the front-end framework, and a test report page for testing the activated tab is generated and displayed on the activated tab.
[0116] In one embodiment, at least one test item includes a screenshot of the activated tab, a description of the problem with the activated tab, and a page title of the test report page; The sixth processing module 706 is specifically used for: Obtain information content corresponding to at least one test item from the test report page; In response to a save operation on the test report page, the test report page is converted into a parameter array, which is used to represent the information content corresponding to multiple test items; Send the parameter array to the server so that the server can parse the parameter array to obtain a test report for the activated tab.
[0117] In one embodiment, the second processing module 702 is further configured to: Create the target menu item using the background script in the target plugin.
[0118] Applying the embodiments of this disclosure has at least the following beneficial effects: In response to a target action on the activated tab, a preset target menu item is displayed. This target menu item triggers the generation of a test report for the activated tab. In response to the triggered action on the target menu item, an embedded frame is generated in the browser via a target plugin. Test-related information for the activated tab is obtained through the target plugin, including multiple test items. Based on the test-related information and the embedded frame, an updated embedded frame is determined. Based on the updated embedded frame, a test report page for the activated tab is generated and displayed on the activated tab, including test-related information. Based on the test report... The system retrieves information from at least one of multiple test items on the test report page and submits a test report based on the retrieved information for each test item to the server. This eliminates the need for frequent page switching. Instead, it automatically retrieves relevant test information (such as page title, page address, network requests, etc.) from the active tab (current page) of the browser based on the user's click on a target menu item (e.g., "Submit a Bug Report"), and provides a test report page (bug report) for user interaction. This enables real-time data collection and test report submission, thus improving the efficiency of test report submission.
[0119] This disclosure also provides an electronic device, the structural schematic diagram of which is shown below. Figure 8 As shown, Figure 8 The illustrated electronic device 4000 includes a processor 4001 and a memory 4003. The processor 4001 and the memory 4003 are connected, for example, via a bus 4002. Optionally, the electronic device 4000 may further include a transceiver 4004, which can be used for data interaction between the electronic device and other electronic devices, such as sending and / or receiving data. It should be noted that in practical applications, the transceiver 4004 is not limited to one type, and the structure of the electronic device 4000 does not constitute a limitation on the embodiments of this disclosure.
[0120] 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 the various exemplary logic blocks, modules, and circuits described in conjunction with this disclosure. Processor 4001 may also be a combination that implements computational functions, such as including one or more microprocessor combinations, a combination of a DSP and a microprocessor, etc.
[0121] Bus 4002 may include a pathway for transmitting information between the aforementioned components. Bus 4002 may be a PCI (Peripheral Component Interconnect) bus or an EISA (Extended Industry Standard Architecture) bus, etc. Bus 4002 can be divided into address bus, data bus, control bus, etc. For ease of representation, Figure 8 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.
[0122] The memory 4003 may be ROM (Read Only Memory) or other types of static storage devices capable of storing static information and instructions, RAM (Random Access Memory) or other types of dynamic storage devices capable of storing information and instructions, or EEPROM (Electrically Erasable Programmable Read Only Memory), CD-ROM (Compact Disc Read Only Memory) or other optical disc storage, optical disc storage (including compressed optical discs, laser discs, optical discs, digital universal optical discs, Blu-ray discs, etc.), magnetic disk storage media, other magnetic storage devices, or any other medium capable of carrying or storing computer programs and capable of being read by a computer, without limitation herein.
[0123] The memory 4003 is used to store computer programs that execute embodiments of the present disclosure, and is controlled by the processor 4001 to execute them. The processor 4001 is used to execute the computer programs stored in the memory 4003 to implement the steps shown in the foregoing method embodiments.
[0124] Electronic devices include, but are not limited to, terminals.
[0125] Applying the embodiments of this disclosure has at least the following beneficial effects: In response to a target action on the activated tab, a preset target menu item is displayed. This target menu item triggers the generation of a test report for the activated tab. In response to the triggered action on the target menu item, an embedded frame is generated in the browser via a target plugin. Test-related information for the activated tab is obtained through the target plugin, including multiple test items. Based on the test-related information and the embedded frame, an updated embedded frame is determined. Based on the updated embedded frame, a test report page for the activated tab is generated and displayed on the activated tab, including test-related information. Based on the test report... The system retrieves information from at least one of multiple test items on the test report page and submits a test report based on the retrieved information for each test item to the server. This eliminates the need for frequent page switching. Instead, it automatically retrieves relevant test information (such as page title, page address, network requests, etc.) from the active tab (current page) of the browser based on the user's click on a target menu item (e.g., "Submit a Bug Report"), and provides a test report page (bug report) for user interaction. This enables real-time data collection and test report submission, thus improving the efficiency of test report submission.
[0126] This disclosure provides a computer-readable storage medium storing a computer program, which, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0127] This disclosure also provides a computer program product, including a computer program that, when executed by a processor, can implement the steps and corresponding content of the aforementioned method embodiments.
[0128] It should be understood that although arrows indicate various operation steps in the flowcharts of the embodiments of this disclosure, the order in which these steps are implemented is not limited to the order indicated by the arrows. Unless explicitly stated herein, in some implementation scenarios of the embodiments of this disclosure, the implementation steps in each flowchart can be executed in other orders as required. Furthermore, some or all of the steps in each flowchart may include multiple sub-steps or multiple stages based on the actual implementation scenario. Some or all of these sub-steps or stages can be executed at the same time, and each sub-step or stage can also be executed at different times. In scenarios where execution times differ, the execution order of these sub-steps or stages can be flexibly configured as required, and the embodiments of this disclosure do not limit this.
[0129] The above description is only an optional implementation method for some implementation scenarios of this disclosure. It should be noted that for those skilled in the art, other similar implementation methods based on the technical concept of this disclosure without departing from the technical concept of this disclosure also fall within the protection scope of the embodiments of this disclosure.
Claims
1. A method for submitting a test report, characterized in that, include: In response to a target operation on the activated tab, a preset target menu item is displayed, which is used to trigger the generation of a test report for the activated tab; In response to a triggered operation on the target menu item, an embedded frame of the browser is generated through the target plugin in the browser; The target plugin obtains test-related information about the activated tab, which includes multiple test items. Based on the test-related information of the activated tab and the embedded frame, the updated embedded frame is determined; Based on the updated embedded framework, a test report page for the test of the activated tab is generated and displayed on the activated tab, and the test report page includes the test-related information. Based on the test report page, information content corresponding to at least one of the multiple test items is obtained, and a test report based on the test report page and the obtained information content corresponding to each test item is submitted to the server.
2. The method according to claim 1, characterized in that, The step of generating an embedded frame in the browser via a target plugin in response to a triggered operation on the target menu item includes: In response to a triggering action on the target menu item, the active tab is determined from all tabs of the browser via a background script in the target plugin; A first message is generated by the background script in the target plugin and provided to the content script in the target plugin. The first message is used to instruct the content script to generate the browser's inline frame on the active tab. When the content script receives the first message provided by the background script, the content script generates the embedded frame on the activated tab. The resource attributes of the embedded frame include the address of the target hypertext markup language file in the content script, and the target hypertext markup language file includes the plurality of test items.
3. The method according to claim 1, characterized in that, The multiple test items include the page title of the activated tab, the page address of the activated tab, a screenshot of the activated tab, a problem description of the activated tab, the network request of the activated tab, and the page title of the test report page. The test-related information also includes the network request information corresponding to the network request of the activated tab, the title information corresponding to the page title of the activated tab, and the address information corresponding to the page address of the activated tab. The step of obtaining test-related information about the activated tab through the target plugin includes: The network request information corresponding to the network request of the activated tab is obtained through the background script in the target plugin; The content script in the target plugin generates the title information corresponding to the page title of the activated tab and the address information corresponding to the page address of the activated tab. The multiple test items are obtained through the target hypertext markup language file in the target plugin.
4. The method according to claim 3, characterized in that, The embedded frame includes the target area corresponding to each of the plurality of test items, as well as the target areas corresponding to the network request information, the title information, and the address information, respectively. The step of determining the updated embedded frame based on the test-related information of the activated tab and the embedded frame includes: Each test item is embedded into its corresponding target area, and the network request information, the title information, and the address information are also embedded into their respective target areas to obtain the updated embedded frame.
5. The method according to claim 1, characterized in that, The step of generating and displaying a test report page for the active tab test based on the updated embedded frame includes: The updated embedded frame is rendered using a front-end framework, and a test report page for testing the activated tab is generated and displayed on the activated tab.
6. The method according to claim 3, characterized in that, The at least one test item includes a screenshot of the activated tab, a description of the problem with the activated tab, and the title of the test report page; The step of obtaining information content corresponding to at least one of the multiple test items based on the test report page, and submitting the test report based on the test report page and the obtained information content corresponding to each test item to the server includes: Based on the test report page, obtain the information content corresponding to the at least one test item; In response to the save operation of the test report page, the test report page is converted into a parameter array, which is used to represent the information content corresponding to the multiple test items; The parameter array is sent to the server so that the server can parse the parameter array to obtain a test report for the activated tab.
7. The method according to claim 1, characterized in that, Before generating the browser's inline frame via the target plugin in response to a triggered operation for the target menu item, the method further includes: The target menu item is created using a background script in the target plugin.
8. An apparatus for submitting a test report, characterized in that, include: The first processing module is used to respond to a target operation on the activated tab and display a preset target menu item, the target menu item being used to trigger the generation of a test report for the activated tab; The second processing module is used to generate the browser's embedded frame through the target plugin in response to the trigger operation for the target menu item. The third processing module is used to obtain test-related information of the activated tab through the target plugin, and the test-related information includes multiple test items; The fourth processing module is used to determine the updated embedded frame based on the test-related information of the activated tab and the embedded frame. The fifth processing module is used to generate and display a test report page for the test of the activated tab page based on the updated embedded framework, and the test report page includes the test-related information. The sixth processing module is used to obtain information content corresponding to at least one of the multiple test items based on the test report page, and submit the test report based on the test report page and the obtained information content corresponding to each test item to the server.
9. An electronic device comprising a memory, a processor, and a computer program stored in the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1-7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-7.
11. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1-7.