Auxiliary technology simulation method and device suitable for RPA test scene
By obtaining the simulated element tree and exporting snapshot data, a second target class consistent with the target class is created, which solves the problem that AT-SPI technology unit testing in RPA scenarios requires a real environment, and realizes the positioning and picking element functions in simulated scenarios. , improving the stability and efficiency of testing.
Patent Information
- Application Number
- CN202410692288.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-30
- Publication Date
- 2024-08-23
AI Technical Summary
In RPA scenarios, unit testing of AT-SPI technology requires a real environment, resulting in unstable testing and the need to frequently run applications, making it impossible to position and pick up elements in simulated scenarios.
By obtaining the simulation element tree, exporting the snapshot data, and creating a second target class consistent with the target class, the target element is found from the snapshot data to implement simulation testing and avoid relying on the real environment.
It realizes auxiliary technology simulation without the need for real environment in RPA test scenarios, improves the stability and reliability of positioning and picking up elements, and reduces the number of repeated test runs.
Smart Images

Figure CN118535472A
Abstract
Description
Technical Field
[0001] The present application relates to the field of computer technology, and in particular to an auxiliary technology simulation method and device suitable for RPA testing scenarios. Background Art
[0002] Usually, in RPA scenarios, assistive services are provided through assistive technology. In general, assistive services are provided through AT-SPI technology to achieve the core functions of positioning and picking up elements. AT-SPI technology (Assistive Technology Service Prov Identifier Interface) is a platform-independent framework used to provide two-way communication between assistive technology (AT) and applications. The implementation of these core functions involves multiple core classes, such as the Accessible class used to represent the type of element attributes. However, some core classes come from the bottom layer of the operating system and cannot be instantiated and modified through code. Therefore, it is impossible to directly create instances in unit testing to complete unit testing. In the actual process of positioning and picking up elements, it will cause dependence on some core classes.
[0003] In the related art, in order to improve the stability and reliability of core functions such as positioning and picking elements, unit testing is used to verify the picking function of AT-SPI. However, the AT-SPI mechanism must rely on the real environment, and the application to be tested needs to be rerun during each unit test. This method cannot be separated from the real environment and requires a large number of repeated runs. Summary of the invention
[0004] The present application aims to solve one of the technical problems in the related art at least to some extent.
[0005] To this end, the first purpose of this application is to propose an assistive technology simulation method suitable for RPA test scenarios, so as to realize the testing of the positioning and picking functions of the assistive technology in the RPA scenario under a simulation scenario.
[0006] The second objective of this application is to propose an assistive technology simulation device suitable for RPA testing scenarios.
[0007] The third objective of the present application is to provide an electronic device.
[0008] A fourth objective of the present application is to provide a computer-readable storage medium.
[0009] A fifth object of the present application is to provide a computer program product.
[0010] To achieve the above-mentioned purpose, the first aspect embodiment of the present application proposes an assistive technology simulation method suitable for RPA testing scenarios, including: obtaining a simulated element tree, wherein the simulated element tree is used to simulate the element tree of the target application obtained by the element picker through the assistive technology service provider interface; exporting the simulated element tree to obtain snapshot data corresponding to the simulated element tree; the element picker determines a first target class used to represent the element node type in the simulated element tree; according to the attributes, method names and parameter definitions of the first target class, creates a second target class that is completely consistent with the first target class, so that the element picker searches from the snapshot data according to the second target class to locate the target element to be picked up in the target application; based on whether the target element is consistent with the element that the RPA expects to pick up, determines the simulation test result.
[0011] To achieve the above-mentioned purpose, the second aspect embodiment of the present application proposes an assistive technology simulation device suitable for RPA testing scenarios, including: a first acquisition module, used to obtain a simulated element tree, wherein the simulated element tree is used to simulate the element tree of the target application obtained by the element picker through the assistive technology service provider interface; an export module, which exports the simulated element tree to obtain snapshot data corresponding to the simulated element tree; a first determination module, used by the element picker to determine a first target class used to represent the element node type in the simulated element tree; a positioning module, used to create a second target class that is completely consistent with the first target class according to the attributes, method names and parameter definitions of the first target class, so that the element picker can search from the snapshot data according to the second target class to locate the target element to be picked up in the target application; a second determination module, used to determine the simulation test result based on whether the target element is consistent with the element that the RPA expects to pick up.
[0012] To achieve the above-mentioned purpose, the third aspect embodiment of the present application proposes an electronic device, comprising: a processor, and a memory communicatively connected to the processor; the memory stores computer-executable instructions; the processor executes the computer-executable instructions stored in the memory to implement the method of the first aspect.
[0013] To achieve the above-mentioned purpose, the fourth aspect of the present application proposes a computer-readable storage medium, in which computer-readable storage medium is stored computer-executable instructions, and the computer-executable instructions are used to implement the method of the first aspect when executed by a processor.
[0014] To achieve the above-mentioned purpose, the fifth aspect of the present application proposes a computer program product, including a computer program, which implements the method of the first aspect when executed by a processor.
[0015] The assistive technology simulation method and device provided in the present application are applicable to RPA test scenarios, and obtain a simulated element tree, wherein the simulated element tree is used to simulate the element tree of the target application obtained by the element picker through the assistive technology service provider interface; the simulated element tree is exported to obtain snapshot data corresponding to the simulated element tree; the element picker determines a first target class used to represent the element node type in the simulated element tree; according to the attributes, method names and parameter definitions of the first target class, a second target class that is completely consistent with the first target class is created, so that the element picker can search from the snapshot data according to the second target class to locate the target element to be picked up in the target application; based on whether the target element is consistent with the element that the RPA expects to pick up, the simulation test result is determined, thereby, by simulating the element tree, there is no need to re-run the application to be tested, and a second target class that is completely consistent with the core first target class in the assistive technology is created, and according to the second target class, it can be searched from the snapshot data to determine the target element to be picked up, without relying on the real environment, and the positioning and picking element functions implemented by the assistive technology in the RPA scenario can be tested in the simulation scenario to achieve the expected effect of picking up elements.
[0016] Additional aspects and advantages of the present application will be given in part in the description below, and in part will become apparent from the description below, or will be learned through the practice of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0017] The above and / or additional aspects and advantages of the present application will become apparent and easily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0018] Figure 1 A flowchart of an assistive technology simulation method applicable to an RPA test scenario provided in an embodiment of the present application;
[0019] Figure 2 A flowchart of another assistive technology simulation method applicable to RPA test scenarios provided in an embodiment of the present application;
[0020] Figure 3 An example diagram of target class combination provided in the embodiment of the present application;
[0021] Figure 4 A schematic diagram of the structure of an assistive technology simulation device suitable for RPA test scenarios provided in an embodiment of the present application;
[0022] Figure 5 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0023] Embodiments of the present application are described in detail below, and examples of the embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals throughout represent the same or similar elements or elements having the same or similar functions. The embodiments described below with reference to the accompanying drawings are exemplary and are intended to be used to explain the present application, and should not be construed as limiting the present application.
[0024] The following describes an auxiliary technology simulation method and device applicable to an RPA test scenario according to an embodiment of the present application with reference to the accompanying drawings.
[0025] Figure 1 A flowchart of an assistive technology simulation method suitable for RPA testing scenarios provided in an embodiment of the present application.
[0026] In RPA scenarios, auxiliary services are provided through auxiliary technologies to implement the core functions of locating and picking elements. The implementation of these core functions involves multiple core classes, such as the Accessible class used to represent the type of element attributes. However, some core classes come from the underlying operating system and cannot be instantiated and modified through code. Therefore, it is impossible to directly create instances in unit tests to complete unit tests. In the actual process of locating and picking elements, some core classes will be relied upon.
[0027] To address this problem, the present application provides an auxiliary technology simulation method suitable for RPA test scenarios, so that the positioning and picking element functions implemented by auxiliary technology in RPA scenarios can be tested in simulated scenarios without relying on a real environment, such as Figure 1 As shown, the assistive technology simulation method applicable to the RPA test scenario includes the following steps:
[0028] Step 101, obtaining a simulated element tree, wherein the simulated element tree is used to simulate the element tree of the target application obtained by the element picker through the assistive technology service provider interface.
[0029] It should be noted that the Assistive Technology Service Provider Interface AT-SPI is a framework for providing assistive technology, which allows applications to interact with assistive technology. The target application can be represented as the application where the element to be picked up by the element picker is located.
[0030] Different applications require different AT-SPI versions or implementations to provide the best assistive technology support. Therefore, in this embodiment, taking this difference into consideration, based on the element tree of the target application obtained by the element picker through the assistive technology service provider interface AT-SPI service, for different applications, the element tree of the application obtained by the corresponding element picker through the assistive technology service provider interface AT-SPI service can be called.
[0031] The simulated element tree is almost identical to the obtained element tree of the target application, wherein the obtained simulated element tree is different for element trees of different target applications.
[0032] Step 102: export the simulation element tree to obtain snapshot data corresponding to the simulation element tree.
[0033] Obtain the top-level element in the simulation element tree; based on the simulation element tree, create a third target class for representing the hierarchical relationship of each element node in the simulation element tree and a fourth target class for mapping each element node; according to the third target class and the fourth target class, recursively perform each element node under the top-level element to determine the parent-child relationship between each element node; export snapshot data according to each element node and the parent-child relationship between each element node.
[0034] The top-most element in the simulation element tree is the top-level element node of the simulation element tree.
[0035] For example, there are element node A and element node B. Assuming that element node A is the parent node of element node B and element node B is the child node of element node A, a parent-child relationship exists between element node A and element node B.
[0036] As an example, according to the third target class and the fourth target class, recursively perform each element node under the top-level element, and the specific steps of determining the parent-child relationship between each element node may include: according to the fourth target class, automatically generate a unique identifier for each element node, and fill in attributes for each element node; according to the third target class, determine the identifier of the parent element node corresponding to each element node under the top-level element; determine the parent-child relationship between each element node based on the identifier of each element node and the identifier of the parent element node corresponding to each element node.
[0037] It should be noted that the created fourth target class and the key attributes and methods of the fourth target class are shown in Table 1:
[0038] Table 1
[0039]
[0040]
[0041] In this example, each element node is recursively processed, and the identifier of each element node and the identifier of the parent element node corresponding to each element node are added to the node list one by one, until all element nodes under the top-level element are recursively processed, and the snapshot data is determined according to the node list.
[0042] According to the identifier of each element node, the corresponding element node can be located, and according to the identifier of the parent element node corresponding to each element node, the parent element node of the element node can be located.
[0043] Step 103: determine a first target class for representing an element node type in a simulation element tree.
[0044] It can be understood that the simulation element tree includes various element nodes, types of each element node and various attributes of the element.
[0045] The first target class is used by auxiliary technology to represent the element node type in the simulated element tree.
[0046] For example, the Accessible class used to represent element nodes in the assistive technology AT-SPI comes from the underlying operating system and cannot be instantiated or modified.
[0047] Step 104, based on the properties, method names and parameter definitions of the first target class, create a second target class that is completely consistent with the first target class, so that the element picker can search from the snapshot data based on the second target class to locate the target element to be picked up in the target application.
[0048] It should be noted that the identifier of the element node is obtained from the snapshot data, and the target element to be picked up in the target application is located through the identifier of the element node.
[0049] It should be noted that the first target class comes from the bottom layer of the operating system and cannot be directly instantiated and modified. In order to avoid dependence on the first target class in the process of positioning and picking up elements through AT-SPI auxiliary technology in the RPA scenario, a second target class that is completely consistent with the first target class can be created.
[0050] It can be understood that the properties, method names and parameter definitions of the second target class are completely consistent with those of the first target class.
[0051] In some instances, if the element picker locates the target element to be picked up in the target application, finds the target element through identification, and the system prompts that the target element is located and picked up successfully. If the element picker does not locate the target element to be picked up in the target application, the system prompts that the target element is located and picked up unsuccessfully.
[0052] Step 105 , determining a simulation test result based on whether the target element is consistent with the element that the RPA expects to pick up.
[0053] In some examples, based on the target elements, it is determined whether the number of target elements is consistent with the number of elements that the RPA expects to pick up, and it is determined whether the type and various attributes of the target elements are consistent with the type and various attributes of the elements that the RPA expects to pick up. If they are completely consistent, the simulation test result is returned, wherein the simulation test result can be used to indicate that the simulation test is successful, and the positioning and element picking functions implemented in the RPA scenario through AT-SPI auxiliary technology are reliable and stable.
[0054] Correspondingly, if they are not completely consistent, the simulation test result is returned, wherein the simulation test result can be used to indicate that the simulation test has failed. The positioning and element picking functions implemented by AT-SPI auxiliary technology in the RPA scenario are not reliable and stable yet and still need to be improved.
[0055] The assistive technology simulation method applicable to the RPA test scenario provided in the present application obtains a simulated element tree, wherein the simulated element tree is used to simulate the element tree of the target application obtained by the element picker through the assistive technology service provider interface; the simulated element tree is exported to obtain snapshot data corresponding to the simulated element tree; the element picker determines a first target class used to represent the element node type in the simulated element tree; according to the attributes, method names and parameter definitions of the first target class, a second target class that is completely consistent with the first target class is created, so that the element picker can search from the snapshot data according to the second target class to locate the target element to be picked up in the target application; based on whether the target element is consistent with the element that the RPA expects to pick up, the simulation test result is determined, thereby, by simulating the element tree, there is no need to re-run the application to be tested, and a second target class that is completely consistent with the core first target class in the assistive technology is created, and according to the second target class, it can be searched from the snapshot data to determine the target element to be picked up, without relying on the real environment, the positioning and element picking functions implemented by the assistive technology in the RPA scenario can be tested in a simulated scenario to achieve the expected effect of picking up elements.
[0056] In the embodiment of the present application, in order to clearly understand that according to the attributes, method names and parameter definitions of the first target class, a second target class that is completely consistent with the first target class is created, so that the element picker can search from the snapshot data according to the second target class to locate the target element to be picked up in the target application, the following is combined with Figure 2 An exemplary description is given of a possible implementation method of creating a second target class that is completely consistent with the first target class based on the properties, method names and parameter definitions of the first target class, so that the element picker can search from the snapshot data based on the second target class to locate the target element to be picked up in the target application. Figure 2A flowchart of another assistive technology simulation method suitable for RPA testing scenarios provided in an embodiment of the present application is provided. This embodiment is a further refinement of the assistive technology simulation method suitable for RPA testing scenarios.
[0057] like Figure 2 As shown, the assistive technology simulation method applicable to the RPA test scenario may include the following steps:
[0058] Step 201, obtaining the attributes of the target element indicated in the picking instruction of the element picker.
[0059] It can be understood that the picking instruction of the element picker includes the attribute of the indicated target element, for example, the attribute of the target element indicated in the picking instruction is the children attribute.
[0060] Step 202, through the attributes of the target element, the element picker accesses each element node in the snapshot data according to the second target class to determine each embodiment created by the fourth target class, wherein each embodiment created by the fourth target class includes element nodes and attributes filled in for each element node.
[0061] It should be noted that each element corresponding to each element node will be created through the fourth target class, including but not limited to an embodiment.
[0062] Step 203: traverse each embodiment created by the fourth target class to determine an element node having the same attribute as the target element.
[0063] In this example, the element node having the same attribute as the target element can be located through the element node identifier.
[0064] Step 204: locate the target element to be picked up in the target application according to the element node having the same attribute as the target element.
[0065] In this embodiment, the attributes of the target element indicated in the picking instruction of the element picker are obtained. Through the attributes of the target element, the element picker accesses each element node in the snapshot data according to the second target class to determine each embodiment created by the fourth target class, wherein each embodiment created by the fourth target class includes an element node and attributes filled in for each element node. The embodiments created by the fourth target class are traversed to determine the element nodes with the same attributes as the target element. According to the element nodes with the same attributes as the target element, the target element to be picked up in the target application is located. Thus, the target element to be picked up in the target application can be located through the second target class. The second target class can be directly instantiated and modified, avoiding dependence on the first target class.
[0066] For example, the target class joint example graph, such as Figure 3 As shown, in order to achieve isolation of the first target class and the second target class at the class level, the first target class and the second target class can also be combined to create a fifth target class. Based on the fifth target class, any one of the first target class and the second target class is selected from the fifth target class, and according to the first target class, or according to the second target class, a search is performed from the snapshot data to determine the target element to be picked up in the target application.
[0067] For example, assuming that the first target class is the Accessible class from the underlying operating system, a second target class MockAccessible class that is completely consistent with the first target class is created based on the properties, method names, and parameter definitions of the Accessible class. The Accessible class and the MockAccessible class are combined to define a new combined fifth target class TAccessible class. When using the TAccessible class, select from the TAccessible class and pass in either the Accessible class or the MockAccessible class, thereby avoiding the direct use of the Accessible class or the MockAccessible class and achieving isolation at the class level.
[0068] In order to implement the above embodiments, the present application also proposes an auxiliary technology simulation device suitable for RPA testing scenarios.
[0069] Figure 4 A schematic diagram of the structure of an assistive technology simulation device suitable for RPA testing scenarios provided in an embodiment of the present application.
[0070] like Figure 4 As shown, the assistive technology simulation device 400 suitable for the RPA test scenario includes: a first acquisition module 401, an export module 402, a first determination module 403, a positioning module 404 and a second determination module 405.
[0071] A first acquisition module 401 is used to acquire a simulated element tree, wherein the simulated element tree is used to simulate the element tree of the target application program obtained by the element picker through the assistive technology service provider interface;
[0072] An export module 402 exports the simulation element tree to obtain snapshot data corresponding to the simulation element tree;
[0073] A first determination module 403, used by the element picker to determine a first target class for representing an element node type in a simulated element tree;
[0074] The positioning module 404 is used to create a second target class that is completely consistent with the first target class according to the attributes, method names and parameter definitions of the first target class, so that the element picker can search from the snapshot data according to the second target class to locate the target element to be picked up in the target application;
[0075] The second determination module 405 is used to determine the simulation test result based on whether the target element is consistent with the element that the RPA expects to pick up.
[0076] In one embodiment of the present application, the export module 402 includes:
[0077] A first acquisition unit 4021 is used to acquire the top-level element in the simulation element tree;
[0078] A first creation unit 4022 is used to create, based on the simulated element tree, a third target class for representing the hierarchical relationship of each element node in the simulated element tree and a fourth target class for mapping each element node;
[0079] The first determining unit 4023 is used to recursively determine the parent-child relationship between the element nodes according to the third target class and the fourth target class for each element node under the top-level element;
[0080] The export unit 4024 is used to export snapshot data according to each element node and the parent-child relationship between each element node.
[0081] In one embodiment of the present application, the first determining unit 4023 is specifically configured to:
[0082] According to the fourth target class, a unique identifier is automatically generated for each element node, and attributes are filled for each element node;
[0083] According to the third target class, determine the identifier of the parent element node corresponding to each element node under the top-level element;
[0084] The parent-child relationship between the element nodes is determined according to the identifier of each element node and the identifier of the parent element node corresponding to each element node.
[0085] In one embodiment of the present application, the second determining module 405 is specifically configured to:
[0086] Get the properties of the target element indicated in the element picker's pick instruction;
[0087] Through the attributes of the target element, the element picker accesses each element node in the snapshot data according to the second target class to determine each embodiment created by the fourth target class, wherein each embodiment created by the fourth target class includes an element node and attributes filled in for each element node;
[0088] Traversing each embodiment created by the fourth target class to determine an element node having the same attribute as the target element;
[0089] The target element to be picked up in the target application is located according to the element node having the same attribute as the target element.
[0090] In one embodiment of the present application, the apparatus further includes a combining module 306, which is specifically configured to:
[0091] Combining the first target class and the second target class to create a fifth target class;
[0092] Based on the fifth target class, selecting any one of the first target class and the second target class from the fifth target class;
[0093] According to the first target class, or according to the second target class, a search is performed from the snapshot data to determine the target element to be picked up in the target application.
[0094] It should be noted that the above explanation of the embodiment of the assistive technology simulation method applicable to the RPA test scenario is also applicable to the assistive technology simulation device applicable to the RPA test scenario of this embodiment, and will not be repeated here.
[0095] The assistive technology simulation device applicable to the RPA test scenario provided by the present application obtains a simulated element tree, wherein the simulated element tree is used to simulate the element tree of the target application obtained by the element picker through the assistive technology service provider interface; the simulated element tree is exported to obtain snapshot data corresponding to the simulated element tree; the element picker determines a first target class used to represent the element node type in the simulated element tree; according to the attributes, method names and parameter definitions of the first target class, a second target class that is completely consistent with the first target class is created, so that the element picker can search from the snapshot data according to the second target class to locate the target element to be picked up in the target application; based on whether the target element is consistent with the element that the RPA expects to pick up, the simulation test result is determined, thereby, by simulating the element tree, there is no need to re-run the application to be tested, and a second target class that is completely consistent with the core first target class in the assistive technology is created, and according to the second target class, it can be searched from the snapshot data to determine the target element to be picked up, without relying on the real environment, the positioning and element picking functions implemented by the assistive technology in the RPA scenario can be tested in a simulated scenario to achieve the expected effect of picking up elements.
[0096] Figure 5 The electronic device in this embodiment may be a terminal device or a server.
[0097] like Figure 5 As shown, the electronic device 500 includes: a memory 501 , a processor 502 , and computer instructions stored in the memory 501 and executable on the processor 502 .
[0098] When the processor 502 executes the instructions, the software testing method provided in the above embodiment is implemented.
[0099] Furthermore, the electronic device 500 further includes:
[0100] The communication interface 503 is used for communication between the memory 501 and the processor 502 .
[0101] The memory 501 is used to store computer instructions that can be executed on the processor 502 .
[0102] The memory 501 may include a high-speed RAM memory, and may also include a non-volatile memory (non-volatile memory), such as at least one disk memory.
[0103] The processor 502 is used to implement the software testing method of the above embodiment when executing the program.
[0104] If the memory 501, the processor 502 and the communication interface 503 are implemented independently, the communication interface 503, the memory 501 and the processor 502 can be connected to each other through a bus and communicate with each other. The bus can be an Industry Standard Architecture (ISA) bus, a Peripheral Component (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 5 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0105] Optionally, in a specific implementation, if the memory 501, the processor 502 and the communication interface 503 are integrated on a chip, the memory 501, the processor 502 and the communication interface 503 can communicate with each other through an internal interface.
[0106] The processor 502 may be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to implement the embodiments of the present application. The electronic device provided in the embodiments of the present application may be the terminal device of the above embodiments.
[0107] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the above embodiments.
[0108] In order to implement the above embodiments, the present application also proposes a computer-readable storage medium, in which computer-executable instructions are stored. When the computer-executable instructions are executed by a processor, they are used to implement the methods provided by the above embodiments.
[0109] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which implements the methods provided by the above embodiments when executed by a processor.
[0110] The collection, storage, use, processing, transmission, provision and disclosure of user personal information involved in this application are in compliance with relevant laws and regulations and do not violate public order and good morals.
[0111] It should be noted that personal information from users should be collected for legitimate and reasonable purposes and should not be shared or sold outside of these legitimate uses. In addition, such collection / sharing should be carried out after receiving the user's informed consent, including but not limited to notifying the user to read the user agreement / user notice and sign the agreement / authorization including authorization of relevant user information before the user uses the function. In addition, any necessary steps should be taken to protect and safeguard access to such personal information data and ensure that others who have access to personal information data comply with its privacy policy and procedures.
[0112] The present application is expected to provide an implementation scheme for users to selectively block the use or access of personal information data. That is, the present disclosure is expected to provide hardware and / or software to prevent or block access to such personal information data. Once the personal information data is no longer needed, the risk can be minimized by limiting data collection and deleting the data. In addition, when applicable, such personal information is de-identified to protect the privacy of the user.
[0113] In the description of the aforementioned embodiments, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" etc. means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representations of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art may combine and combine the different embodiments or examples described in this specification and the features of the different embodiments or examples, without contradiction.
[0114] In addition, the terms "first" and "second" are used for descriptive purposes only and should not be understood as indicating or implying relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of the features. In the description of this application, the meaning of "plurality" is at least two, such as two, three, etc., unless otherwise clearly and specifically defined.
[0115] Any process or method description in a flowchart or otherwise described herein may be understood to represent a module, fragment or portion of code comprising one or more executable instructions for implementing the steps of a custom logical function or process, and the scope of the preferred embodiments of the present application includes alternative implementations in which functions may not be performed in the order shown or discussed, including performing functions in a substantially simultaneous manner or in the reverse order depending on the functions involved, which should be understood by technicians in the technical field to which the embodiments of the present application belong.
[0116] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute the instructions), or in combination with these instruction execution systems, devices or apparatuses. For the purpose of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in combination with these instruction execution systems, devices or apparatuses. More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk box (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), a fiber optic device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium and then editing, interpreting or processing in other suitable ways if necessary, and then stored in a computer memory.
[0117] It should be understood that the various parts of the present application can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc.
[0118] A person skilled in the art may understand that all or part of the steps in the method for implementing the above-mentioned embodiment may be completed by instructing related hardware through a program, and the program may be stored in a computer-readable storage medium, which, when executed, includes one or a combination of the steps of the method embodiment.
[0119] In addition, each functional unit in each embodiment of the present application may be integrated into a processing module, or each unit may exist physically separately, or two or more units may be integrated into one module. The above-mentioned integrated module may be implemented in the form of hardware or in the form of a software functional module. If the integrated module is implemented in the form of a software functional module and sold or used as an independent product, it may also be stored in a computer-readable storage medium.
[0120] The storage medium mentioned above may be a read-only memory, a magnetic disk or an optical disk, etc. Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and cannot be understood as limiting the present application. A person of ordinary skill in the art may change, modify, replace and modify the above embodiments within the scope of the present application.
Claims
1. An assistive technology simulation method suitable for RPA testing scenarios, characterized in that: Testing the element picker required for RPA calls includes the following steps: Acquire a simulated element tree, wherein the simulated element tree is used to simulate the element tree of the target application program obtained by the element picker through an assistive technology service provider interface; Exporting the simulation element tree to obtain snapshot data corresponding to the simulation element tree; The element picker determines a first target class for representing the type of the element node in the simulated element tree; According to the attributes, method names and parameter definitions of the first target class, a second target class is created which is completely consistent with the first target class, so that the element picker searches from the snapshot data according to the second target class to locate the target element to be picked up in the target application; A simulation test result is determined based on whether the target element is consistent with the element that the RPA expects to pick up.
2. The assistive technology simulation method applicable to RPA test scenarios according to claim 1, characterized in that: The exporting of the simulation element tree to obtain snapshot data corresponding to the simulation element tree includes: Get the topmost element in the simulated element tree; Based on the simulated element tree, creating a third target class for representing the hierarchical relationship of each element node in the simulated element tree and a fourth target class for mapping each of the element nodes; According to the third target class and the fourth target class, recursively perform each of the element nodes under the top-level element to determine a parent-child relationship between each of the element nodes; The snapshot data is exported according to the element nodes and the parent-child relationship between the element nodes.
3. The auxiliary technology simulation method applicable to RPA test scenarios according to claim 2 is characterized in that: The step of recursively performing, according to the third target class and the fourth target class, on each of the element nodes under the top-level element to determine the parent-child relationship between each of the element nodes includes: According to the fourth target class, automatically generating a unique identifier for each of the element nodes, and filling attributes for each of the element nodes; Determine, according to the third target class, an identifier of a parent element node corresponding to each of the element nodes under the topmost element; The parent-child relationship between the element nodes is determined according to the identifier of each element node and the identifier of the parent element node corresponding to each element node.
4. The assistive technology simulation method applicable to RPA test scenarios according to claim 2, characterized in that: The step of enabling the element picker to search from the snapshot data according to the second target class to locate the target element to be picked up in the target application program includes: Obtaining the attribute of the target element indicated in the picking instruction of the element picker; Through the attributes of the target element, the element picker accesses each element node in the snapshot data according to the second target class to determine each embodiment created by the fourth target class, wherein each embodiment created by the fourth target class includes the element node and the attributes filled in for each element node; Traversing each embodiment created by the fourth target class to determine the element node having the same attribute as the target element; The target element to be picked up in the target application is located according to the element node having the same attribute as the target element.
5. The assistive technology simulation method applicable to RPA test scenarios according to any one of claims 1 and 4, characterized in that: The method comprises: combining the first target class and the second target class to create a fifth target class; Based on the fifth target class, selecting any one of the first target class and the second target class from the fifth target class; According to the first target class, or according to the second target class, a search is performed from the snapshot data to determine the target element to be picked up in the target application.
6. An assistive technology simulation device suitable for RPA testing scenarios, characterized in that: Testing the element picker required for RPA calls includes the following steps: A first acquisition module is used to acquire a simulated element tree, wherein the simulated element tree is used to simulate the element tree of the target application program obtained by the element picker through an assistive technology service provider interface; An export module exports the simulation element tree to obtain snapshot data corresponding to the simulation element tree; A first determination module, used by the element picker to determine a first target class for representing the element node type in the simulated element tree; A positioning module, used for creating a second target class that is completely consistent with the first target class according to the attributes, method names and parameter definitions of the first target class, so that the element picker can search from the snapshot data according to the second target class to locate the target element to be picked up in the target application; The second determination module is used to determine the simulation test result based on whether the target element is consistent with the element that the RPA expects to pick up.
7. The assistive technology simulation device suitable for RPA test scenarios according to claim 6, characterized in that: The export module comprises: A first acquisition unit, used to acquire the top-level element in the simulation element tree; A first creation unit, configured to create, based on the simulation element tree, a third target class for representing a hierarchical relationship of each element node in the simulation element tree and a fourth target class for mapping each element node; A first determining unit, configured to recursively determine the parent-child relationship between the element nodes according to the third target class and the fourth target class for each element node under the top-level element; The export unit is used to export the snapshot data according to each of the element nodes and the parent-child relationship between the element nodes.
8. An electronic device, characterized in that: include: A processor, and a memory communicatively connected to the processor; The memory stores computer-executable instructions; The processor executes the computer-executable instructions stored in the memory to implement the method according to any one of claims 1 to 5.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer-executable instructions, which are used to implement the method according to any one of claims 1 to 5 when executed by a processor.
10. A computer program product, characterized in that The invention comprises a computer program, which implements the method according to any one of claims 1 to 5 when being executed by a processor.
