Method, device, system and readable storage medium for processing component properties
Patent Information
- Application Number
- CN202211235403.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-10-10
- Publication Date
- 2026-10-20
- Estimated Expiration
- 2042-10-10
AI Technical Summary
[0002]在现有技术中,在使用RPA(机器人流程自动化)工具进行自动化测试的时候,需要操作xpath(XML Path Language XML路径语言),为了高效的获取到对应的DOM(文档对象模型),需要人工在源代码中添加唯一的属性id(身份标识码),此方法添加效率低,需要人工进行多次重复的工作,属性添加错误的概率大
[0029]本发明的组件属性的处理装置,通过确定单元确定第一规则,通过处理单元为多个目标组件配置第一规则,实现了对目标组件属性的自动添加,并进一步实现了目标组件带有属性的身份标识码的生成,在保证了目标组件的生成的身份标识码的唯一性的同时,避免了人工添加身份标识码,在减少了人工工作量的同时,避免了人工添加身份标识码可能出现的错误,增加了目标组件对应的身份标识码的准确性。
Smart Images

Figure CN115576813B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of software processing, and more specifically, to a method for processing component attributes, a device for processing component attributes, a system for processing component attributes, and a readable storage medium. Background Technology
[0002] In existing technologies, when using RPA (Robotic Process Automation) tools for automated testing, it is necessary to manipulate XPath (XML Path Language). In order to efficiently obtain the corresponding DOM (Document Object Model), a unique attribute id (identification code) needs to be manually added to the source code. This method is inefficient, requires multiple repetitive manual tasks, and has a high probability of adding the attribute incorrectly. Summary of the Invention
[0003] The present invention aims to solve at least one of the technical problems existing in the prior art or related art.
[0004] Therefore, one aspect of the present invention is to provide a method for processing component attributes.
[0005] Another aspect of the present invention is to provide a component attribute processing device.
[0006] Another aspect of the present invention is to provide a component attribute processing system.
[0007] Another aspect of the present invention is to provide a readable storage medium.
[0008] In view of this, according to one aspect of the present invention, a method for processing component attributes is proposed, comprising: determining a first rule, the first rule including multiple attribute information; adding multiple attributes to multiple target components among multiple preset components according to the first rule, the multiple preset components being used for automated testing; generating multiple identification codes based on the multiple target components after adding multiple attributes, and adding multiple attributes to the multiple identification codes; and submitting the multiple identification codes after adding multiple attributes so that the multiple identification codes after adding multiple attributes are saved.
[0009] The component attribute processing method provided by this invention first determines a first rule, which includes multiple attribute information. That is, it first determines the attribute information to be added. Then, according to the first rule, it adds multiple attributes to multiple target components among multiple preset components. The multiple preset components are used for automated testing. In other words, it determines the components to which attributes are to be added, i.e., multiple target components, according to the first rule, and adds attributes to them. Both the preset components and the target components are used for automated testing. After the attributes are added, it generates multiple identity codes based on the multiple target components after adding multiple attributes. That is, it adds identity codes to the target components to which attributes are added, and adds multiple attributes to the multiple identity codes. That is, it adds the attribute pages of the target components to the corresponding identity codes. Then, it submits the multiple identity codes with added attributes, thereby saving the identity codes after the attributes are added.
[0010] The component attribute processing method of the present invention, by configuring a first rule, realizes the automatic addition of target component attributes and further realizes the generation of the target component's attribute-based identification code. While ensuring the uniqueness of the generated identification code of the target component, it avoids the need for manual addition of identification codes, reduces the workload of manual addition of identification codes, avoids the errors that may occur when manually adding identification codes, and increases the accuracy of the identification code corresponding to the target component.
[0011] Furthermore, the first rule can be configured on a tool used to add attributes to the target component. The tool can add the corresponding attributes to the target component according to the configured first rule and generate an identity code corresponding to the target component.
[0012] The method for processing the component properties according to the present invention may further have the following technical features:
[0013] In the above technical solution, the first rule includes: field information of the attribute to be added, name information of the target component to be added, range information of the attribute to be added, and indication information of the attribute value.
[0014] In this technical solution, the first rule is further defined. Specifically, the field information of the attribute to be added indicates the specific location where the attribute will be added; the name information of the target component to be added indicates the specific name of the component to which the attribute will be added; the range information of the attribute to be added indicates the specific range of the attribute to be added. Since the range of the target component to which the attribute needs to be added may change when performing a specific test task, it is necessary to further define the range of the addition according to the user's instructions; the attribute value indication information indicates the information represented by the specific attribute value. Through the above information, the specific attributes of the specific target component can be added, increasing the accuracy of attribute addition.
[0015] In any of the above technical solutions, adding multiple attributes to multiple target components among multiple preset components according to the first rule specifically includes: determining multiple target components among multiple preset components based on the range information of the attributes to be added and the name information of the target components to be added; determining the state information of each target component among the multiple target components, and dividing the multiple target components into multiple first target components and multiple second target components; adding attributes to multiple first target components according to the first adding method; and adding attributes to multiple second target components according to the second adding method.
[0016] In this technical solution, the attribute addition process is further defined. Specifically, after determining the first rule, the target component to which the attribute is to be added is first determined. Specifically, the specific scope of the target component to which the attribute is to be added, as well as the name information of the target component, are determined. This allows the target component to be selected from multiple preset components within the defined scope based on its specific name. Once the target component is determined, it is divided into two categories based on its different states, and attributes are added to these target components using different addition methods.
[0017] Specifically, the second target component can be a third-party component. Since automated testing may involve referencing third-party components, and the fields within these components are not publicly known, it's impossible to directly add properties to them.
[0018] In any of the above technical solutions, adding attributes to multiple first target components according to the first addition method specifically includes: splitting any one of the multiple first target components sequentially according to a preset algorithm to obtain multiple first target fields; comparing the multiple first target fields with the field information of the attribute to be added; when the multiple first target fields match the field information of the attribute to be added, adding attributes to the multiple first target fields according to the indication information of the attribute value.
[0019] This technical solution further defines the process of adding components. Specifically, firstly, multiple first target components are split using a preset algorithm, that is, the first target components are divided into different fields, i.e., multiple first target fields, and compared with the field information of the attribute to be added. When multiple first target fields match the field information of the attribute to be added, it is determined that the first target field at this time is the field for which an attribute needs to be added. At this point, according to the attribute value indication information, that is, the description information of the attribute value, the corresponding attribute is added to the first target field. It should be noted that the same field is configured with the same attribute.
[0020] In any of the above technical solutions, adding attributes to multiple second target components according to the second adding method specifically includes: setting multiple preset models for multiple second target components and placing multiple second target components into multiple preset models; adding the field information of the attributes to be added and the indication information of the attribute values to the multiple preset models.
[0021] In this technical solution, when the target component is a second target component, i.e. a third-party component, it is necessary to first set up a model for the third-party component. By adding attributes to the model, the third-party component within the model also adds corresponding attributes. Specifically, multiple second target components are placed into multiple preset models, and the field information of the attributes to be added and the indication information of the attribute values are added to the multiple preset models, so that the corresponding target fields in the second target components within the preset models can also be run through the added attributes.
[0022] Furthermore, by observing the attributes added by the preset model after receiving the field information of the attribute to be added and the indication information of the attribute value, it can be determined which fields in the second target component need to have attributes added.
[0023] In any of the above technical solutions, the submission process for multiple first codes after adding multiple attributes specifically includes: saving multiple first codes to a first repository, whereby the first repository is used to store multiple first codes after each attribute is added.
[0024] In this technical solution, the submission process of the first code is further restricted. Specifically, after obtaining the first code for adding attributes, multiple first codes are saved to the first repository as the iteration result of the target component after adding attributes. The first repository saves the first code after each attribute addition. In this way, when an error occurs in the process of adding attributes to the target component, the target component can be restored to the state before the last attribute addition or the state before the attribute addition by using the multiple first codes after the attribute addition saved in the first repository, thus ensuring the smooth operation of the target component.
[0025] In any of the above technical solutions, the component attribute processing method further includes: when multiple first target fields do not match the field information of the attribute to be added, splitting multiple first target components according to a preset algorithm to obtain multiple first target fields, and adding attributes to multiple first target fields according to the attribute value indication information.
[0026] In this technical solution, when multiple first target fields in a first target component do not match the field information of the attribute to be added, it indicates that the current splitting failed to find the field for the attribute to be added. At this point, a preset algorithm is used to re-split the other first target components until each first target component has been split, resulting in multiple new first target fields. The splitting process ends, and the attribute is added to the newly obtained multiple first target fields according to the attribute value indication information. By splitting each first target component to find the field for the attribute to be added, the accuracy of the addition is increased, and the probability of incorrect addition is reduced.
[0027] According to a second aspect of the present invention, a component attribute processing apparatus is provided, comprising: a determining unit for determining a first rule; a processing unit for adding multiple attributes to multiple target components among multiple preset components according to the first rule; the processing unit is further configured to: generate multiple first codes based on the multiple target components after adding multiple attributes, and add multiple attributes to the multiple first codes; and submit the multiple first codes after adding multiple attributes.
[0028] The component attribute processing apparatus provided by this invention determines a first rule through a determining unit. The first rule includes multiple attribute information, that is, it first determines the attribute information to be added. Then, the processing unit adds multiple attributes to multiple target components among multiple preset components according to the first rule. The multiple preset components are used for automated testing. In other words, it determines the components to which attributes are to be added, i.e., multiple target components, according to the first rule and adds attributes to them. Both the preset components and the target components are used for automated testing. After the attributes are added, the processing unit generates multiple identity codes based on the multiple target components after adding multiple attributes. That is, it adds identity codes to the target components for which attributes are added and adds multiple attributes to the multiple identity codes. That is, it adds the attribute pages of the target components to the corresponding identity codes. Then, it submits the multiple identity codes with added attributes, thereby saving the identity codes after the attributes are added.
[0029] The component attribute processing apparatus of the present invention determines a first rule through a determining unit and configures the first rule for multiple target components through a processing unit, thereby realizing the automatic addition of target component attributes and further realizing the generation of identity codes with attributes for target components. While ensuring the uniqueness of the generated identity codes of target components, it avoids the need for manual addition of identity codes, reduces the workload of manual addition of identity codes, avoids errors that may occur when manually adding identity codes, and increases the accuracy of the identity codes corresponding to target components.
[0030] According to another aspect of the present invention, a component attribute processing system is provided, comprising a memory storing a program; and a processor that, when executing the program, implements the component attribute processing method as described in any of the above technical solutions.
[0031] The component attribute processing system provided by this invention includes a memory and a processor. The memory stores a program; the processor is connected to the memory and executes the program, implementing the component attribute processing method as described in any of the above technical solutions when the processor executes the program. Therefore, it possesses all the beneficial effects of the component attribute processing method as described in any of the above technical solutions.
[0032] According to another aspect of the present invention, a readable storage medium is provided on which a program is stored, which, when executed by a processor, implements a method for processing component attributes as described in any of the above-described technical solutions.
[0033] The readable storage medium provided by the present invention is used to store a program that, when executed by a processor, implements the component attribute processing method as described in any of the above technical solutions, and therefore has all the beneficial effects of the component attribute processing method as described in any of the above technical solutions.
[0034] Additional aspects and advantages of the invention will become apparent in the following description or may be learned by practice of the invention. Attached Figure Description
[0035] The above and / or additional aspects and advantages of the present invention will become apparent and readily understood from the description of the embodiments taken in conjunction with the following drawings, in which:
[0036] Figure 1 This is a flowchart illustrating one of the component attribute processing methods according to an embodiment of the present invention;
[0037] Figure 2 This is a second flowchart illustrating a method for processing component attributes according to an embodiment of the present invention;
[0038] Figure 3 The third flowchart illustrates the component attribute processing method according to an embodiment of the present invention;
[0039] Figure 4 The fourth flowchart illustrates the component attribute processing method according to an embodiment of the present invention.
[0040] Figure 5 The fifth flowchart illustrates a method for processing component attributes according to an embodiment of the present invention.
[0041] Figure 6 This is a sixth flowchart illustrating a method for processing component attributes according to an embodiment of the present invention;
[0042] Figure 7 The seventh flowchart illustrates a method for processing component attributes according to an embodiment of the present invention.
[0043] Figure 8 A structural block diagram of a component attribute processing apparatus according to an embodiment of the present invention is shown. Detailed Implementation
[0044] To better understand the above-mentioned objectives, features, and advantages of the present invention, the present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted that, unless otherwise specified, the embodiments of the present invention and the features thereof can be combined with each other.
[0045] Many specific details are set forth in the following description in order to provide a full understanding of the invention. However, the invention may also be practiced in other ways different from those described herein, and therefore the scope of protection of the invention is not limited to the specific embodiments disclosed below.
[0046] The following reference Figures 1 to 8 This invention describes a method, apparatus, system, and readable storage medium for processing component attributes according to some embodiments of the present invention.
[0047] Example 1:
[0048] One embodiment of the present invention proposes a method for processing component attributes. Figure 1 A flowchart illustrating one of the component attribute processing methods according to an embodiment of this application is shown, such as... Figure 1 As shown, the methods for handling component properties include:
[0049] Step 102, determine the first rule;
[0050] Step 104: Add multiple attributes to multiple target components among multiple preset components according to the first rule;
[0051] Step 106: Generate multiple identity codes based on the multiple target components after adding multiple attributes, and add multiple attributes to the multiple identity codes;
[0052] Step 108: Submit the multiple identity codes after adding multiple attributes.
[0053] Among them, multiple preset components are used for automated testing. By submitting multiple identity codes, multiple identity codes with multiple attributes can be saved.
[0054] In this embodiment of the application, a first rule is first determined, which includes multiple attribute information. That is, the attribute information to be added is first determined. Then, multiple attributes are added to multiple target components among multiple preset components according to the first rule. The multiple preset components are used for automated testing. That is, the components to which attributes are to be added, i.e., multiple target components, are determined according to the first rule, and attributes are added to them. Both the preset components and the target components are used for automated testing.
[0055] After adding attributes, multiple identity codes are generated based on the multiple target components with added attributes. This means adding identity codes to the target components with added attributes, and adding multiple attributes to multiple identity codes. In other words, the attribute pages of the target components are added to the corresponding identity codes. Then, the multiple identity codes with added attributes are submitted, thereby saving the identity codes after this attribute addition.
[0056] The component attribute processing method in this application embodiment automatically adds target component attributes by configuring a first rule, and further generates an identity code for the target component with attributes. While ensuring the uniqueness of the generated identity code for the target component, it avoids manual addition of the identity code, reduces the workload of manual addition, avoids errors that may occur when manually adding the identity code, and increases the accuracy of the identity code corresponding to the target component.
[0057] Furthermore, the first rule can be configured on a tool used to add attributes to the target component. The tool can add the corresponding attributes to the target component according to the configured first rule and generate an identity code corresponding to the target component.
[0058] Furthermore, the first rule includes: field information of the attribute to be added, name information of the target component to be added, range information of the attribute to be added, and indication information of the attribute value.
[0059] In this embodiment, the first rule is further defined. Specifically, the field information of the attribute to be added indicates the specific location where the attribute will be added; the name information of the target component to be added indicates the specific name of the component to which the attribute will be added; the range information of the attribute to be added indicates the specific range of the attribute to be added. Since the range of the target component to which the attribute needs to be added may change when performing a specific test task, it is necessary to further define the range of the addition according to the user's instructions; the indication information of the attribute value indicates the information represented by the specific attribute value. With the above information, the specific attribute of the specific target component can be added, increasing the accuracy of the attribute addition.
[0060] For example, the field information for which attributes are to be added can be represented in code as follows:
[0061] attribute:'fieldid'
[0062] Where, attribute is the attribute; fieldid is the identifier of a field;
[0063] The range of attributes to be added is represented in code as follows:
[0064] globby:['src / ** / *.vue','src / ** / *.js','src / ** / *.jsx','src / ** / *.tsx'],
[0065] Among them, vue, js, jx and tsx represent different scripting languages;
[0066] The name of the target component to be added is represented in code as follows:
[0067] elements:{
[0068] 'img':'***_img',
[0069] 'iframe':'***_iframe',
[0070] Here, elements represent elements, img is an image format, and iframe is an HTML tag;
[0071] Furthermore, the specific form elements are:
[0072] 'checkbox':'***_checkbox',
[0073] 'radio':'***_radio',
[0074] 'button':'***_btn'
[0075] 'input':'***_input',
[0076] Among them, checkbox represents a checkbox; radio represents a radio button; button represents a button; and input represents a text box control.
[0077] Example 2
[0078] An embodiment of the present invention provides a method for processing component attributes, such as... Figure 2 As shown, the methods for handling component properties include:
[0079] Step 202, determine the first rule;
[0080] Step 204: Based on the range of attributes to be added and the name of the target component to be added, determine multiple target components from multiple preset components;
[0081] Step 206: Determine the state information of each target component among the multiple target components, and divide the multiple target components into multiple first target components and multiple second target components;
[0082] Step 208: Add attributes to multiple first target components according to the first addition method;
[0083] Step 210: Add attributes to multiple second target components according to the second addition method;
[0084] Step 212: Generate multiple identity codes based on the multiple target components after adding multiple attributes, and add multiple attributes to the multiple identity codes;
[0085] Step 214: Submit the multiple identity codes after adding multiple attributes.
[0086] In this embodiment, the process of adding attributes is further defined. After the first rule is determined, the target component to which the attribute is to be added is first determined.
[0087] Specifically, the scope of the target component to which the attribute is to be added, as well as the name of the target component, are determined. This allows us to identify the target component from among several preset components within the defined scope based on its specific name. Once the target component is identified, it is categorized into two types based on its different states, and attributes are added to these target components using different methods.
[0088] Specifically, the second target component can be a third-party component. Since automated testing may involve referencing third-party components, and the fields within these components are not publicly known, it's not possible to directly add properties to them. Therefore, alternative methods are needed to add properties to third-party components.
[0089] Example 3
[0090] An embodiment of the present invention provides a method for processing component attributes, such as... Figure 3 As shown, the methods for handling component properties include:
[0091] Step 302, determine the first rule;
[0092] Step 304: Based on the range of attributes to be added and the name of the target component to be added, determine multiple target components from multiple preset components;
[0093] Step 306: Determine the state information of each target component among the multiple target components, and divide the multiple target components into multiple first target components and multiple second target components;
[0094] Step 308: According to the preset algorithm, any one of the multiple first target components is split sequentially to obtain multiple first target fields;
[0095] Step 310: Compare the multiple first target fields with the field information of the attributes to be added;
[0096] Step 312: When multiple first target fields match the field information of the attribute to be added, add the attribute to the multiple first target fields according to the indication information of the attribute value;
[0097] Step 314: Add attributes to multiple second target components according to the second addition method;
[0098] Step 316: Generate multiple identity codes based on the multiple target components after adding multiple attributes, and add multiple attributes to the multiple identity codes;
[0099] Step 318: Submit the multiple identity codes after adding multiple attributes.
[0100] In this embodiment, the process of adding components is further defined. Specifically, firstly, multiple first target components are split using a preset algorithm, that is, the first target components are divided into different fields, i.e., multiple first target fields, and compared with the field information of the attribute to be added. When multiple first target fields match the field information of the attribute to be added, it is determined that the first target field at this time is the field for which an attribute needs to be added. At this point, according to the indication information of the attribute value, that is, the description information of the attribute value, the corresponding attribute is added to the first target field. It should be noted that the same field is configured with the same attribute.
[0101] Specifically, the splitting method is AST (Abstract Syntax Tree), which can scan the splitting objects one by one and integrate related objects. When splitting the first target component, multiple different fields can be generated.
[0102] Example 4
[0103] An embodiment of the present invention provides a method for processing component attributes, such as... Figure 4 As shown, the methods for handling component properties include:
[0104] Step 402, determine the first rule;
[0105] Step 404: Based on the range of attributes to be added and the name of the target component to be added, determine multiple target components from multiple preset components;
[0106] Step 406: Determine the state information of each target component among the multiple target components, and divide the multiple target components into multiple first target components and multiple second target components;
[0107] Step 408: Add attributes to multiple first target components according to the first addition method;
[0108] Step 410: Set multiple preset models for multiple second target components, and put the multiple second target components into the multiple preset models;
[0109] Step 412: Add the field information of the attributes to be added and the indication information of the attribute values to multiple preset models;
[0110] Step 414: Generate multiple identity codes based on the multiple target components after adding multiple attributes, and add multiple attributes to the multiple identity codes;
[0111] Step 416: Submit the multiple identity codes after adding multiple attributes.
[0112] In this embodiment, when the target component is a second target component, i.e. a third-party component, it is necessary to first set up a model for the third-party component. By adding attributes to the model, the third-party component within the model also adds corresponding attributes. Specifically, multiple second target components are placed into multiple preset models, and the field information of the attributes to be added and the indication information of the attribute values are added to the multiple preset models, so that the target fields in the second target components within the preset models can also be run through the added attributes.
[0113] Furthermore, by observing the attributes added by the preset model after receiving the field information of the attribute to be added and the indication information of the attribute value, it can be determined which fields in the second target component need to have attributes added.
[0114] Example 5
[0115] An embodiment of the present invention provides a method for processing component attributes, such as... Figure 5 As shown, the methods for handling component properties include:
[0116] Step 502, determine the first rule;
[0117] Step 504: Add multiple attributes to multiple target components among multiple preset components according to the first rule;
[0118] Step 506: Generate multiple identity codes based on the multiple target components after adding multiple attributes, and add multiple attributes to the multiple identity codes;
[0119] Step 508: Save multiple identity codes to the first repository.
[0120] In this embodiment, the submission process of the first code is further defined. Specifically, after obtaining the first code for adding attributes, multiple first codes are saved to the first repository as the iteration result of the target component after adding attributes this time. The first repository saves the first code for adding attributes after each attribute addition. In this way, when an error occurs in the process of adding attributes to the target component, the target component can be restored to the state of the last attribute addition or the state before the attribute addition by using the multiple first codes for adding attributes saved in the first repository, thus ensuring the smooth operation of the target component.
[0121] For example, the first repository is a git repository (git is a version control system used for saving, developing and managing code).
[0122] Example 6
[0123] An embodiment of the present invention provides a method for processing component attributes, such as... Figure 6 As shown, the methods for handling component properties include:
[0124] Step 602, determine the first rule;
[0125] Step 604: Based on the range of attributes to be added and the name of the target component to be added, determine multiple target components from multiple preset components;
[0126] Step 606: Determine the state information of each target component among the multiple target components, and divide the multiple target components into multiple first target components and multiple second target components;
[0127] Step 608: According to the preset algorithm, any one of the multiple first target components is split sequentially to obtain multiple first target fields;
[0128] Step 610: Compare the multiple first target fields with the field information of the attributes to be added;
[0129] Step 612: When multiple first target fields match the field information of the attribute to be added, add the attribute to the multiple first target fields according to the indication information of the attribute value;
[0130] Step 614: When multiple first target fields do not match the field information of the attribute to be added, split any one of the multiple first target components that has not been split in turn to obtain multiple first target fields, and add attributes to the multiple first target fields according to the attribute value indication information.
[0131] Step 616: Add attributes to multiple second target components according to the second addition method;
[0132] Step 618: Generate multiple identity codes based on the multiple target components after adding multiple attributes, and add multiple attributes to the multiple identity codes;
[0133] Step 620: Submit the multiple identity codes after adding multiple attributes.
[0134] In this embodiment, when multiple first target fields in a first target component do not match the field information of the attribute to be added, it indicates that the current splitting failed to find the field for the attribute to be added. At this point, a preset algorithm is used to re-split the other first target components until each first target component has been split, resulting in multiple new first target fields. The splitting process ends, and the attribute is added to the newly obtained multiple first target fields according to the attribute value indication information. By splitting each first target component to find the field for the attribute to be added, the accuracy of the addition is increased, and the probability of incorrect addition is reduced.
[0135] Example 7
[0136] An embodiment of the present invention provides a method for processing component attributes, such as... Figure 7 As shown, the methods for handling component properties include:
[0137] Step 702, set up the processing module;
[0138] Step 704: Configure the field information of the attribute to be added, the name information of the target component to be added, and the indication information of the attribute value respectively;
[0139] Step 706: Control the execution node of the processing module;
[0140] Step 708: Split multiple preset components according to a preset algorithm to obtain multiple preset fields;
[0141] Step 710: Determine whether the preset fields meet the field information of the attribute to be added;
[0142] Step 712: Generate the corresponding identity code according to the preset fields, and add attributes to the identity code according to the attribute value indication information;
[0143] Step 714: Submit the identity code after adding attributes.
[0144] In this embodiment, a processing module is first set up, and specific attribute rules are configured in the first module. Specifically, the attribute rules include: field information of the attribute to be added, name information of the target component to be added, and indication information of the attribute value. After these attribute rules are configured in the processing module, the processing module will execute these rules.
[0145] Subsequently, multiple preset components are split according to a preset algorithm. That is, after scanning multiple preset components, they are split into the smallest unit objects, and then multiple related smallest unit objects are integrated to generate multiple different preset fields.
[0146] When multiple different preset fields are generated, the processing module compares the field information of the configured attribute to be added with the field information of the preset fields. When the field information of the attribute to be added is the same as the field information of the preset fields, the processing module filters it out. When they do not match, the unsplit components are split and compared again, and finally multiple preset fields are obtained.
[0147] Subsequently, a unique identification code is generated for each of the multiple preset fields to identify the preset field. Attributes are then added to the identification code based on the attribute values. Since each identification code corresponds to a different field and component, after submitting the identification code with added attributes, the processing module adds the attributes configured for the identification code to the corresponding preset fields and components. This achieves the configuration of component attributes.
[0148] Example 8
[0149] Another embodiment of the present invention provides a component attribute processing apparatus 800. Figure 8 A structural block diagram of a component attribute processing apparatus 800 according to an embodiment of this application is shown, such as... Figure 8 As shown, the component attribute processing device 800 includes: a determining unit 802 for determining a first rule; a processing unit 804 for adding multiple attributes to multiple target components among multiple preset components according to the first rule; the processing unit 804 is further configured to: generate multiple first codes based on the multiple target components after adding multiple attributes, and add multiple attributes to the multiple first codes; and submit the multiple first codes after adding multiple attributes.
[0150] The component attribute processing apparatus provided by the present invention determines a first rule through a determining unit 802. The first rule includes multiple attribute information. That is, the attribute information to be added is first determined. Then, the processing unit 804 adds multiple attributes to multiple target components among multiple preset components according to the first rule. The multiple preset components are used for automated testing. That is, the components to which attributes are to be added, i.e., multiple target components, are determined according to the first rule, and the attributes are added to them. Both the preset components and the target components are used for automated testing.
[0151] After the attributes are added, the processing unit 804 generates multiple identity codes based on the multiple target components after adding multiple attributes. That is, it adds identity codes to the target components for which attributes are added, and adds multiple attributes to multiple identity codes. In other words, it adds the attribute pages of the target components to the corresponding identity codes. Then, it submits the multiple identity codes with added attributes, thereby saving the identity codes after the attributes are added.
[0152] The component attribute processing apparatus of the present invention determines a first rule through a determining unit 802 and configures the first rule for multiple target components through a processing unit 804, thereby realizing the automatic addition of target component attributes and further realizing the generation of an identity code with attributes for the target component. While ensuring the uniqueness of the generated identity code of the target component, it avoids the need for manual addition of identity codes, reduces the workload of manual addition of identity codes, avoids errors that may occur when manually adding identity codes, and increases the accuracy of the identity code corresponding to the target component.
[0153] Example 9
[0154] Another embodiment of the present invention provides a component attribute processing system, which includes a memory storing a program; and a processor that executes the program to implement the component attribute processing method as described in any of the above embodiments.
[0155] The component attribute processing system provided in this application includes a memory and a processor. The memory stores a program; the processor is connected to the memory and executes the program, implementing the component attribute processing method as described in any of the above embodiments when executing the program. Therefore, it possesses all the beneficial effects of the component attribute processing method as described in any of the above technical solutions, which will not be elaborated further here.
[0156] Example 10
[0157] Another embodiment of the present invention provides a readable storage medium on which a program is stored, which, when executed by a processor, implements a method for processing component attributes as described in any of the above technical solutions.
[0158] The readable storage medium provided in this application embodiment is used to store a program that, when executed by a processor, implements the component attribute processing method as described in any of the above technical solutions. Therefore, it has all the beneficial effects of the component attribute processing method as described in any of the above technical solutions, which will not be repeated here.
[0159] In the description of this specification, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance, unless otherwise expressly specified and limited. The terms "connection," "installation," and "fixing," etc., should be interpreted broadly. For example, "connection" can mean a fixed connection, a detachable connection, or an integral connection; it can mean a direct connection or an indirect connection through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms in this invention according to the specific circumstances.
[0160] In the description of this specification, the terms "one embodiment," "some embodiments," "specific embodiment," etc., refer to a specific feature, structure, material, or characteristic described in connection with that embodiment or example, which is included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples.
[0161] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. A method for processing component attributes, characterized in that, include: Determine a first rule, which includes multiple attribute information; According to the first rule, multiple attributes are added to multiple target components among multiple preset components, and the multiple preset components are used for automated testing; Multiple identity codes are generated based on the multiple target components after adding the multiple attributes, and multiple attributes are added to the multiple identity codes; Submit the multiple identity codes after adding the multiple attributes so that the multiple identity codes after adding the multiple attributes are saved; The first rule includes: field information of the attribute to be added, name information of the target component to be added, range information of the attribute to be added, and indication information of the attribute value; The field information of the attribute to be added indicates the specific location where the attribute will be added, the name information of the target component to which the attribute will be added indicates the specific name of the component to which the attribute will be added, and the range information of the attribute to be added indicates the specific range within which the attribute will be added. The step of adding multiple attributes to multiple target components among multiple preset components according to the first rule specifically includes: Based on the range information of the attribute to be added and the name information of the target component to be added, the plurality of target components are determined from the plurality of preset components; Determine the state information of each of the plurality of target components, and divide the plurality of target components into a plurality of first target components and a plurality of second target components; the second target components are third-party components. Add attributes to the plurality of first target components according to the first addition method; Add attributes to the plurality of second target components according to the second addition method.
2. The method for processing component attributes according to claim 1, characterized in that, The step of adding attributes to the plurality of first target components according to the first adding method specifically includes: According to a preset algorithm, any one of the plurality of first target components is split sequentially to obtain a plurality of first target fields; Compare the plurality of first target fields with the field information of the attribute to be added; When the plurality of first target fields match the field information of the attribute to be added, the attribute is added to the plurality of first target fields according to the indication information of the attribute value.
3. The method for processing component attributes according to claim 1, characterized in that, The step of adding attributes to the plurality of second target components according to the second adding method specifically includes: Multiple preset models are set for the multiple second target components, and the multiple second target components are placed into the multiple preset models; The field information of the attribute to be added and the indication information of the attribute value are added to the multiple preset models.
4. The method for processing component attributes according to any one of claims 1 to 3, characterized in that, The submission process for the multiple identity codes after adding the multiple attributes specifically includes: The multiple identity codes are saved to a first repository, which is used to store the multiple identity codes after each attribute is added.
5. The method for processing component attributes according to claim 2, characterized in that, The method for processing component attributes also includes: When the multiple first target fields do not match the field information of the attribute to be added, the multiple first target components that have not undergone the splitting process are split sequentially to obtain multiple first target fields, and attributes are added to the multiple first target fields according to the indication information of the attribute value.
6. A component attribute processing apparatus, used to implement the component attribute processing method as described in any one of claims 1 to 5, characterized in that, include: The determining unit is used to determine the first rule; The processing unit is configured to add multiple attributes to multiple target components among multiple preset components according to the first rule; The processing unit is also used for: Multiple identity codes are generated based on the multiple target components after adding the multiple attributes, and multiple attributes are added to the multiple identity codes; Submit the multiple identity codes after adding the multiple attributes.
7. A component attribute processing system, characterized in that, include: A memory, wherein the memory stores a program; A processor, which, when executing the program, implements the method for processing component attributes as described in any one of claims 1 to 5.
8. A readable storage medium having a program stored thereon, characterized in that, When the program is executed by the processor, it implements the component attribute processing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Label generation method and device of user interface control, equipment and storage medium
CN114764388A