A method, apparatus, medium, and program product for automated testing
By using configuration files to convert calls to native test expressions in automated testing, the inflexibility and maintenance issues of existing automated testing methods are resolved, enabling automated testing that can quickly adapt to business needs.
Patent Information
- Application Number
- CN202210066620.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-20
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2042-01-20
AI Technical Summary
Existing automated testing methods lack flexibility, making it difficult to quickly adapt to different business function requirements, and traditional scripts are inconvenient to maintain.
Configuration files (such as JSON configuration files) are used to maintain streamlined interface elements and operation methods. An automated testing service converts the configuration files into native test expression calls to implement test operations.
It provides a more flexible automated testing approach, which can quickly adapt to specific business function requirements and simplify the maintenance and modification process of test cases.
Smart Images

Figure CN114428735B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of communication, and in particular to a technology for automated testing. BACKGROUND
[0002] In the prior art, we usually need to perform APP automated testing. Compared with manual testing, automated testing is more convenient and reliable, can run more and more tedious tests, is fast and efficient, can perform some tests that are quite difficult or impossible to perform manually, such as a large number of user concurrency, can better utilize resources, has the characteristics of consistency and repeatability, and automated testing scripts are completely reusable. SUMMARY
[0003] An object of the present application is to provide a method, device, medium and program product for automated testing.
[0004] According to an aspect of the present application, a method for automated testing is provided, the method comprising:
[0005] obtaining, in a first test script based on an automated testing service, a first device object, introducing a configuration file corresponding to each test case in one or more test cases into the first device object, wherein the configuration file comprises one or more key-value pair strings corresponding to one or more native test expressions about the test case, and the first device object is used to initialize a second device object corresponding to a second device connected to the first device;
[0006] converting, by the first device object, the configuration file into a call based on the second device object to the one or more native test expressions;
[0007] running the first test script to perform a test operation corresponding to the one or more native test expressions.
[0008] According to an aspect of the present application, a first device for automated testing is provided, the device comprising:
[0009] a one-to-one module configured to obtain, in a first test script based on an automated testing service, a first device object, introduce a configuration file corresponding to each test case in one or more test cases into the first device object, wherein the configuration file comprises one or more key-value pair strings corresponding to one or more native test expressions about the test case, and the first device object is used to initialize a second device object corresponding to a second device connected to the first device;
[0010] a second module, configured to convert the configuration file into a call of the one or more native test expressions based on the second device object through the first device object;
[0011] a third module, configured to run the first test script to perform a test operation corresponding to the one or more native test expressions.
[0012] According to an aspect of the present application, there is provided a computer device for automated testing, comprising a memory, a processor and a computer program stored in the memory, wherein the processor executes the computer program to implement the operations of any of the methods described above.
[0013] According to an aspect of the present application, there is provided a computer readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the operations of any of the methods described above.
[0014] According to an aspect of the present application, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the steps of any of the methods described above.
[0015] Compared with the prior art, the present application introduces a configuration file corresponding to each test case in one or more test cases into a first device object in a first test script based on an automated testing service, wherein the configuration file comprises one or more key-value pair strings corresponding to one or more native test expressions about the test case, and the first device object is used to initialize a second device object corresponding to a second device connected to the first device; the configuration file is converted into a call of the one or more native test expressions based on the second device object through the first device object; and the first test script is run to perform a test operation corresponding to the one or more native test expressions. Thus, by designing an automated test script as a configuration file (for example, a json configuration file), a tester can complete test execution by maintaining a flow interface element and an operation method in the configuration file. Compared with a traditional automated test script (for example, a python script), the present application provides a new way for APP automated test case writing, and is more flexible. By test case configuration, the present application realizes the separation of part of business code (function blocks, such as a login process, a logout process, a recharge process, a withdrawal process, a card binding process, etc.) and the configuration file, and has strong expandability. If special processing is required, a configuration file can be directly copied and modified to meet specific business function requirements. The test case is maintained through the configuration file, which is very convenient for later changes. BRIEF DESCRIPTION OF DRAWINGS
[0016] Other features, objects, and advantages of the application will become more apparent from the following detailed description when read in conjunction with the accompanying drawings:
[0017] Figure 1 A flowchart of a method for automated testing is shown according to one embodiment of the application;
[0018] Figure 2 A block diagram of a first apparatus for automated testing is shown according to one embodiment of the application;
[0019] Figure 3 An exemplary system that can be used for implementing the various embodiments described herein is shown.
[0020] The same or similar reference numerals in the drawings denote the same or similar components. DETAILED DESCRIPTION
[0021] The application is further described in conjunction with the accompanying drawings.
[0022] In one typical configuration of the application, the terminal, the apparatus of the service network and the trusted party each includes one or more processors (e.g., a Central Processing Unit (CPU)), input / output interfaces, network interfaces, and memory.
[0023] The memory can include non-persistent memory, Random Access Memory (RAM), and / or non-volatile memory, etc. in the form of computer-readable media, such as Read Only Memory (ROM) or Flash memory. The memory is an example of computer-readable media.
[0024] Computer-readable media includes permanent and non-permanent, moveable and non- moveable media that can be implemented in any method or technology for storage of information, such as computer readable instructions, data structures, program modules or other data. Examples of computer storage media include, without limitation, phase-change memory (PCM), programmable random access memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically-erasable programmable read-only memory (EEPROM), flash memory or other memory technology, compact disc read-only memory (CD-ROM), digital versatile discs (DVDs) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information for access by a computing device.
[0025] The device referred to in the present application includes, but is not limited to, a terminal, a network device, or a device formed by integrating a terminal and a network device through a network. The terminal includes, but is not limited to, any kind of mobile electronic product capable of human-computer interaction (for example, human-computer interaction through a touch panel), such as a smart phone, a tablet computer, etc., which can adopt any operating system, such as an Android operating system, an iOS operating system, etc. The network device includes an electronic device capable of automatically performing numerical calculation and information processing according to a pre-set or stored instruction, and the hardware thereof includes, but is not limited to, a microprocessor, an Application Specific Integrated Circuit (ASIC), a Programmable Logic Device (PLD), a Field Programmable Gate Array (FPGA), a Digital Signal Processor (DSP), an embedded device, etc. The network device includes, but is not limited to, a computer, a network host, a single network server, a plurality of network servers, or a cloud formed by a plurality of servers; here, the cloud is formed by a large number of computers or network servers based on cloud computing, wherein the cloud computing is a kind of distributed computing, and a virtual supercomputer formed by a group of loosely coupled computer clusters. The network includes, but is not limited to, the Internet, a wide area network, a metropolitan area network, a local area network, a VPN network, a wireless Ad Hoc network, etc. Preferably, the device can also be a program running on the terminal, the network device, or a device formed by integrating a terminal and a network device, a network device, a touch terminal, or a device formed by integrating a touch terminal and a network device through a network.
[0026] Of course, those skilled in the art should understand that the above device is only an example, and other existing or future devices, such as devices that can be applicable to the present application, should also be included in the protection scope of the present application, and are hereby included by reference.
[0027] In the description of the present application, the meaning of "a plurality of" is two or more, unless otherwise explicitly and specifically limited.
[0028] Figure 1A method flowchart for automated testing according to one embodiment of the present application is shown, which includes steps S11, S12 and S13. In step S11, a first device obtains a first device object in a first test script based on an automated testing service, introduces a configuration file corresponding to each of one or more test cases into the first device object, wherein the configuration file includes one or more key-value pair strings corresponding to one or more native test expressions about the test case, and the first device object is used to initialize a second device object corresponding to a second device connected with the first device; in step S12, the first device converts the configuration file into a call based on the second device object to the one or more native test expressions through the first device object; in step S13, the first device runs the first test script to perform a test operation corresponding to the one or more native test expressions.
[0029] In step S11, the first device obtains a first device object in a first test script based on an automated test service, introduces a configuration file corresponding to each test case in one or more test cases into the first device object, wherein the configuration file includes one or more key-value pair strings corresponding to one or more native test expressions about the test case, and the first device object is used to initialize a second device object corresponding to a second device connected to the first device. In some embodiments, the first device refers to a test device for maintaining and running an automated test script, including but not limited to a terminal such as a mobile phone, a computer, etc., which can be a network device (server) or a user device, and the second device refers to a device under test, including but not limited to a mobile terminal such as a mobile phone, a tablet computer, etc., which is usually a user device. In some embodiments, the first device can be connected to the second device in a wired manner (for example, usb), or the first device can also be connected to the second device in a wireless manner (for example, wifi). In some embodiments, the automated test service includes but is not limited to any service for testing a device under test by automatically controlling the device under test, such as a UiAutomator service. UiAutomator is a Java library provided by Google for Android automated testing, which needs to run on an Android mobile phone, and is based on an Accessibility service, which can test an App on a mobile phone, obtain any control of any App on the screen of the mobile phone, and perform any operation on the control. In some embodiments, an http remote procedure call service (i.e., an http rpc service) is installed and run on the second device, which encapsulates the UiAutomator service to expose the functions in the UiAutomator, shields the system differences of different user devices, exposes a unified http interface for use, and then encapsulates the http interface into a Python library (for example, a UiAutomator2 service). By installing the UiAutomator2 service on the first device, the UiAutomator2 service converts each test operation performed by an automated test script written by a user based on the Python library into an http request to the http rpc service, the http rpc service receives and parses the http request, and then calls an api of the UiAutomator to automatically control the second device. In some embodiments, before installing the automated control service on the first device, a python environment needs to be built on the first device. In some embodiments, an atx-agent (daemon process) needs to be installed on the second device, and then the http rpc service is started and listens through the atx-agent, listens to the http request sent by the first device, and forwards the http request to the http rpc service.In some embodiments, it is required to create a first device object in an automated test script, the first device object encapsulates a second device object corresponding to a second device connected to the first device, the second device object is created and initialized in the first device object, specifically, the device identifier information of the second device is transmitted into a connect method provided by a UiAutomator2 service, and the output result of the connect method is the second device object corresponding to the second device, wherein if the second device is connected to the first device through wifi, the IP address of the second device can be used as the device identifier information of the second device, and if the second device is connected to the first device through usb, the device serial number of the second device can be used as the device identifier information of the second device. In some embodiments, one test case corresponds to one function flow or one business page, and each test corresponds to a configuration file, for example, a json configuration file. In some embodiments, the configuration file can be stored in the data folder of the test project. In some embodiments, each configuration file includes one or more key-value pair strings, each key-value pair string includes at least one key (key) and the value (value) corresponding to each key, for example, the key-value pair string can be "do":"click_exists", "element":{"resourceId":"com.**.***:id / wifipay_enter_advert_close"}". In some embodiments, each key-value pair string in the configuration file is enclosed by a predetermined symbol (for example, a pair of braces) to distinguish different key-value pair strings. In some embodiments, different key-value pair strings are also distinguished by line breaks, that is, each line in the configuration file has at most one key-value pair string, and different key-value pair strings are located in different lines in the configuration file. In some embodiments, the one or more key-value pair strings can be created directly in the configuration file. In some embodiments, the first test script is an automated test script, usually a python script, the automated test script can include a native test expression, that is, a native python script language, and the automated test script is based on an automated test service (for example, a UiAutomator2 service), that is, the automated test script can call the interface provided or opened by the automated test service to complete the function of automated testing, that is, to test the second device by automatically controlling the second device. In some embodiments, the first predetermined interface provided by the first device object can be called in the automated test script to transmit or introduce the configuration file corresponding to each test case into the first device object through the first predetermined interface, wherein one or more test cases can be executed according to the actual test business logic.In some embodiments, each key-value pair string in the configuration file corresponding to a certain test case corresponds to a native test expression about the test case, wherein the native test expression refers to a native python expression written by calling the UiAutomator2 service, for example, the native test expression can be "d(resourceId="com.**.***:id / wifipay_enter_advert_close").click_exists()", and the key-value pair string corresponding to the native test expression is " "do":"click_exists","element":{"resourceId":"com.**.***:id / wifipay_enter_advert_close"}".
[0030] In step S12, the first device converts the configuration file into a call to the one or more native test expressions based on the second device object by the first device object. In some embodiments, each key-value pair string in the configuration file can be converted into a call to the native test expression corresponding to the key-value pair string based on the second device object by calling a second predetermined interface (for example, a do_element interface) provided by the first device object, and the input parameter of the second predetermined interface is the key-value pair string. For example, the second predetermined interface can be called directly in the automated test script, or the second predetermined interface can also be called in the internal implementation of the first predetermined interface (for example, the actions interface). For example, a certain key-value pair string in the configuration file is "element":{"resourceId":"com.**.***:id / wifipay_enter_advert_close"}", and the key-value pair string is converted into executable code based on the call to the native test expression corresponding to the key-value pair string by the second device object by the interface provided by the first device object, for example, "d(resourceId="com.**.***:id / wifipay_enter_advert_close").click_exists()", wherein d is the second device object.
[0031] In step S13, the first device runs the first test script to perform a test operation corresponding to the one or more native test expressions. In some embodiments, the automated test script is run on the first device to perform a test operation corresponding to the one or more native test expressions of each of the one or more test cases, the test operation being for obtaining at least one control presented on a current screen of the second device and performing at least one automated operation on the at least one control. In some embodiments, the automated test script performs the test operation in an order under a call of an automated platform backend code. The present application provides a new way for the test case writing of the APP automated test by designing the automated test script as a configuration file (e.g., a json configuration file), and the test personnel can complete the test execution by maintaining the flow interface elements and operation methods in the configuration file. Compared with the traditional automated test script (e.g., a python script), the present application is more flexible, and the test case configuration realizes the separation of the business code (function blocks, such as: login process, logout process, recharge process, withdrawal process, card binding process, etc.) and the configuration file, and has strong expandability. If special processing is required, a configuration file can be directly copied and modified to meet the specific business function requirements. The test case is maintained through the configuration file, which is very convenient for later changes.
[0032] In some embodiments, the method further includes: creating, by the first device, one or more native test expressions corresponding to each of the one or more test cases based on the automated test service; and converting the one or more native test expressions into a configuration file corresponding to the test case. In some embodiments, the one or more native test expressions corresponding to each of the one or more test cases are created first, wherein the native test expression refers to a native python expression written by calling a UiAutomator2 service. In some embodiments, the one or more native test expressions are converted into the configuration file corresponding to the test case in response to a conversion operation initiated by the test user for the one or more native test expressions, wherein the configuration file includes one or more key-value pair strings, and each key-value pair string corresponds to one of the one or more native test expressions.
[0033] In some embodiments, the creating, based on the automation testing service, one or more native test expressions corresponding to each of the one or more test cases comprises: creating, in a second test script based on the automation testing service, one or more native test expressions corresponding to each of the one or more test cases; and wherein the converting the one or more native test expressions into the configuration file corresponding to the test case comprises: converting the second test script to obtain the configuration file corresponding to the test case, wherein the configuration file comprises one or more key-value pair strings, and each key-value pair string corresponds to a native test expression. In some embodiments, a python test script file (second test script) can be created first, and each test case corresponds to a python test script file. Then one or more native test expressions corresponding to the test case are created in the python test script file. In response to a conversion operation initiated by the test user for the python test script file, the python test script file is converted into the configuration file corresponding to the test case, wherein the configuration file includes one or more key-value pair strings, and each key-value pair string corresponds to one of the native test expressions in the python test script file.
[0034] In some embodiments, the converting the one or more native test expressions into the configuration file corresponding to the test case comprises: for each native test expression in the one or more native test expressions, initiating a request to a predetermined conversion interface based on the native test expression; receiving a key-value pair string corresponding to the native test expression returned by the conversion interface; and generating the configuration file corresponding to the test case according to the key-value pair string corresponding to each native test expression. In some embodiments, for each native test expression in the one or more native test expressions, a request is initiated to a predetermined conversion interface based on the native test expression, for example, the conversion interface can be “local_ip:6666 / convertJson”. In some embodiments, if the conversion interface is a get request interface, the native test expression can be directly added behind the URL address of the conversion interface, for example, “local_ip:6666 / convertJson?expression=the native test expression”, if the conversion interface is a post request interface, the native test expression can be added to the request body of the conversion interface. In some embodiments, the conversion interface returns a key-value pair string corresponding to the native test expression, and then the configuration file corresponding to the test case is generated according to the key-value pair string corresponding to each native test expression, wherein the configuration file includes one or more key-value pair strings, and each key-value pair string corresponds to one of the one or more native test expressions.
[0035] In some embodiments, the conversion interface is configured to perform regular matching on the native test expression to obtain one or more matching objects, to parse the one or more matching objects to obtain at least one key information and at least one value information corresponding to the at least one key information, and to assemble the at least one key information and the at least one value information to obtain a key-value pair string corresponding to the native test expression. In some embodiments, the conversion interface is configured to perform regular matching on the native test expression to obtain one or more matching objects, for example, the native test expression is "d(resourceId="com.**.***:id / wk_et_input_phonenumber ").set_text(“151****3862”)", the matching objects obtained by performing regular matching on the native test expression include "resourceId="com.**.***:id / wk_et_input_phonenumber "”, “.set_text”, “151****3862”, the at least one key information and the at least one value information corresponding to the at least one key information are obtained by parsing the matching objects, the at least one key information includes "element", "do", and "args", the value information corresponding to "element" is "{“resourceId”:“com.**.***:id / wk_et_input_phonenumber”}", the value information corresponding to "do" is "set_text", and the value information corresponding to "args" is "151****3862", and then the key-value pair string corresponding to the native test expression is obtained by assembling the at least one key information and the at least one value information, for example, "{“do”:“set_text”,“element”:{“resourceId”:“com.**.***:id / wk_et_input_phonenumber”},“args”:“151****3862”}".
[0036] In some embodiments, the at least one key information includes element type key information, operation type key information and / or operation parameter key information. In some embodiments, the element type key information is a predetermined character, e.g., "element", if a predetermined keyword (e.g., text, textContains, textMatches, textStartsWith, className, classNameMatches, resourceId, resourceIdMatches, instance, xpath) is identified in the native test expression, it can be determined that the at least one key information includes the element type key information "element", and the value information corresponding to "element" is the character information corresponding to the keyword in the native test expression, e.g., the native test expression is "d(resourceId="com.**.***:id / wk_et_input_phonenumber ").set_text(“151****3862”)”, since the keyword "resourceId" is included in the native test expression, the at least one key information corresponding to the native test expression includes the element type key information "element", and the value information corresponding to "element" is the character information corresponding to "resourceId" in the native test expression, i.e., "com.**.***:id / wk_et_input_phonenumber". In some embodiments, the operation type key information is a predetermined character, e.g., "do", if a predetermined method (e.g., click, click_exists, click_gone, clear_text, send_keys, set_text, swipe, sleep, scroll, fling, keyboard_keys) is identified in the native test expression, it can be determined that the at least one key information includes the operation type key information "do", and the value information corresponding to "do" is the method name of the method, e.g., the native test expression is "d(resourceId="com.**.***:id / wk_et_input_phonenumber ").set_text(“151****3862”)”, since the method "set_text" is included in the native test expression, the at least one key information corresponding to the native test expression includes the operation type key information "do", and the value information corresponding to "do" is "set_text".In some embodiments, the operation parameter key information is a predetermined character, for example, "args", if it is identified that the native test expression includes a predetermined method, and the method is a parameterized method, that is, the method includes an input parameter, it can be determined that the at least one key information includes the operation parameter key information "args", and the value information corresponding to "args" is the input parameter of the method, for example, the native test expression is "d(resourceId="com.**.***:id / wk_et_input_phonenumber ").set_text(“151****3862”)”, since the native test expression includes the method "set_text", and the method includes the input parameter "151****3862", therefore, the at least one key information corresponding to the native test expression includes the operation parameter key information "args", and the value information corresponding to "do" is "151****3862".
[0037] In some embodiments, the introducing the configuration file corresponding to each of the one or more test cases into the first device object includes: introducing the configuration file corresponding to each of the one or more test cases into the first device object by calling a first method of the first device object, wherein an input of the first method is file identification information of the configuration file. In some embodiments, the configuration file corresponding to each of the one or more test cases can be introduced into the first device object by calling a first method provided by the first device object, for example, an actions method, and an input parameter of the first method is file identification information (for example, a file name or a file path) of the configuration file, for example, Driver.actions(“login.json”), wherein Driver is the first device object, and login.json is a file name of the configuration file corresponding to a test case.
[0038] In some embodiments, the obtaining the first device object in the first test script based on the automated test service includes: creating the first device object in the first test script based on the automated test service. In some embodiments, the first device object needs to be created in the automated test script, for example, the class name of the first device object is "AndroidDriver", and the first device object Driver can be created in the automated test script by "Driver= AndroidDriver()".
[0039] In some embodiments, the obtaining the first device object in the first test script based on the automated testing service comprises: obtaining the first device object from a global variable of the first test script based on the automated testing service; and the method further comprises: the first device creating the first device object in the first test script and storing the first device object in the global variable of the first test script. In some embodiments, the first device object can be created in the automated test script first, and then stored in the global variable of the automated test script. When the first device object is needed later, the first device object can be directly taken out from the global variable of the automated test script. For example, the class name of the first device object is "AndroidDriver", the first device object Driver can be created in the automated test script by "Driver= AndroidDriver()", and the first device object Driver can be stored in the global variable by "set_Driver(Driver)". When the first device object is needed later, the first device object Driver can be taken out from the global variable by "Driver=get_Driver()". In some embodiments, the set_Driver() and get_Driver() methods are defined in the framework public method library of the test project for the test project to call.
[0040] In some embodiments, the step S12 comprises: the first device loading one or more key-value pair strings in the configuration file through the first device object, and converting the one or more key-value pair strings into a call to the one or more native test expressions based on the second device object by parsing the one or more key-value pair strings. In some embodiments, each key-value pair string in the configuration file can be loaded in the first device object in turn, and each key-value pair string can be parsed based on a predetermined parsing rule. According to the parsing result, the key-value pair string is converted into executable code based on the second device object calling the native test expression corresponding to the key-value pair string. For example, the key-value pair string is "do":"click_exists", "element":{"resourceId":"com.**.***:id / wifipay_enter_advert_close"}", the executable code corresponding to the key-value pair string is "d(resourceId="com.**.***:id / wifipay_enter_advert_close").click_exists()", and d is the second device object.
[0041] In some embodiments, the converting the one or more key-value pair strings into the call of the one or more native test expressions based on the second device object by parsing the one or more key-value pair strings comprises: for each key-value pair string in the one or more key-value pair strings, obtaining at least one key information and corresponding at least one value information from the key-value pair string by parsing the key-value pair string; and converting the key-value pair string into the call of a native test expression based on the second device object according to the at least one key information and the at least one value information. In some embodiments, each key-value pair string includes at least one key-value pair, i.e., at least one key and a value corresponding to each key. In some embodiments, at least one key information and corresponding at least one value information are parsed from each key-value pair string, and then the key-value pair string is converted into executable code of a native test expression corresponding to the key-value pair string based on the second device object and according to the at least one key information and the at least one value information. For example, the key-value pair string is "do":"click_exists", "element":{"resourceId":"com.**.***:id / wifipay_enter_advert_close"}", the key information "do" and the corresponding value information "click_exists", the key information "element" and the corresponding value information "{"resourceId":"com.**.***:id / wifipay_enter_advert_close"}" are parsed from the key-value pair string, and then the key-value pair string is converted into executable code of a native test expression corresponding to the key-value pair string based on the second device object d and according to the two key information and the value information corresponding to each key information, e.g., "d(resourceId="com.**.***:id / wifipay_enter_advert_close").click_exists()".
[0042] In some embodiments, the at least one key information comprises element type key information, operation type key information and / or operation parameter key information; and wherein the converting the key-value pair string into a call of a native test expression based on the second device object according to the at least one key information and the at least one value information comprises: obtaining a corresponding UI component object based on the second device object according to first value information corresponding to the element type key information; and converting the key-value pair string into a call of a target method of the UI component object based on the UI component object, second value information corresponding to the operation type key information and / or third value information corresponding to the operation parameter key information, wherein the method name of the target method is the second value information, and the input parameter of the target method is the third value information. In some embodiments, the element type key information is a predetermined character, such as “element”, the operation type key information is a predetermined character, such as “do”, and the operation parameter key information is a predetermined character, such as “args”. In some embodiments, the key-value pair string is “{“do”:“set_text”,“element”:{“resourceId”:“com.**.***:id / wk_et_input_phonenumber”},“args”:“151****3862”}”, and the key information “do” and the corresponding value information “set_text”, the key information “element” and the corresponding value information “{“resourceId”:“com.**.***:id / wk_et_input_phonenumber”}”, and the key information “args” and the corresponding value information “151****3862” are parsed from the key-value pair string.In some embodiments, based on the second device object d, according to the first value information “{“resourceId”:“com.***:id / wk_et_input_phonenumber”}” corresponding to the element type key information “element”, a corresponding UI component object is obtained, for example, by “d(resourceId=“com.***:id / wk_et_input_phonenumber”)”, and then based on the UI component object, according to the second value information “set_text” corresponding to the operation type key information “do” and the third value information “151****3862” corresponding to the operation parameter key information “args”, the key-value pair string is converted into executable code for calling a target method of the UI component object, the method name of the target method is “set_text”, and the incoming parameter of the target method is “151****3862”, that is, the executable code is “d(resourceId=“com.***:id / wk_et_input_phonenumber”).set_text(“151****3862”)”.In some embodiments, if the at least one key information does not include operation parameter key information (e.g., "args"), based on the UI component object, the key-value pair string is converted into executable code for calling a target method of the UI component object according to the second value information corresponding to the operation type key information only, wherein the method name of the target method is the second value information, and the target method is a parameterless method, i.e., the target method does not have an input parameter. For example, the key-value pair string is " "do":"click_exists", "element":{"resourceId":"com.**.***:id / wifipay_enter_advert_close"} ". The operation type key information "do" and the corresponding value information "click_exists", the element type key information "element" and the corresponding value information " {"resourceId":"com.**.***:id / wifipay_enter_advert_close"} " are parsed from the key-value pair string. Then, based on the second device object d, the corresponding UI component object is obtained according to the first value information " {"resourceId":"com.**.***:id / wifipay_enter_advert_close"} " corresponding to the element type key information "element", for example, by "d(resourceId="com.**.***:id / wifipay_enter_advert_close")". Then, based on the UI component object, the key-value pair string is converted into executable code for calling a target method of the UI component object according to the second value information "click_exists" corresponding to the operation type key information "do". The method name of the target method is "click_exists", and the target method is a parameterless method. Therefore, the executable code is "d(resourceId="com.**.***:id / wifipay_enter_advert_close).click_exists()".
[0043] In some embodiments, the method further comprises: the first device performing corresponding preparation work in the first test script; wherein the method further comprises: the first device performing corresponding finishing work in the first test script. In some embodiments, before introducing the configuration file corresponding to one or more test cases into the first device object, corresponding preparation work needs to be performed in the automated test script, which includes but is not limited to deploying a second device end automated service agent, connecting a second device, unlocking and lighting a second device, opening a tested application with / without cache on a second device, threadizing to open a watcher monitoring in an application maintained in advance. In some embodiments, after completing the test operation corresponding to the one or more test cases, corresponding finishing work needs to be performed in the automated test script, which includes but is not limited to closing the tested application, closing the watcher monitoring, closing the second device object driver corresponding to the second device connected with the first device, and closing the automated service agent.
[0044] Figure 2 A first device structure diagram for automated testing is shown according to one embodiment of the present application, which includes a first module 11, a second module 12 and a third module 13. The first module 11 is used to obtain a first device object in a first test script based on an automated test service, introduce a configuration file corresponding to each test case in one or more test cases into the first device object, wherein the configuration file includes one or more key-value pair strings corresponding to one or more native test expressions about the test case, and the first device object is used to initialize a second device object corresponding to a second device connected with the first device. The second module 12 is used to convert the configuration file into a call based on the second device object to the one or more native test expressions through the first device object. The third module 13 is used to run the first test script to perform a test operation corresponding to the one or more native test expressions.
[0045] A first module 11 is configured to obtain a first device object in a first test script based on an automated testing service, introduce a configuration file corresponding to each test case in one or more test cases into the first device object, wherein the configuration file comprises one or more key-value pair strings corresponding to one or more native test expressions about the test case, and the first device object is used to initialize a second device object corresponding to a second device connected with the first device. In some embodiments, the first device refers to a test device for maintaining and running an automated test script, including but not limited to a terminal such as a mobile phone, a computer, etc., which can be a network device (server) or a user device, and the second device refers to a device under test, including but not limited to a mobile terminal such as a mobile phone and a tablet computer, which is usually a user device. In some embodiments, the first device can be connected with the second device in a wired manner (for example, USB), or the first device can also be connected with the second device in a wireless manner (for example, Wi-Fi). In some embodiments, the automated testing service includes but is not limited to any service for testing a device under test by automatically controlling the device under test, such as a UiAutomator service. The UiAutomator is a Java library provided by Google for Android automated testing, which needs to be run on an Android mobile phone, and is based on an Accessibility service, which can test an App on the mobile phone, obtain any control of any App on the screen of the mobile phone, and perform any operation on the control. In some embodiments, an http remote procedure call service (http rpc service) is installed and run on the second device, which encapsulates the UiAutomator service to expose the functions in the UiAutomator, shields the system differences of different user devices, exposes a unified http interface for use, and then encapsulates the http interface into a Python library (for example, a UiAutomator2 service). By installing the UiAutomator2 service on the first device, the UiAutomator2 service converts each test operation performed by an automated test script written by a user based on the Python library into an http request to the http rpc service, the http rpc service receives and parses the http request, and then calls an API of the UiAutomator to automatically control the second device. In some embodiments, before installing the automated control service on the first device, a Python environment needs to be built on the first device. In some embodiments, an atx-agent (daemon process) needs to be installed on the second device, and then the http rpc service is started and listens through the atx-agent to listen to the http request sent by the first device and forward the http request to the http rpc service.In some embodiments, it is required to create a first device object in an automated test script, the first device object encapsulates a second device object corresponding to a second device connected to the first device, the second device object is created and initialized in the first device object, specifically, the device identifier information of the second device is transmitted into a connect method provided by a UiAutomator2 service, and the output result of the connect method is the second device object corresponding to the second device, wherein if the second device is connected to the first device through wifi, the IP address of the second device can be used as the device identifier information of the second device, and if the second device is connected to the first device through usb, the device serial number of the second device can be used as the device identifier information of the second device. In some embodiments, one test case corresponds to one function flow or one business page, and each test corresponds to a configuration file, for example, a json configuration file. In some embodiments, the configuration file can be stored in the data folder of the test project. In some embodiments, each configuration file includes one or more key-value pair strings, each key-value pair string includes at least one key (key) and the value (value) corresponding to each key, for example, the key-value pair string can be "do":"click_exists", "element":{"resourceId":"com.**.***:id / wifipay_enter_advert_close"}". In some embodiments, each key-value pair string in the configuration file is enclosed by a predetermined symbol (for example, a pair of braces) to distinguish different key-value pair strings. In some embodiments, different key-value pair strings are also distinguished by line breaks, that is, each line in the configuration file has at most one key-value pair string, and different key-value pair strings are located in different lines in the configuration file. In some embodiments, the one or more key-value pair strings can be created directly in the configuration file. In some embodiments, the first test script is an automated test script, usually a python script, the automated test script can include a native test expression, that is, a native python script language, and the automated test script is based on an automated test service (for example, a UiAutomator2 service), that is, the automated test script can call the interface provided or opened by the automated test service to complete the function of automated testing, that is, to test the second device by automatically controlling the second device. In some embodiments, the first predetermined interface provided by the first device object can be called in the automated test script to transmit or introduce the configuration file corresponding to each test case into the first device object through the first predetermined interface, wherein one or more test cases can be executed according to the actual test business logic.In some embodiments, each key-value pair string in the configuration file corresponding to a certain test case corresponds to one native test expression about the test case, wherein the native test expression refers to a native python expression written by calling the UiAutomator2 service, for example, the native test expression can be "d(resourceId="com.**.***:id / wifipay_enter_advert_close").click_exists()", and the key-value pair string corresponding to the native test expression is " "do":"click_exists","element":{"resourceId":"com.**.***:id / wifipay_enter_advert_close"}".
[0046] A second module 12 is configured to convert the configuration file into a call to the one or more native test expressions based on the second device object through the first device object. In some embodiments, each key-value pair string in the configuration file can be converted into a call to the native test expression corresponding to the key-value pair string based on the second device object by calling a second predetermined interface (for example, a do_element interface) provided by the first device object, and the input parameter of the second predetermined interface is the key-value pair string. For example, the second predetermined interface can be called directly in the automated test script, or the second predetermined interface can also be called in the internal implementation of the first predetermined interface (for example, the actions interface). For example, a key-value pair string in the configuration file is "element":{"resourceId":"com.**.***:id / wifipay_enter_advert_close"}", and the key-value pair string is converted into executable code based on the call to the native test expression corresponding to the key-value pair string by the second device object through the interface provided by the first device object, for example, "d(resourceId="com.**.***:id / wifipay_enter_advert_close").click_exists()", wherein d is the second device object.
[0047] a third module 13 configured to execute the first test script to perform a test operation corresponding to the one or more native test expressions. In some embodiments, the automated test script is executed on the first device to perform a test operation corresponding to the one or more native test expressions of each of the one or more test cases, the test operation being configured to obtain at least one control presented on a current screen of the second device and perform at least one automated operation on the at least one control. In some embodiments, the automated test script is executed in an order based on a call from the automated platform backend code. In some embodiments, the automated test script is designed as a configuration file (e.g., a json configuration file). In some embodiments, a tester can maintain a flowchart of interface elements and operation methods in the configuration file to complete test execution. In some embodiments, the configuration file provides a new way for writing test cases for APP automated testing, which is more flexible. In some embodiments, the configuration file is used to maintain test cases, which is very convenient for later changes.
[0048] In some embodiments, the device is further configured to: based on the automated test service, create one or more native test expressions corresponding to each of the one or more test cases; and convert the one or more native test expressions into a configuration file corresponding to the test case. In some embodiments, the device is further configured to: based on the automated test service, create one or more native test expressions corresponding to each of the one or more test cases; and convert the one or more native test expressions into a configuration file corresponding to the test case. Figure 1 In some embodiments, the device is further configured to: based on the automated test service, create one or more native test expressions corresponding to each of the one or more test cases; and convert the one or more native test expressions into a configuration file corresponding to the test case. In some embodiments, the device is further configured to: based on the automated test service, create one or more native test expressions corresponding to each of the one or more test cases; and convert the one or more native test expressions into a configuration file corresponding to the test case.
[0049] In some embodiments, the creating one or more native test expressions corresponding to each of the one or more test cases based on the automated test service comprises: creating the one or more native test expressions corresponding to each of the one or more test cases in a second test script based on the automated test service; and converting the second test script to obtain the configuration file corresponding to the test case, wherein the configuration file comprises one or more key-value pair strings, and each key-value pair string corresponds to a native test expression. Figure 1 In some embodiments, the creating one or more native test expressions corresponding to each of the one or more test cases based on the automated test service comprises: creating the one or more native test expressions corresponding to each of the one or more test cases in a second test script based on the automated test service; and converting the second test script to obtain the configuration file corresponding to the test case, wherein the configuration file comprises one or more key-value pair strings, and each key-value pair string corresponds to a native test expression.
[0050] In some embodiments, the converting the one or more native test expressions into the configuration file corresponding to the test case comprises: for each native test expression in the one or more native test expressions, initiating a request to a predetermined conversion interface based on the native test expression; receiving a key-value pair string corresponding to the native test expression returned by the conversion interface; and generating the configuration file corresponding to the test case according to the key-value pair string corresponding to the each native test expression. In this regard, the related operations are the same as or similar to those in the embodiments shown in Figure 1 and thus are not described herein again by way of reference.
[0051] In some embodiments, the conversion interface is configured to perform regular matching on the native test expression to obtain one or more matching objects, to parse the one or more matching objects to obtain at least one key information and at least one value information corresponding to the at least one key information, and to assemble the at least one key information and the at least one value information to obtain the key-value pair string corresponding to the native test expression. In this regard, the related operations are the same as or similar to those in the embodiments shown in Figure 1 and thus are not described herein again by way of reference.
[0052] In some embodiments, the at least one key information comprises an element type key information, an operation type key information, and / or an operation parameter key information. In this regard, the related operations are the same as or similar to those in the embodiments shown in Figure 1 and thus are not described herein again by way of reference.
[0053] In some embodiments, the introducing the configuration file corresponding to each test case in the one or more test cases into the first device object comprises: introducing the configuration file corresponding to each test case in the one or more test cases into the first device object by calling a first method of the first device object, wherein an input of the first method is file identification information of the configuration file. In this regard, the related operations are the same as or similar to those in the embodiments shown in Figure 1 and thus are not described herein again by way of reference.
[0054] In some embodiments, the obtaining the first device object in the first test script based on the automated test service comprises: creating the first device object in the first test script based on the automated test service. In this regard, the related operations are the same as or similar to those in the embodiments shown in Figure 1 and thus are not described herein again by way of reference.
[0055] In some embodiments, the obtaining the first device object in the first test script based on the automated testing service comprises: obtaining the first device object from a global variable of the first test script based on the automated testing service; and the device is further configured to: create the first device object in the first test script, and store the first device object in the global variable of the first test script. Here, the related operations are the same as or similar to those in the embodiments shown in the above, and are not described herein by way of introduction. Figure 1 The embodiments shown in the above are the same as or similar to those in the embodiments shown in the above, and are not described herein by way of introduction.
[0056] In some embodiments, the one or more modules 12 are configured to: load one or more key-value pair strings in the configuration file through the first device object, and convert the one or more key-value pair strings into a call to the one or more native test expressions based on the second device object by parsing the one or more key-value pair strings. Here, the related operations are the same as or similar to those in the embodiments shown in the above, and are not described herein by way of introduction. Figure 1 The embodiments shown in the above are the same as or similar to those in the embodiments shown in the above, and are not described herein by way of introduction.
[0057] In some embodiments, the converting the one or more key-value pair strings into a call to the one or more native test expressions based on the second device object by parsing the one or more key-value pair strings comprises: for each key-value pair string in the one or more key-value pair strings, obtaining at least one key information and corresponding at least one value information from the key-value pair string by parsing the key-value pair string; and converting the key-value pair string into a call to a native test expression based on the second device object according to the at least one key information and the at least one value information. Here, the related operations are the same as or similar to those in the embodiments shown in the above, and are not described herein by way of introduction. Figure 1 The embodiments shown in the above are the same as or similar to those in the embodiments shown in the above, and are not described herein by way of introduction.
[0058] In some embodiments, the at least one key information comprises element type key information, operation type key information, and / or operation parameter key information; and the converting the key-value pair string into a call to a native test expression based on the second device object according to the at least one key information and the at least one value information comprises: obtaining a corresponding UI component object according to first value information corresponding to the element type key information based on the second device object; and converting the key-value pair string into a call to a target method of the UI component object according to second value information corresponding to the operation type key information and / or third value information corresponding to the operation parameter key information based on the UI component object, wherein a method name of the target method is the second value information, and an input parameter of the target method is the third value information. Here, the related operations are the same as or similar to those in the embodiments shown in the above, and are not described herein by way of introduction. Figure 1The embodiments shown are the same or similar, and thus will not be repeated here, and are hereby incorporated by reference.
[0059] In some embodiments, the device is further configured to perform corresponding preparation work in the first test script; and wherein the device is further configured to perform corresponding finalization work in the first test script. Here, the related operations are the same as those in the Figure 1 The embodiments shown are the same or similar, and thus will not be repeated here, and are hereby incorporated by reference.
[0060] In addition to the methods and devices described in the above embodiments, the present application also provides a computer readable storage medium, which stores computer code, when the computer code is executed, the method of any one of the preceding embodiments is executed.
[0061] The present application also provides a computer program product, when the computer program product is executed by a computer device, the method of any one of the preceding embodiments is executed.
[0062] The present application also provides a computer device, which comprises:
[0063] one or more processors;
[0064] a memory configured to store one or more computer programs;
[0065] when the one or more computer programs are executed by the one or more processors, the one or more processors implement the method of any one of the preceding embodiments.
[0066] Figure 3 An exemplary system that can be used to implement various embodiments described in the present application is shown;
[0067] As Figure 3 In some embodiments, system 300 can function as any of the devices described in the various embodiments. In some embodiments, system 300 can include one or more computer readable media (e.g., system memory or NVM / storage 320) having instructions and one or more processors (e.g., processor(s) 305) coupled with the one or more computer readable media and configured to execute the instructions to implement modules to perform the actions described in the present application.
[0068] For one embodiment, system control module 310 can include any suitable interface controllers to provide any suitable interface between each of the one or more processors 305 and / or any suitable device or component in communication with system control module 310.
[0069] The system control module 310 can include a memory controller module 330 to provide an interface to system memory 315. The memory controller module 330 can be a hardware module, a software module, and / or a firmware module.
[0070] The system memory 315 can be used, for example, to load and store data and / or instructions for the system 300. For one embodiment, the system memory 315 can include any suitable volatile memory, such as suitable DRAM. In some embodiments, the system memory 315 can include double data rate type four synchronous dynamic random access memory (DDR4 SDRAM).
[0071] For one embodiment, the system control module 310 can include one or more input / output (I / O) controllers to provide an interface to the NVM / storage device 320 and the communication interface(s) 325.
[0072] The NVM / storage device 320 can be used, for example, to store data and / or instructions. The NVM / storage device 320 can include any suitable non-volatile memory (e.g., flash memory) and / or can include any suitable non-volatile storage device(s) (e.g., one or more hard disk drives (HDDs), one or more compact disk (CD) drives, and / or one or more digital versatile disk (DVD) drives).
[0073] The NVM / storage device 320 can include a storage resource that is physically part of the device on which the system 300 is installed, or that is accessed via the device but not necessarily physically part of the device. For example, the NVM / storage device 320 can be accessed over a network via the communication interface(s) 325.
[0074] The communication interface(s) 325 can provide an interface to the system 300 to communicate over one or more networks and / or with any other suitable device. The system 300 can communicate wirelessly with one or more components of a wireless network according to any of one or more wireless network standards and / or protocols.
[0075] For one embodiment, at least one of the processor(s) 305 can be packaged together with logic for one or more controllers of the system control module 310 (e.g., a memory controller module 330). For one embodiment, at least one of the processor(s) 305 can be packaged together with logic for one or more controllers of the system control module 310 to form a system in a package (SiP). For one embodiment, at least one of the processor(s) 305 can be integrated on the same die with logic for one or more controllers of the system control module 310. For one embodiment, at least one of the processor(s) 305 can be integrated on the same die with logic for one or more controllers of the system control module 310 to form a system on a chip (SoC).
[0076] In various embodiments, the system 300 can be, but is not limited to, a server, a workstation, a desktop computing device, or a mobile computing device (e.g., a laptop computing device, a handheld computing device, a tablet, a netbook, etc.). In various embodiments, the system 300 can have more or less components, and / or different architectures. For example, in some embodiments, the system 300 includes one or more cameras, a keyboard, a liquid crystal display (LCD) screen (including touch screen displays), non- volatile memory ports, multiple antennas, graphics chips, application specific integrated circuits (ASICs), and speakers.
[0077] It is noted that the present application can be implemented in software and / or in a combination of software and hardware, e.g., application specific integrated circuit (ASIC), general purpose computer or any other similar hardware devices. In one embodiment, the software program of the present application is implemented by the processor to perform predetermined functions or tasks. Also, the software program of the present application (including related data structures) can be stored in a computer readable recording medium, e.g., RAM memory, magnetic or optical drive or diskette, and so on. Further, some steps or functions of the present application can be implemented in hardware, e.g., as an electronic circuit that cooperates with the processor to perform various steps or functions.
[0078] In addition, part of the present application can be applied as a computer program product, for example, computer program instructions, when executed by a computer, through the operation of the computer, the method and / or technical solutions according to the present application can be called or provided. Those skilled in the art should understand that the form of computer program instructions in computer readable medium includes but is not limited to source file, executable file, installation package file and the like, and accordingly, the way of computer program instructions executed by computer includes but is not limited to: the computer directly executes the instructions, or the computer executes the corresponding compiled program after compiling the instructions, or the computer reads and executes the instructions, or the computer executes the corresponding installed program after reading and installing the instructions. Here, the computer readable medium can be any available computer readable storage medium or communication medium accessible to the computer.
[0079] Communication media includes any medium through which computer readable instructions, data structures, program modules, or other data is communicated from one system to another, e.g., according to a communication protocol. Depending on the nature of the communication medium, the communication can be wireless or wired. The communication medium can include wired transmission media such as electrical wires, cables and lines (e.g., fiber optic, coaxial, etc.) and wireless transmission media such as acoustic, electromagnetic, RF, microwave, and infrared. Computer readable instructions, data structures, program modules, or other data can be embodied as modulated data signals, e.g., carrier waves, such as those implemented as part of an extension technology. The term "modulated data signal" refers to a signal that has one or more of its characteristics set or changed in such a manner as to encode information in the signal. The modulated signals can be analog or digital signals.
[0080] By way of example, and not limitation, computer readable storage media can include volatile and non-volatile, removable and non-removable media implemented in any method or technology for storage of information such as computer readable instructions, data structures, program modules or other data. For example, computer readable storage media includes, but is not limited to, RAM, such as DRAM, SRAM, etc.; ROM, such as flash memory, various types of read-only memory, programmable ROM (PROM), erasable programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), magnetic and ferromagnetic / ferroelectric memories (MRAM, FeRAM), and the like; and magnetic and optical storage devices, such as hard disk, tape, CD-ROM, DVD, etc.; or other now known or later developed memory / storage media that can be used for storing computer readable information / data for use in a computer system.
[0081] Herein, according to one embodiment of the present application comprises a device, the device comprises a memory for storing computer program instructions and a processor for executing program instructions, wherein when the computer program instructions are executed by the processor, trigger the device run based on the foregoing according to the method and / or technical solutions of multiple embodiments of the present application.
[0082] It is obvious to a person skilled in the art that the present application is not limited to the details of the above exemplary embodiments, but can be implemented in other concrete forms without departing from the spirit or essential characteristics of the present application. Therefore, the embodiments should be considered in all aspects as illustrative and not restrictive, the scope of the present application is defined by the appended claims rather than the above description, and therefore all changes falling within the meaning and scope of the equivalent elements of the claims are intended to be included in the present application. Any reference signs in the claims should not be considered as limiting the claims involved. Furthermore, it is obvious that the word "comprising" does not exclude other units or steps, and the singular does not exclude the plural. The plurality of units or devices stated in the device claims can also be implemented by one unit or device through software or hardware. The words first, second, etc. are used to indicate names, not any specific order.
Claims
1. A method for automated testing, applied to a first device, wherein, The method comprises: obtaining a first device object in a first test script based on an automated test service, introducing a configuration file corresponding to each of one or more test cases into the first device object, wherein the configuration file comprises one or more key-value pair strings corresponding to one or more native test expressions about the test case, the first device object is used to initialize a second device object corresponding to a second device connected with the first device, the first device is a test device, the second device is a device to be tested, the native test expression is a native python expression written by calling a UiAutomator2 service, the native test expression comprises a native python script language located in the first test script, and the first test script is used to automatically control the second device to test the second device; loading the one or more key-value pair strings in the configuration file through the first device object, for each of the one or more key-value pair strings, obtaining at least one key information and corresponding at least one value information from the key-value pair string by parsing the key-value pair string, wherein the key-value pair string is converted into executable code for calling the native test expression corresponding to the key-value pair string based on the second device object, the at least one key information comprises element type key information, operation type key information and / or operation parameter key information; obtaining a corresponding UI component object according to first value information corresponding to the element type key information based on the second device object; based on the UI component object, converting the key-value pair string into a target method for calling the UI component object according to second value information corresponding to the operation type key information and / or third value information corresponding to the operation parameter key information, wherein the method name of the target method is the second value information, and the input parameter of the target method is the third value information; running the first test script to execute a test operation corresponding to the one or more native test expressions.
2. The method of claim 1, wherein, The method further comprises: based on the automated test service, creating one or more native test expressions corresponding to each of the one or more test cases; converting the one or more native test expressions into a configuration file corresponding to the test case.
3. The method of claim 2, wherein, The method further comprises: based on the automated test service, creating one or more native test expressions corresponding to each of the one or more test cases; wherein the converting the one or more native test expressions into a configuration file corresponding to the test case comprises: The second test script is converted to obtain a configuration file corresponding to the test case, wherein the configuration file comprises one or more key-value pair strings, and each key-value pair string corresponds to a native test expression.
4. The method of claim 2, wherein, The conversion of the one or more native test expressions into the configuration file corresponding to the test case comprises: For each native test expression in the one or more native test expressions, a request is initiated to a predetermined conversion interface based on the native test expression; A key-value pair string corresponding to the native test expression returned by the conversion interface is received; The configuration file corresponding to the test case is generated according to the key-value pair string corresponding to each native test expression.
5. The method of claim 4, wherein, The conversion interface is configured to perform regular matching on the native test expression to obtain one or more matching objects, to obtain at least one key information and at least one value information by analyzing the one or more matching objects, and to obtain the key-value pair string corresponding to the native test expression by assembling the at least one key information and the at least one value information.
6. The method of claim 5, wherein, The at least one key information comprises element type key information, operation type key information, and / or operation parameter key information.
7. The method of claim 1, wherein, The introduction of the configuration file corresponding to each test case in the one or more test cases into the first device object comprises: The configuration file corresponding to each test case in the one or more test cases is introduced into the first device object by calling a first method of the first device object, wherein the input of the first method is file identification information of the configuration file.
8. The method of claim 1, wherein, The first device object is obtained in the first test script based on the automated test service, comprising: The first device object is created in the first test script based on the automated test service.
9. The method of claim 1, wherein, The first device object is obtained in the first test script based on the automated test service, comprising: The first device object is obtained from a global variable of the first test script based on the automated test service. The method further comprises: The first device object is created in the first test script and stored in a global variable of the first test script.
10. A computer device for automated testing, comprising a memory, a processor and a computer program stored on the memory, characterized in that, The processor executes the computer program to implement the steps of the method according to any one of claims 1 to 9.
11. A computer readable storage medium having stored thereon computer programs / instructions, characterized in that, The computer program / instruction is executed by the processor to implement the steps of the method according to any one of claims 1 to 9.
12. A computer program product comprising a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the method according to any one of claims 1 to 9.