CN117492862A - File selection method and device and electronic equipment - Google Patents

File selection method and device and electronic equipment Download PDF

Info

Publication number
CN117492862A
CN117492862A CN202311489352.3A CN202311489352A CN117492862A CN 117492862 A CN117492862 A CN 117492862A CN 202311489352 A CN202311489352 A CN 202311489352A CN 117492862 A CN117492862 A CN 117492862A
Authority
CN
China
Prior art keywords
target
file
preset
bullet frame
frame
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202311489352.3A
Other languages
Chinese (zh)
Inventor
刘思兰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Guangzhou Shangyan Network Technology Co ltd
Original Assignee
Guangzhou Shangyan Network Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Guangzhou Shangyan Network Technology Co ltd filed Critical Guangzhou Shangyan Network Technology Co ltd
Priority to CN202311489352.3A priority Critical patent/CN117492862A/en
Publication of CN117492862A publication Critical patent/CN117492862A/en
Pending legal-status Critical Current

Links

Abstract

The application provides a file selection method, a device and electronic equipment, wherein the file selection method comprises the following steps: in the execution process of the automation script, if the target bullet frame in the browser is monitored to be triggered, determining a target bullet frame interface corresponding to the target bullet frame; analyzing interface information corresponding to the target bullet frame interface to obtain a preset file path and preset read permission corresponding to the target bullet frame; and if the automatic script meets the preset reading permission, shielding the target bullet frame, selecting a target file according to the preset file path, and continuously executing the automatic script based on the target file. The method can improve the efficiency of automatic operation.

Description

File selection method and device and electronic equipment
Technical Field
The application belongs to the technical field of computers, relates to an automation technology, and particularly relates to a file selection method, a file selection device and electronic equipment.
Background
In the technical field of automation, an automation frame can be preset, the automation frame sends a test instruction to the equipment to be tested according to the content of an automation script, the equipment to be tested traverses page elements of a current application interface, an element tree corresponding to the application interface is constructed, and then test operation indicated by the test instruction is executed based on the element tree. In the actual automation process, various file selection popup frames can appear in the running process of an application program of the device to be tested, and the automation process is easily interrupted because the occurrence time of the popup frames is unpredictable. Therefore, the elastic frame needs to be processed in time to ensure that the automation process is successfully executed.
However, in the related art, corresponding frame processing codes are added to positions where frames may appear in the automation script, the codes are used for judging that the frames appear, and if the frames appear, the files are automatically selected; if the flick frame does not appear, waiting until overtime. The above method needs to add processing code in each automation script, so that script writing and maintenance become complex and frequent, and automation operation efficiency is low.
Disclosure of Invention
The embodiment of the application provides a file selection method, a file selection device and electronic equipment, so as to solve the problem of low operation efficiency of automation.
An embodiment of the present application provides a file selection method, where the file selection method includes: in the execution process of the automation script, if the target bullet frame in the browser is monitored to be triggered, determining a target bullet frame interface corresponding to the target bullet frame; analyzing interface information corresponding to the target bullet frame interface to obtain a preset file path and preset read permission corresponding to the target bullet frame; and if the automatic script meets the preset reading permission, shielding the target bullet frame, selecting a target file according to the preset file path, and continuously executing the automatic script based on the target file.
Further, in the above file selection method provided in the embodiment of the present application, before the determining the target frame interface corresponding to the target frame, the method further includes: acquiring a source code corresponding to the target bullet frame; adding the packaged initial bullet frame interface into the source code, wherein the initial bullet frame interface contains editable content; and receiving a bullet frame script after online programming of the editable content, and adding the bullet frame script into the initial bullet frame interface to obtain a target bullet frame interface, wherein the bullet frame script comprises file selection rules and reading rights corresponding to a plurality of file selection items in the target bullet frame.
Further, in the above file selection method provided in the embodiment of the present application, the method further includes: presetting a preset trigger event corresponding to the target bullet frame; and if the preset trigger event is monitored, determining that the target bullet frame is triggered.
Further, in the above file selection method provided in the embodiment of the present application, the determining a target frame interface corresponding to the target frame includes: and calling a target bullet frame interface corresponding to the target bullet frame according to the preset corresponding relation between the bullet frame and the bullet frame interface.
Further, in the above file selection method provided in the embodiment of the present application, the analyzing the interface information corresponding to the target frame interface to obtain a preset file path and a preset read permission corresponding to the target frame includes: determining a first preset keyword corresponding to the preset file path and a second preset keyword corresponding to the preset reading authority in the interface information; obtaining the preset file path corresponding to the target bullet frame according to a first index relation between the first preset keyword and the preset file path; and obtaining the preset reading permission corresponding to the target bullet frame according to a second index relation between the second preset keyword and the preset reading permission.
Further, in the above file selection method provided in the embodiment of the present application, after the parsing the interface information corresponding to the target frame interface, the method further includes: detecting whether the interface information contains the preset file path or not; and if the interface information does not contain the preset file path, displaying the target bullet frame, wherein the target bullet frame comprises the plurality of file options.
Further, in the above file selection method provided in the embodiment of the present application, if the automation script does not meet the preset read permission, the method further includes: and displaying the target bullet frame, wherein the target bullet frame comprises the plurality of file options.
Further, in the above file selection method provided in the embodiment of the present application, if the target frame needs to be displayed, the method further includes: determining the bullet frame script corresponding to the target bullet frame interface and the file selection rule in the bullet frame script; and clearing the corresponding preset file path in the file selection rule.
The second aspect of the embodiments of the present application further provides a document selection device, where the document selection device includes: the bullet frame triggering monitoring module is used for determining a target bullet frame interface corresponding to a target bullet frame if the target bullet frame in the browser is triggered in the execution process of the automation script; the interface information analysis module is used for analyzing the interface information corresponding to the target bullet frame interface to obtain a preset file path and preset reading authority corresponding to the target bullet frame; and the target file selection module is used for shielding the target elastic frame if the automatic script meets the preset reading permission, selecting a target file according to the preset file path, and continuously executing the automatic script based on the target file.
The third aspect of the embodiment of the present application further provides an electronic device, where the electronic device includes a controller and a memory, and the controller is configured to implement the file selection method according to any one of the foregoing when executing a computer program stored in the memory.
The fourth aspect of the embodiments of the present application further provides a computer readable storage medium, where a computer program is stored, where the computer program implements the file selection method described above when executed by a controller.
In the file selection method provided by the embodiment of the application, if the target bullet frame is monitored to be triggered in the execution process of the automation script, determining a target bullet frame interface corresponding to the target bullet frame; analyzing interface information corresponding to the target bullet frame interface to obtain a preset file path and preset read permission corresponding to the target bullet frame; and if the automatic script meets the preset reading permission, shielding the target elastic frame, and selecting a target file according to the preset file path so that the automatic script can be smoothly executed. According to the embodiment, the interface information is added, the preset file path and the preset reading authority corresponding to the target bullet frame are set, when the automatic script meets the preset reading authority in automatic execution, the target bullet frame is shielded, the target file is selected according to the preset file path, and the influence on the automatic operation efficiency of the bullet frame is avoided.
Drawings
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Fig. 2 is a flowchart of a file selection method according to an embodiment of the present application.
Fig. 3 is a flowchart for determining a target frame interface according to an embodiment of the present application.
Fig. 4 is a flowchart of triggering a target frame according to an embodiment of the present application.
Fig. 5 is a flow chart for parsing interface information according to an embodiment of the present application.
Fig. 6 is a flowchart of displaying a target frame according to an embodiment of the present application.
Fig. 7 is a flowchart of clearing a file path according to an embodiment of the present application.
Fig. 8 is a schematic structural diagram of a document selection device according to an embodiment of the present application.
Detailed Description
It should be noted that the terms "first" and "second" in the specification, claims and drawings of this application are used for distinguishing between similar objects and not for describing a particular sequential or chronological order.
It should be further noted that the method disclosed in the embodiments of the present application or the method shown in the flowchart, including one or more steps for implementing the method, may be performed in an order that the steps may be interchanged with one another, and some steps may be deleted without departing from the scope of the claims.
Some embodiments will be described below with reference to the accompanying drawings. The following embodiments and features of the embodiments may be combined with each other without conflict.
In the execution process of the automatic script, various file selection popup frames possibly appear in the running process of an application program of the equipment to be tested, and taking the equipment to be tested as a Chromium browser as an example, a plurality of file selection popup frames are arranged in the Chromium browser and are used for prompting a user to select a target file from a plurality of file selection items, and the automatic script can be continuously executed only after the user selects the target file on an application interface; otherwise, the automation script will wait until a timeout. The timing of the occurrence of the spring frame is unpredictable, which easily leads to the interruption of the automation process. Therefore, the elastic frame needs to be processed in time to ensure that the automation process is successfully executed.
In the related art, a frame processing code needs to be added in each automation script, and the frame processing code is used for judging whether a frame appears in the automation process or not and closing the frame in time after the frame appears, so that script writing and maintenance become complex and frequent, and the automation operation efficiency is low.
In view of the foregoing, it is necessary to provide a file selection method for reducing maintenance cost of an automation script and improving execution efficiency of automation.
Fig. 1 is a schematic structural diagram of an electronic device according to an embodiment of the present application, as shown in fig. 1, an electronic device 30 includes a memory 31, at least one controller 32, and at least one communication bus 33, where the controller 32 is configured to implement a file selection method when executing a computer program stored in the memory 31, and the at least one communication bus 33 is configured to implement connection communication between the memory 31 and the at least one controller 32. It will be appreciated that the configuration of the electronic device shown in fig. 1 is not limiting of the embodiments of the present application, and that either a bus-type configuration or a star-type configuration may be used, and that electronic device 30 may include more or less other hardware or software than that shown, or a different arrangement of components.
In some embodiments, the electronic device 30 is a device capable of automatically performing numerical calculations and/or information processing according to predetermined or stored instructions, the hardware of which includes, but is not limited to, microcontrollers, application specific integrated circuits, programmable gate arrays, digital controllers, embedded devices, and the like. The electronic device 30 may also be connected to a client device, and the client device includes, but is not limited to, any electronic product that can interact with a client by way of a keyboard, mouse, remote control, touch pad, or voice control device, such as a personal computer, tablet, smart phone, digital camera, etc.
It should be noted that the electronic device 30 is only used as an example, and other electronic products that may be present in the present application or may be present in the future are also included in the scope of the present application and are incorporated herein by reference.
In some embodiments, at least one communication bus 33 is provided to enable connected communication between the memory 31 and at least one controller 32 or the like.
Although not shown, the electronic device 30 may also include a power source (e.g., a battery) for powering the various components, preferably the power source is logically connected to the at least one controller 32 via a power management device that performs functions such as managing charge, discharge, and power consumption. The power supply may also include one or more of any of a direct current or alternating current power supply, recharging device, power failure detection circuit, power converter or inverter, power status indicator, etc. The electronic device 30 may also include various sensors, bluetooth modules, wi-Fi modules, etc., which are not described in detail herein.
Fig. 2 is a flowchart of a file selection method according to an embodiment of the present application, where the file selection method is applied to an electronic device. As shown in fig. 2, the file selection method may include the following steps, and the order of the steps in the flowchart may be changed according to different needs, and some may be omitted.
S11, in the execution process of the automation script, if the target frame in the browser is triggered, determining a target frame interface corresponding to the target frame.
In one embodiment, the automation script is a tool for automated deployment or testing, typically written in a programming language such as Shell, perl, python, to assist the device under test in performing large-scale deployment or monitoring. In a particular application, an automation script includes a plurality of sub-functions and sub-modules for performing a particular business deployment or base environment deployment. The device under test may be a browser, for example, a Chromium browser, which is not limited herein. The target bullet frame is a content bullet frame which is arranged in the device to be tested and used for completing information transmission and user feedback, and the target bullet frame is used for prompting a user to select a target file from a plurality of file options. In an embodiment, the target bullet frame includes a plurality of file contents (e.g., file titles) and a selection frame corresponding to each file content, and by touching the selection frame, it indicates that a target file is selected from the plurality of file contents, and then, the automation script is continuously executed according to the target file.
In an embodiment, a source code corresponding to the open-source Chromium browser is obtained, and a frame interface is newly added in the source code, where the frame interface may be a JS interface. The bullet frame interface can comprise file selection rules and reading rights corresponding to the target bullet frame, and according to the file selection rules, when the target bullet frame is triggered, a target file can be timely selected from a plurality of file contents; the read permission is used for indicating whether the automation script has the permission of reading the file, and if the automation script has the permission of reading the file, the target file is read; and if the automation script does not have the authority to read the file, displaying the target bullet frame. In an embodiment, the number of target frames in the chrome browser is predetermined, and a corresponding frame interface is set for each target frame, that is, a correspondence exists between the frame and the frame interface. And when the trigger of the target bullet frame is detected, obtaining a target bullet frame interface corresponding to the target bullet frame according to the preset corresponding relation between the bullet frame and the bullet frame interface.
S12, analyzing interface information corresponding to the target bullet frame interface to obtain a preset file path and a preset reading authority corresponding to the target bullet frame.
In an embodiment, the interface information includes a file selection rule and a read authority corresponding to the target bullet frame, where the file selection rule may be set according to an actual requirement, for example, the file selection rule may include randomly selecting a target file from a plurality of file contents; alternatively, the target file is specified from among a plurality of file contents, and the file selection rule may be set according to actual requirements, without limitation. In an embodiment, for each file content, there is a corresponding preset file path, according to which a related file can be read, so that the interface information further includes a preset file path of the related file transmitted according to a file selection rule, and illustratively, the plurality of file contents are file content a, file content B and file content C respectively, where the file content a corresponds to the preset file path a, and the file content a corresponds to the preset file path a. If the file selection rule is that the target file is selected randomly, when the target file selected randomly is file content A, determining a preset file path A corresponding to the file content A and transmitting the preset file path A into interface information; if the file selection rule is a specified target file, and when the specified target file is file content B, determining a preset file path B corresponding to the file content B and transmitting the preset file path B into interface information.
In an embodiment, the preset read right refers to a preset right with a file read function, the preset read right includes device information with the file read function, and if the preset read right includes a script code corresponding to an automation script, the automation script is determined to have the file read right; if the preset read permission does not contain the script code corresponding to the automation script, determining that the automation script does not have the file read permission.
And S13, shielding the target bullet frame if the automatic script meets the preset reading permission, selecting a target file according to the preset file path, and continuously executing the automatic script based on the target file.
In an embodiment, if the automation script meets the preset read permission, shielding the target frame, that is, not ejecting the target frame; then, automatically selecting a target file from a plurality of file contents corresponding to the target bullet frame according to a preset file path; and then, continuously executing the automation script based on the target file, so that the automation script can be smoothly executed.
According to the file selection method provided by the embodiment of the application, through newly adding interface information, the preset file path and the preset reading authority corresponding to the target bullet frame are set, so that when the automatic script meets the preset reading authority in automatic execution, the target bullet frame is shielded, and the target file is selected according to the preset file path, so that the influence on the automatic operation efficiency of the bullet frame is avoided; and by means of newly increasing interface information, each automation script can be prevented from being independently developed and modified, and development and maintenance cost of the automation script is reduced.
In an example, a source code corresponding to an open-source Chromium browser needs to be acquired, and a frame interface is newly added in the source code, so that in the execution process of an automation script, if the target frame is monitored to be triggered, the frame interface can be called to realize shielding treatment of the target frame, the automatic execution process is prevented from being interrupted, and the efficiency of automatic operation is ensured. Fig. 3 is a flowchart of determining a target frame interface according to an embodiment of the present application, where the method for determining a target frame interface is applied to an electronic device. As shown in fig. 3, the method comprises the following steps:
s21, acquiring a source code corresponding to the target bullet frame.
In an embodiment, the Chromium browser may include a plurality of target boxes, the source code corresponding to the Chromium browser includes a source code corresponding to the plurality of target boxes, and a box annotation may be set in the source code, where the box annotation is used to identify the source code corresponding to each target box. In one embodiment, the source code may be JAVA language code.
S22, adding the packaged initial frame interface into the source code, wherein the initial frame interface contains editable content.
In an embodiment, the initial frame interface includes editable content and non-editable content, where the editable content refers to a script obtained by a user performing a visual programming operation on an operation interface for different frame interfaces, and the script may be a description language unique to each frame interface; non-editable content refers to a script that is common to setting up multiple box interfaces.
S23, receiving a bullet frame script after online programming of the editable content, and adding the bullet frame script into the initial bullet frame interface to obtain a target bullet frame interface, wherein the bullet frame script comprises file selection rules and reading rights corresponding to a plurality of file selection items in the target bullet frame.
In an embodiment, the electronic device provides a visual operation interface, and the user performs online programming through the visual operation interface to obtain a bullet script, and adds the bullet script to the initial bullet interface. The target bullet frame comprises a plurality of file options, the file options comprise file contents (for example, file titles) and selection frames corresponding to the file contents, the selection frames are touched to indicate that a target file is selected from the file contents, and then the automation script is continuously executed according to the target file. In an embodiment, there is a correspondence between the target bullet frame and the file options, and by querying the correspondence, a plurality of file options corresponding to the target bullet frame can be determined.
In an embodiment, the file selection rule is configured to be capable of timely selecting the target file from the plurality of file contents when the target bullet frame is triggered, where the file selection rule may be set according to actual requirements, for example, the file selection rule may include randomly selecting the target file from the plurality of file contents; or, the target file is specified from the file contents, and the file selection rule can be set according to the actual requirement, so that the method is not limited; the read right is used for indicating whether the automation script has the right of reading the file, and the read right comprises a plurality of file contents and equipment information which is endowed with the function of reading the file contents. If the automation script has the authority of reading the file, reading the target file; and if the automation script does not have the authority to read the file, displaying the target bullet frame.
In an embodiment, the code corresponding to the file selection rule and the code corresponding to the reading authority are written into the bullet frame interface as bullet frame scripts, so that the constructed bullet frame interface for shielding the target bullet frame is obtained.
According to the method and the device for realizing the automatic execution of the target bullet frame, the bullet frame interface is newly added in the source code, so that in the execution process of the automatic script, if the target bullet frame is monitored to be triggered, the bullet frame interface can be called to realize the shielding treatment of the target bullet frame, the automatic execution process is prevented from being interrupted, and the automatic operation efficiency is ensured.
In an embodiment, in the execution process of the automation script, because the occurrence time of the target bullet frame cannot be predicted, whether the target bullet frame is triggered or not needs to be monitored, so that when the trigger of the target bullet frame is monitored, interface information is timely called, the interruption of the automation execution process is avoided, and the efficiency of the automation operation is ensured. Fig. 4 is a flowchart of triggering a target frame according to an embodiment of the present application, where the method for triggering a target frame is applied to an electronic device. As shown in fig. 4, the method comprises the following steps:
s31, presetting a preset trigger event corresponding to the target bullet frame.
In an embodiment, the preset trigger event refers to a preset event for triggering the target frame, and the preset trigger event may include, but is not limited to, a mouse hover event, a click event, and an acquisition focus event.
S32, if the preset trigger event is monitored, determining that the target bullet frame is triggered.
In an embodiment, if one or more events of a mouse hover event, a click event and an acquisition focus event are monitored to be triggered, determining that a target frame is triggered; and if any one of the mouse hovering event, the clicking event and the focus acquisition event is not triggered, determining that the target bullet frame is not triggered.
According to the embodiment of the application, whether the target bullet frame is triggered or not is monitored through the preset trigger event, when the trigger of the target bullet frame is monitored, interface information can be timely called, the automatic execution process is prevented from being interrupted, and the automatic operation efficiency is guaranteed.
In an embodiment, after the target bullet frame is triggered, calling interface information corresponding to the interface of the target bullet frame, analyzing the interface information to obtain a preset file path and preset reading authority corresponding to the target bullet frame, and determining whether to realize the function of shielding the target bullet frame according to the preset file path and the preset reading authority. Fig. 5 is a flow chart of parsing interface information provided in an embodiment of the present application, where the parsing method of interface information is applied to an electronic device. As shown in fig. 5, the method comprises the following steps:
S41, determining a first preset keyword corresponding to the preset file path and a second preset keyword corresponding to the preset reading authority in the interface information.
In an embodiment, the interface information includes a frame script and a script shared by a plurality of frame interfaces, where the frame script includes code information corresponding to a preset file path and a preset read right, and the preset file path and the preset read right both have corresponding preset keywords in the code information, and by querying the preset keywords in the code information, positions of the preset file path and the preset read right in the code information can be located in time. For example, the first preset keyword corresponding to the preset file path may be "path", and the second preset permission keyword corresponding to the preset read permission may be "GrantReadFile", where "GrantReadFile" is a function or method for granting the read permission to the file.
S42, obtaining the preset file path corresponding to the target bullet frame according to the first index relation between the first preset keyword and the preset file path.
In an embodiment, when the interface information is set, a first index relationship between a first preset keyword and a preset file path is preset, and according to the first index relationship, the position of the preset file path can be quickly located in the interface information by combining the first preset keyword.
S43, obtaining the preset read permission corresponding to the target bullet frame according to a second index relation between the second preset keyword and the preset read permission.
In an embodiment, when the interface information is set, a second index relationship between a second preset keyword and a preset read right is preset, and according to the second index relationship, the position of the preset read right can be quickly located in the interface information by combining with the second preset keyword.
According to the method and the device for achieving the shielding target bullet frame, after the target bullet frame is triggered, interface information is called, analysis processing is conducted on the interface information, the preset file path and the preset reading permission corresponding to the target bullet frame are obtained rapidly and accurately according to the first index relation between the first preset keyword and the preset file path and the second index relation between the second preset keyword and the preset reading permission, then whether the function of shielding the target bullet frame is achieved is determined according to the preset file path and the preset reading permission, and accuracy and efficiency of achieving the function of shielding the target bullet frame can be improved, and accuracy and efficiency of automatic operation are improved.
In an embodiment, in the actual automated execution process, the interface information may not be used to implement the function of shielding the target frame, and the interface information does not include the preset file path corresponding to the target frame. Whether the interface information contains the preset file path or not is detected, whether the target bullet frame needs to be shielded or not can be accurately determined, and accuracy and efficiency of automatic operation are improved. Fig. 6 is a flowchart of displaying a target frame according to an embodiment of the present application, where the method for displaying a target frame is applied to an electronic device. As shown in fig. 6, the method comprises the following steps:
S51, detecting whether the interface information contains the preset file path.
In an embodiment, the foregoing embodiment is received, and whether the interface information includes the preset file path is detected according to a first preset keyword corresponding to the preset file path and a first index relationship between the preset file path and the first preset keyword. If the interface information does not contain the first preset keyword or the content corresponding to the first preset keyword is obtained to be empty according to the first index relation, determining that the interface information does not contain the preset file path; otherwise, determining that the interface information contains a preset file path.
And S52, if the interface information does not contain the preset file path, displaying the target frame, wherein the target frame comprises the plurality of file options.
In an embodiment, if the interface information does not include the preset file path, determining that the interface information is not used for realizing a function of shielding a target frame, so that when the target frame is monitored to be triggered, displaying the target frame, wherein the target frame includes the plurality of file options, and the file options include file contents (for example, file titles) and selection frames corresponding to the file contents; and then, the selection box is touched by a user to indicate that the target file is selected from the plurality of file contents, and then, the automation script is continuously executed according to the target file.
According to the method and the device for detecting the interface information, whether the interface information contains the preset file path or not can be detected, whether the target bullet frame needs to be shielded or not can be accurately determined, and accuracy of automatic operation is improved.
In an embodiment, the preset read right refers to a preset right with a file read function, the preset read right includes device information with the file read function, and if the preset read right includes a script code corresponding to an automation script, the automation script is determined to have the file read right; if the preset read permission does not contain the script code corresponding to the automation script, determining that the automation script does not have the file read permission. If the automation script does not meet the preset read permission, the method further comprises: and displaying the target bullet frame, wherein the target bullet frame comprises the plurality of file options. According to the method and the device for detecting the target bullet frame, whether the automatic script has the preset reading authority or not can be detected, whether the target bullet frame needs to be shielded or not can be accurately determined, and accuracy of automatic operation is improved.
In an embodiment, after the target frame is triggered, if the target frame does not have corresponding interface information, which indicates that the target frame does not need to be shielded, the target frame is displayed, and the target frame includes the plurality of file options. According to the method and the device for detecting the interface information of the target bullet frame, whether the target bullet frame needs to be shielded or not can be accurately determined by detecting whether the interface information exists in the target bullet frame, and accuracy of automatic operation is improved.
In one embodiment, if the target frame needs to be redisplayed, the target frame interface needs to be updated. Fig. 7 is a flowchart of clearing a file path, where the method for clearing a file path is applied to an electronic device. As shown in fig. 7, the method comprises the following steps:
s61, determining the bullet frame script corresponding to the target bullet frame interface and the file selection rule in the bullet frame script.
In an embodiment, the bullet frame script includes a file selection rule and a read authority corresponding to a plurality of file selection items in the target bullet frame, where the file selection rule refers to a rule for selecting a target file from a plurality of file contents, and because each file content has a corresponding preset file path, the file selection rule also includes a plurality of preset file paths corresponding to the target bullet frame.
S62, clearing the corresponding preset file path in the file selection rule.
In an embodiment, if the target frame needs to be redisplayed, determining a position of a preset file path in the file selection rule, and clearing the preset file path, so that when the interface information is called and analyzed after the target frame is triggered, the target frame is displayed for the user to select a corresponding file selection item because the interface information does not contain the preset file path.
According to the method and the device for displaying the target bullet frame interface, the target bullet frame interface corresponding to the target bullet frame is updated by clearing the preset file path in the interface information, the target bullet frame can be redisplayed according to the actual requirement of the automation script, and the flexibility of bullet frame interface setting is improved.
Referring to fig. 8, fig. 8 is a schematic structural diagram of a document selecting apparatus according to an embodiment of the present application. In some embodiments, the file selection device 20 may include a plurality of functional modules consisting of computer program segments. The computer program of the individual program segments in the file selection means 20 may be stored in a memory of the computer device 30 and executed by at least one controller for performing (see in detail fig. 2 for a description) the file selection function.
In this embodiment, the file selecting apparatus 20 may be divided into a plurality of functional modules according to the functions performed by the file selecting apparatus. The functional module may include: the bullet frame triggers the monitoring module 201, the interface information parsing module 202 and the target file selecting module 203. The module referred to in this application refers to a series of computer program segments capable of being executed by at least one controller and of performing a fixed function, stored in a memory. In the present embodiment, the functions of the respective modules will be described in detail in the following embodiments.
The frame triggering monitoring module 201 is configured to determine, in an execution process of the automation script, a target frame interface corresponding to a target frame if it is monitored that the target frame is triggered in the browser.
The interface information analysis module 202 is configured to analyze interface information corresponding to the target frame interface, and obtain a preset file path and a preset read right corresponding to the target frame.
And the target file selecting module 203 is configured to shield the target frame if the automation script meets the preset read permission, select a target file according to the preset file path, and continuously execute the automation script based on the target file.
In some embodiments, the bullet trigger listening module 201 further comprises: the source code acquisition sub-module is used for acquiring a source code corresponding to the target bullet frame; the bullet frame interface packaging submodule is used for adding a packaged initial bullet frame interface into the source code, wherein the initial bullet frame interface comprises editable content; and the bullet frame script receiving sub-module is used for receiving the bullet frame script after the online programming of the editable content, and adding the bullet frame script into the initial bullet frame interface to obtain a target bullet frame interface, wherein the bullet frame script comprises file selection rules and reading rights corresponding to a plurality of file selection items in the target bullet frame.
In some embodiments, the bullet trigger listening module 201 further comprises: the trigger event setting sub-module is used for presetting a preset trigger event corresponding to the target bullet frame; and the trigger event monitoring sub-module is used for determining that the target bullet frame is triggered if the preset trigger event is monitored.
In some embodiments, the bullet trigger listening module 201 further comprises: and the corresponding relation determining sub-module is used for calling a target bullet frame interface corresponding to the target bullet frame according to the corresponding relation between the preset bullet frame and the bullet frame interface.
In some embodiments, the interface information parsing module 202 further includes: the keyword determining submodule is used for determining a first preset keyword corresponding to the preset file path and a second preset keyword corresponding to the preset reading authority in the interface information; a file path determining sub-module, configured to obtain, according to a first index relationship between the first preset keyword and the preset file path, the preset file path corresponding to the target frame; and the reading permission determination submodule is used for obtaining the preset reading permission corresponding to the target bullet frame according to the second index relation between the second preset keyword and the preset reading permission.
In some embodiments, the interface information parsing module 202 further includes: a file path detection sub-module, configured to detect whether the interface information includes the preset file path; and the target bullet frame display sub-module is used for displaying the target bullet frame if the interface information does not contain the preset file path, and the target bullet frame comprises the plurality of file options.
In some embodiments, the object file selection module 203 further includes: and the target bullet frame display sub-module is used for displaying the target bullet frame, and the target bullet frame comprises the plurality of file options.
In some embodiments, the object file selection module 203 further includes: the selection rule determining submodule is used for determining the bullet frame script corresponding to the target bullet frame interface and the file selection rule in the bullet frame script; and the file path clearing sub-module is used for clearing the preset file path corresponding to the file selection rule.
It can be understood that the file selecting apparatus 20 and the file selecting method of the above embodiment belong to the same inventive concept, and specific implementation manners of the modules of the file selecting apparatus 20 correspond to the steps of the file selecting method of the above embodiment, which is not repeated herein.
The above-described module division is a logic function division, and there may be another division manner in actual implementation. In addition, each functional module in each embodiment of the present application may be integrated in the same processing unit, or each module may exist alone physically, or two or more modules may be integrated in the same unit. The integrated modules may be implemented in hardware or in hardware plus software functional modules.
Next to the description of the electronic device in fig. 1, a computer program is stored in the memory 31, which when executed by the at least one controller 32 implements all or part of the steps of the file selection method as such. The Memory 31 includes Read-Only Memory (ROM), programmable Read-Only Memory (Programmable Read-Only Memory, PROM), erasable programmable Read-Only Memory (Erasable Programmable Read-Only Memory, EPROM), one-time programmable Read-Only Memory (OTPROM), electrically erasable rewritable Read-Only Memory (EEPROM), compact disc Read-Only Memory (Compact Disc Read-Only Memory, CD-ROM) or other optical disc Memory, magnetic tape Memory, or any other medium that can be used for a computer readable medium that carries or stores data.
Further, the computer-readable storage medium may mainly include a storage program area and a storage data area, wherein the storage program area may store an operating system, an application program required for at least one function, and the like; the storage data area may store data created according to the use of the electronic device 30, or the like.
In some embodiments, at least one controller 32 is a Control Unit (Control Unit) of electronic device 30 that connects the various components of the entire electronic device 30 using various interfaces and lines, by running or executing programs or modules stored in memory 31, and invoking data stored in memory 31 to perform various functions of electronic device 30 and process data. For example, at least one controller 32, when executing a computer program stored in memory, implements all or part of the steps of the file selection method in embodiments of the present application; or to implement all or part of the functionality of the file selection means. The at least one controller 32 may be comprised of integrated circuits, such as a single packaged integrated circuit, or may be comprised of multiple integrated circuits packaged with the same or different functionality, including one or more central controllers (Central Processing unit, CPUs), microcontrollers, digital processing chips, graphics controllers, combinations of various control chips, and the like.
The integrated units implemented in the form of software functional modules described above may be stored in a computer readable storage medium. The software functional modules described above are stored in a storage medium and include instructions for causing an electronic device (which may be a personal computer, an electronic device, or a network device, etc.) or a controller (processor) to perform portions of the methods of various embodiments of the present application.
In the several embodiments provided in this application, it should be understood that the disclosed apparatus and method may be implemented in other ways. For example, the above-described apparatus embodiments are merely illustrative, and for example, the division of modules is merely a logical function division, and other manners of division may be implemented in practice.
The modules illustrated as separate components may or may not be physically separate, and components shown as modules may or may not be physical units, may be located in one place, or may be distributed over multiple network elements. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
In addition, each functional module in each embodiment of the present application may be integrated in one processing unit, or each unit may exist alone physically, or two or more units may be integrated in one unit. The integrated units can be realized in a form of hardware or a form of hardware and a form of software functional modules.
It will be evident to those skilled in the art that the present application is not limited to the details of the foregoing illustrative embodiments, and that the present application may be embodied in other specific forms without departing from the spirit or essential characteristics thereof. The present embodiments are, therefore, to be considered in all respects as illustrative and not restrictive, the scope of the application being indicated by the appended claims rather than by the foregoing description, and all changes which come within the meaning and range of equivalency of the claims are therefore intended to be embraced therein. Any reference sign in a claim should not be construed as limiting the claim concerned. Furthermore, it will be obvious that the term "comprising" does not exclude other elements or that the singular does not exclude a plurality. Several of the elements or devices recited in the specification may be embodied by one and the same item of software or hardware. The terms first, second, etc. are used to denote a name, but not any particular order.
Finally, it should be noted that the above embodiments are merely for illustrating the technical solution of the present application and not for limiting, and although the present application has been described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present application may be modified or substituted without departing from the spirit and scope of the technical solution of the present application.

Claims (10)

1. The file selecting method is characterized by comprising the following steps:
in the execution process of the automation script, if the target bullet frame in the browser is monitored to be triggered, determining a target bullet frame interface corresponding to the target bullet frame;
analyzing interface information corresponding to the target bullet frame interface to obtain a preset file path and preset read permission corresponding to the target bullet frame;
and if the automatic script meets the preset reading permission, shielding the target bullet frame, selecting a target file according to the preset file path, and continuously executing the automatic script based on the target file.
2. The method of claim 1, wherein prior to said determining a target frame interface corresponding to the target frame, the method further comprises:
acquiring a source code corresponding to the target bullet frame;
adding the packaged initial bullet frame interface into the source code, wherein the initial bullet frame interface contains editable content;
and receiving a bullet frame script after online programming of the editable content, and adding the bullet frame script into the initial bullet frame interface to obtain a target bullet frame interface, wherein the bullet frame script comprises file selection rules and reading rights corresponding to a plurality of file selection items in the target bullet frame.
3. The file selection method as recited in claim 1, wherein the method further comprises:
presetting a preset trigger event corresponding to the target bullet frame;
and if the preset trigger event is monitored, determining that the target bullet frame is triggered.
4. The method for selecting a file as claimed in claim 1, wherein said determining a target frame interface corresponding to the target frame includes:
and calling a target bullet frame interface corresponding to the target bullet frame according to the preset corresponding relation between the bullet frame and the bullet frame interface.
5. The method for selecting a file according to claim 1, wherein said parsing the interface information corresponding to the target frame interface to obtain a preset file path and a preset read right corresponding to the target frame includes:
determining a first preset keyword corresponding to the preset file path and a second preset keyword corresponding to the preset reading authority in the interface information;
obtaining the preset file path corresponding to the target bullet frame according to a first index relation between the first preset keyword and the preset file path;
and obtaining the preset reading permission corresponding to the target bullet frame according to a second index relation between the second preset keyword and the preset reading permission.
6. The method for selecting a file as claimed in claim 2, wherein after said parsing interface information corresponding to said target frame interface, the method further comprises:
detecting whether the interface information contains the preset file path or not;
and if the interface information does not contain the preset file path, displaying the target bullet frame, wherein the target bullet frame comprises the plurality of file options.
7. The file selection method according to claim 2, wherein if the automation script does not satisfy the preset read right, the method further comprises:
and displaying the target bullet frame, wherein the target bullet frame comprises the plurality of file options.
8. The method of claim 2, wherein if the target frame needs to be displayed, the method further comprises:
determining the bullet frame script corresponding to the target bullet frame interface and the file selection rule in the bullet frame script;
and clearing the corresponding preset file path in the file selection rule.
9. A document selection apparatus, characterized in that the document selection apparatus comprises:
the bullet frame triggering monitoring module is used for determining a target bullet frame interface corresponding to a target bullet frame if the target bullet frame in the browser is triggered in the execution process of the automation script;
The interface information analysis module is used for analyzing the interface information corresponding to the target bullet frame interface to obtain a preset file path and preset reading authority corresponding to the target bullet frame;
and the target file selection module is used for shielding the target elastic frame if the automatic script meets the preset reading permission, selecting a target file according to the preset file path, and continuously executing the automatic script based on the target file.
10. An electronic device comprising a controller and a memory, wherein the controller is configured to implement the file selection method according to any one of claims 1 to 8 when executing a computer program stored in the memory.
CN202311489352.3A 2023-11-09 2023-11-09 File selection method and device and electronic equipment Pending CN117492862A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311489352.3A CN117492862A (en) 2023-11-09 2023-11-09 File selection method and device and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311489352.3A CN117492862A (en) 2023-11-09 2023-11-09 File selection method and device and electronic equipment

Publications (1)

Publication Number Publication Date
CN117492862A true CN117492862A (en) 2024-02-02

Family

ID=89672252

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311489352.3A Pending CN117492862A (en) 2023-11-09 2023-11-09 File selection method and device and electronic equipment

Country Status (1)

Country Link
CN (1) CN117492862A (en)

Similar Documents

Publication Publication Date Title
US10489503B2 (en) Automated form layout based upon usage patterns
US9389882B2 (en) Application documentation effectiveness monitoring and feedback
CN102341790B (en) Data processing system and use method thereof
CN111338901A (en) Redis monitoring method, Redis monitoring device and terminal
CN109358975A (en) A kind of analysis method, device, electronic equipment and storage medium that software is operating abnormally
CN103677806A (en) Method and system for managing a system
US11816479B2 (en) System and method for implementing a code audit tool
CN109375921A (en) Page file quickly compiles method, apparatus and storage equipment, computer equipment
CN111158806B (en) Interface display method, device, computer equipment and storage medium
US20080126873A1 (en) Resource efficient software tracing for problem diagnosis
CN109271789A (en) Malicious process detection method, device, electronic equipment and storage medium
CN112948275A (en) Test data generation method, device, equipment and storage medium
US8572553B2 (en) Systems and methods for providing feedback for software components
CN109522086B (en) Operation method and device for window, computer device and readable storage medium
CN112286782A (en) Control shielding detection method, software detection method, device and medium
CN108845924B (en) Control response area display control method, electronic device, and storage medium
CN109460234B (en) Application slimming method and device, terminal and storage medium
CN117492862A (en) File selection method and device and electronic equipment
CN111448551B (en) Method and system for tracking application activity data from a remote device and generating a corrective action data structure for the remote device
CN111784176A (en) Data processing method, device, server and medium
EP2608018A1 (en) Customizing a GUI of a MES screen
CN110879701A (en) Workflow visualization configuration method, server, system and medium
CN114625448A (en) Flow generation method and device combining RPA and AI, electronic equipment and storage medium
CN113934595A (en) Data analysis method and system, storage medium and electronic terminal
CN113377608A (en) Method and device for alarming task abnormity, terminal equipment and storage medium

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination