Method and apparatus for testing scripts

CN117667651BActive Publication Date: 2026-10-27TENCENT TECHNOLOGY (SHENZHEN) CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202211055288.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-08-31
Publication Date
2026-10-27
Estimated Expiration
2042-08-31

AI Technical Summary

Technical Problem

但是,当有大量的非指定账号的脚本运行时,两种任务间会产生账号资源竞争

Benefits of technology

[0019]本申请借助于两级排他标签,能够有效地管理测试账号的使用,使得指定同一测试账号的测试脚本通过排队的方式按顺序共用该账号,避免了账号资源不足的问题,满足大量的脚本测试需求,有效降低系统的建设成本和运营管理成本。由于两级排他标签的存在,避免了不同的测试脚本为了抢占账号资源而导致的至少一部分脚本无法获取指定测试账号,也避免了对账号不敏感的测试脚本长期占有账号资源而指定账号的脚本一直无法获取该资源,有效地降低了测试任务的反馈时间,避免了脚本由于长时间无法占有测试账号而导致脚本运行被‘饿死’而失败的情况,提高了任务的运行成功率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117667651B_ABST
    Figure CN117667651B_ABST
Patent Text Reader

Abstract

The application discloses a method and device for testing scripts, and corresponding computing equipment, storage medium, and computer program product. The method comprises: determining whether a script to be tested should be tested by a specified test account; if the script to be tested should be tested by the specified test account, determining an identifier of the test account and an identifier of a device used for testing the script to be tested; determining whether the test account is being used for testing other specified account scripts; if the test account is not being used for testing other specified account scripts, adding a first exclusion label with a serial number to the test account, and attempting to add a second exclusion label; in response to the second exclusion label being added to the test account, initiating testing of the script to be tested, and assigning the device and the test account with the added second exclusion label to the script to be tested for testing. By adding two levels of exclusion labels, an account can be reserved for scripts of a specified account, and the problem of the scripts being unable to obtain an account for a long time can be solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of software testing, and more specifically to a method for creating test scripts, an apparatus for creating test scripts, and corresponding computing devices, storage media, and computer program products. Background Technology

[0002] User Acceptance Testing (UAT, also known as beta testing) is a method for automatically generating test cases based on product requirement documents described in natural language. During UAT, numerous test types need to be covered, and each type of test task contains a large number of test scripts. Different types of test tasks often require different accounts. Depending on the test scenarios constructed by the UAT test cases, the accounts used need to be categorized and grouped. Script test cases that meet the same conditions can be tested using any available account within the corresponding account group during the account allocation phase. When a script does not run as expected, to reproduce the problem, it is often necessary to run a specific script using a designated account to ensure that the running conditions are completely consistent, avoiding the influence of non-critical factors introduced by different accounts on the test results, and achieving the goal of completely reproducing the problem.

[0003] In related technologies, one approach to run specific scripts using designated accounts is to configure a unique test account for each delivered script test case. Each time a script runs, a test account corresponding to the script's identifier (ID) is requested, ensuring the account used by the test case meets the script's running requirements. However, this method requires significant time and manpower to construct dedicated test accounts for each script, increasing system construction and operational costs. Furthermore, the resulting accounts can only satisfy specific script testing scenarios, resulting in a high return on investment. When an account becomes abnormal, the significant time spent reconstructing and associating a new account renders the relevant test script unusable. Another approach is to take the relevant test accounts offline in the script testing system and then manually reproduce the problem. However, this method cannot automatically generate valid test reports, preventing test results from being shared with others and hindering problem follow-up. Yet another method is to continuously poll the designated account's resources within the corresponding account group for scripts running on designated accounts. However, when a large number of scripts running on non-designated accounts are running, resource competition arises between the two types of tasks. To acquire the specified account, the script may take an excessively long time to run, and may even fail to function properly due to the inability to acquire the account for an extended period. In short, failing to properly allocate the specified account for script testing will hinder effective problem reproduction and significantly impair the efficiency of problem localization. Summary of the Invention

[0004] In view of the above, this application provides a method and apparatus for test scripts, as well as corresponding computing devices, storage media, and computer program products, in order to overcome some or all of the defects mentioned above and other possible defects.

[0005] According to one aspect of this application, a method for testing a script is provided, characterized in that the method includes: determining whether a script to be tested should be tested by a designated test account; in response to the script to be tested being tested by a designated test account, determining the identifier of the test account based on the identifier of the script to be tested, and determining the identifier of the device used to test the script to be tested; determining whether the test account is being used to test scripts of other designated accounts, wherein the other designated account scripts also specify the test account for testing; in response to the test account not being used to test scripts of other designated accounts, adding a first-level exclusive tag with a serial number to the test account based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account. This prevents the test account from being assigned to test scripts from non-designated accounts. An attempt is made to add a secondary exclusive tag with the same sequence number as the primary exclusive tag to the test account that has the primary exclusive tag added. The test account with the primary exclusive tag is allowed to add secondary exclusive tags with the same sequence number but not with different sequence numbers. The test account can only be used to test the script if a secondary exclusive tag is added, and the test account is only allowed to add one secondary exclusive tag. In response to the secondary exclusive tag being added to the test account, the test of the script is initiated, and the device and the test account with the secondary exclusive tag are assigned to the script for testing.

[0006] According to another aspect of the present invention, an apparatus for testing scripts is provided. The apparatus includes: an account determination module configured to determine whether a script to be tested should be tested by a designated test account; a device determination module configured to, in response to the script to be tested being tested by a designated test account, determine an identifier of the test account based on an identifier of the script to be tested, and determine an identifier of a device used to test the script to be tested; a script occupancy determination module configured to determine whether the designated test account is currently being used to test scripts of other designated accounts, wherein the other designated account scripts also specify the test account for testing; and an exclusive tag addition module configured to, in response to the test account not currently being used to test scripts of other designated accounts, add a numbered tag to the test account based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account. A first-level exclusive tag prevents the test account from being assigned to test scripts from non-designated accounts. The system attempts to add a second-level exclusive tag with the same sequence number as the first-level exclusive tag to the test account with the first-level exclusive tag. The test account with the first-level exclusive tag is allowed to add second-level exclusive tags with the same sequence number but not with different sequence numbers. The test account can only be used to test the script if a second-level exclusive tag is added, and the test account is only allowed to add one second-level exclusive tag. A test initiation module is configured to initiate a test on the script in response to the addition of the second-level exclusive tag to the test account, and to assign the device and the test account with the added second-level exclusive tag to the script for testing.

[0007] In some embodiments, the exclusive label adding module includes a device associated account consistency determination module, configured to determine whether the identifier of the device's current associated account is consistent with the identifier of the test account after adding a first-level exclusive label to the test account; and a second-level exclusive label first adding module, configured to add a second-level exclusive label to the test account in response to the identifier of the device's current associated account being consistent with the identifier of the test account.

[0008] In some embodiments, the exclusive label adding module further includes an account allocation judgment module, which is configured to determine whether the test account has been assigned to a non-specified account script for testing in response to the inconsistency between the identifier of the currently associated account of the device and the identifier of the test account; and a second-level exclusive label adding module, which is configured to add a second-level exclusive label to the test account in response to the fact that the test account has not been assigned to a non-specified account script for testing.

[0009] In some embodiments, the apparatus for the test script further includes a device first associated account update module configured to update the device’s current associated account to the test account.

[0010] In some embodiments, the exclusive label adding module further includes a secondary exclusive label blocking module, which is configured to not add a secondary exclusive label to the test account in response to the test account being assigned to a non-specified account script for testing.

[0011] In some embodiments, the apparatus for the test script further includes a script test blocking module configured to, after determining whether the specified test account is being used to test other specified account scripts, in response to the test account being used to test other specified account scripts, add a first-level exclusive tag with a serial number to the test account based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account, and not initiate the test of the script to be tested.

[0012] In some embodiments, the apparatus for the test script further includes a non-specified account script test initiation module, configured to initiate a test of the script to be tested in response to the script not being tested by a specified test account after determining whether the script to be tested should be tested by a specified test account; a second device determination module, configured to determine the identifier of the device used to test the script to be tested; a device associated account attribute determination module, configured to determine whether the attributes of the current associated account of the device meet the attribute requirements of the script to be tested for the test account; and a test account determination module, configured to determine the current associated account of the device as the test account in response to the current associated account of the device meeting the attribute requirements of the script to be tested for the test account, and to add a first-level exclusive tag and a second-level exclusive tag with the same sequence number to the test account based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account.

[0013] In some embodiments, the apparatus for the test script further includes an idle account allocation module, configured to, after determining whether the attributes of the current associated account of the device meet the attribute requirements of the test script for the test account, in response to the current associated account of the device not meeting the attribute requirements of the test script for the test account, use a test account that meets the attribute requirements of the test script for the test account and has not been added with a first-level exclusive tag as the test account of the test script, and add a first-level exclusive tag and a second-level exclusive tag with the same sequence number to the test account based on the identifier of the test script, the identifier of the device, and the identifier of the test account; and a second associated account update module, configured to update the associated account of the device to the test account.

[0014] In some embodiments, the apparatus for the test script further includes a first exclusive tag deletion module configured to delete the primary and secondary exclusive tags of the test account after the test script has completed testing.

[0015] In some embodiments, the apparatus for the test script further includes a tag expiration time setting module configured to set an expiration time for the primary exclusive tag when adding the primary exclusive tag to the test account, and / or to set an expiration time for the secondary exclusive tag when adding the secondary exclusive tag to the test account; and a second exclusive tag deletion module configured to delete the primary exclusive tag for the test account in response to the expiration time of the primary exclusive tag, and / or to delete the secondary exclusive tag for the test account in response to the expiration time of the secondary exclusive tag.

[0016] According to another aspect of the present invention, a computing device is provided, comprising: a memory configured to store computer-executable instructions; and a processor configured to perform the method according to any embodiment of the present application when the computer-executable instructions are executed by the processor.

[0017] According to another aspect of the present invention, a computer-readable storage medium is provided that stores computer-executable instructions, which, when executed, perform the method described according to any embodiment of the present application.

[0018] According to another aspect of the present invention, a computer program product is provided, comprising computer-executable instructions, wherein when the computer-executable instructions are executed by a processor, they perform the method described according to any embodiment of the present application.

[0019] This application utilizes a two-level exclusive tag system to effectively manage the use of test accounts. Test scripts specifying the same test account share that account sequentially through a queuing process, avoiding account resource shortages, meeting the needs of numerous script tests, and effectively reducing system construction and operation costs. The two-level exclusive tag system prevents at least some scripts from being unable to obtain a designated test account due to competing for account resources, and also prevents less account-sensitive test scripts from occupying account resources for extended periods while scripts specifying the account remain unable to access them. This effectively reduces test task feedback time and prevents scripts from failing due to prolonged inability to occupy test accounts, thus improving the task success rate. Attached Figure Description

[0020] Embodiments of this application will now be described in more detail with reference to the accompanying drawings, wherein: Figure 1 The illustrations depict exemplary application scenarios in which the technical solutions of the embodiments of this application can be implemented. Figure 2A flowchart illustrating a method for test scripting according to an embodiment of this application is shown schematically. Figure 3 and Figure 4 The effects of test script methods related to the art and test script methods according to embodiments of this application are illustrated schematically. Figure 5 A flowchart illustrating a method for a test script according to another embodiment of this application is shown schematically; Figure 6 The interface of the user acceptance testing system that initiates script tests from the task level is illustrated schematically. Figure 7 The interface of the script execution report of the user acceptance test system is shown schematically; Figure 8 The diagram illustrates the interface of the user acceptance testing system initiating script tests from the script level. Figure 9 The interface for displaying the test account attributes is shown schematically; Figure 10-12 A flowchart illustrating a method for test scripting according to an embodiment of this application is shown schematically. Figure 13 An exemplary structural block diagram of a test script apparatus according to an embodiment of this application is shown schematically; Figure 14 An example system is schematically illustrated, which includes an example computing device representing one or more systems and / or devices that can implement the various technologies described herein. Detailed Implementation

[0021] The technical solutions of this application will now be clearly and completely described with reference to the accompanying drawings. The described embodiments are merely some embodiments of this application, and not all embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of this application without creative effort are within the scope of protection of this application.

[0022] To facilitate understanding of the embodiments of this application, several concepts will be briefly introduced below: User acceptance testing: The final step in the software testing process. This type of testing aims to determine whether the software product can meet customer usage requirements in real-world scenarios and situations. The test results will be fed back to the software developers, allowing them to make final adjustments before releasing the commercial version of the software.

[0023] Account Group: In each test scenario constructed for user acceptance test cases, the accounts participating in the test typically need to have the same attributes. These accounts with the same attributes are defined as an account group.

[0024] Designated Account: When running a script to accept test cases, sometimes the script needs to be run by a specific test account to avoid affecting the test results due to different attribute values ​​of different accounts. For example, if a problem occurs during script execution, it needs to be rerun to reproduce the problem. In this case, the script needs to be rerun using the account used when the problem occurred to reproduce the problem under consistent conditions. This specific test account is referred to as a designated account in the context of this application.

[0025] As mentioned earlier, there are currently some problems and difficulties when using test scripts with designated accounts. For example, the need to create dedicated test accounts increases costs, or multiple test scripts compete for limited account resources, leading to excessively long script execution times or even script failures. This application proposes a test script method that can at least solve the above-mentioned problems.

[0026] Figure 1 Exemplary application scenarios in which the technical solutions according to embodiments of this application can be implemented are illustrated. For example... Figure 1 As shown, scenario 100 may include server 110 and terminal devices 130 and 150. These servers or devices can communicate with each other via network 190.

[0027] For example, the test script can be created by users 140 and 160 through their respective terminal devices 130 and 150 and uploaded to server 110. Server 110 can be a single server or a cluster of servers. Each terminal device 130 and 150 can connect to server 110 via network 190 so that each terminal device 130 and 150 can interact with server 110. When multiple servers are used, the servers may be connected to each other via a network to obtain data from each other. Different data can be stored on multiple servers, or different operations can be performed. The test script method according to the embodiments of this application can be performed on server 110.

[0028] Server 110 can also run other applications and store other data. For example, server 110 may include multiple virtual hosts to run different applications and provide different services. The server in this application may also be a cloud server providing basic cloud computing services such as cloud services, cloud databases, cloud computing, cloud functions, cloud storage, network services, cloud communication, middleware services, domain name services, security services, content delivery networks, and big data and artificial intelligence platforms. Terminal devices may be smart terminals such as smartphones, tablets, laptops, desktop computers, and smart TVs.

[0029] Furthermore, in this application, network 190 can be a wired network connected via a cable, fiber optic cable, or a wireless network such as 2G, 3G, 4G, 5G, Wi-Fi, Bluetooth, ZigBee, Li-Fi, etc.

[0030] The test script method according to the embodiments of this application can be completed on a server, in a combination of a server and a terminal device, or only on the terminal device. The following describes an embodiment of this application using communication between terminal devices 130 and 150 and server 110 as an example. For example, in this embodiment, the script to be tested can be created on terminal device 150 (e.g., a computer) and uploaded to server 110. User 160 can initiate a test of the script through terminal device 150. A User Acceptance Testing Platform (UAT platform) can also be set up on server 110. During the script testing process, this platform can allocate the necessary testing equipment (e.g., terminal device 130, which can be a physical device such as a mobile phone or a virtual device), as well as the necessary testing data and account. The account used for testing the script will log in on device 130 and then perform the script test. After the script test is completed, server 110 will generate a script execution report and display it to the user through terminal device 150. The user can re-initiate the script test task by operating terminal device 150, for example, to reproduce problems encountered in the previous script test. The process of allocating devices, accounts, and test scripts will be described in detail later.

[0031] Although the test script method in the above embodiments is implemented within a server, this application is not limited thereto. For example, the test script method can also be implemented within a terminal device. Furthermore, the scripts before and after the test can also be stored on the terminal device.

[0032] According to one aspect of this application, a method for test scripts is provided. Figure 2 A flowchart illustrating a method for using a test script according to an embodiment of this application is shown schematically. Figure 2 As shown, the test script method 200 includes the following steps: In step S205, it is determined whether the script to be tested should be tested by a designated test account; In step S210, in response to the script to be tested being tested by a designated test account, the identifier of the test account is determined based on the identifier of the script to be tested, and the identifier of the device used to test the script to be tested is determined. In step S215, it is determined whether the specified test account is being used to test other specified account scripts, wherein the other specified account scripts also specify the test account for testing. In step S220, in response to the fact that the designated test account is not being used to test other scripts to be tested, based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account, a first-level exclusive tag with a serial number is added to the test account, so that the test account cannot be assigned to test scripts of non-designated accounts. And an attempt is made to add a second-level exclusive tag with the same serial number to the test account with the first-level exclusive tag, wherein the test account with the first-level exclusive tag is only allowed to add a second-level exclusive tag with the same serial number and is not allowed to add a second-level exclusive tag with a different serial number. The test account can only be used to test the script to be tested when a second-level exclusive tag is added, and the test account with the second-level exclusive tag is not allowed to add a second-level exclusive tag with a different serial number. In step S225, in response to the addition of the secondary exclusive label to the test account, the test script is initiated, and the device and the test account with the added secondary exclusive label are assigned to the test script in the test.

[0033] These steps will be described in detail below.

[0034] First, in the test script method according to the embodiments of this application, it is determined whether the script to be tested should be tested by a designated test account (step S205). Before testing the script, the user selects whether the next test will be performed on a script for a designated account or a script for a non-designated account. In some embodiments, the script for a designated account may be a script that has previously encountered a problem and needs to be tested again with the same account to reproduce the problem.

[0035] Next, in response to the requirement that the script to be tested should be tested by a designated test account, the identifier of the designated test account is determined based on the identifier of the script to be tested, and the identifier of the device used to test the script to be tested is determined (step S210). The identifier of the test account can be an identifier that can uniquely identify the account, such as the account's ID number. The identifier of the device can be an identifier that can uniquely identify the device, such as the device's ID number. In this step, if the user selects that the script test to be performed next is a test that should be performed by a designated test account, then two operations will be performed: first, determining which account will be used to test the script, and second, assigning a device to this script test. When determining the account, the identifier of the script to be tested, such as the script's ID number, can be used to query which account should be used to test the script. For example, if the script was previously tested using a certain account and the script failed to run during the test (system error), an association can be established between the script's ID number and the account's ID number. This association can be stored in a specific storage system, such as a Redis (Remote Dictionary Server) storage system, for easy retrieval. When a specific account needs to be used to test the script, the associated account ID can be found based on the script's ID. Script testing must be performed on a device. When assigning a device for script testing, a device can be randomly selected from available devices.

[0036] After determining the identifier of the test account and the identifier of the device, it will be determined whether the specified test account is being used to test other specified account scripts, wherein the other specified account scripts also specify the test account for testing (step S215). Before testing the current script to be tested, the test account specified by the script to be tested may already be occupied by other scripts that specify that test account for testing, and cannot be immediately used for testing the current script to be tested. Therefore, this situation needs to be ruled out before testing the test script.

[0037] Then, in response to the fact that the designated test account is not currently being used to test the scripts of other designated accounts, a first-level exclusive tag with a serial number is added to the test account based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account. This prevents the test account from being assigned to test scripts of non-designated accounts, and an attempt is made to add a second-level exclusive tag with the same serial number to the test account with the first-level exclusive tag (step S220). Specifically, a test account with the first-level exclusive tag is only allowed to add second-level exclusive tags with the same serial number, but not with different serial numbers. The test account can only be used to test the script to be tested if a second-level exclusive tag has been added, and the test account is only allowed to add one second-level exclusive tag. The exclusive tag is generated based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account. Therefore, the exclusive tag associates the script, device, and account together. When the script is being tested, if an exclusive tag has been added, the corresponding device and account can be found. In this step, if it is determined that the test account specified by the current script to be tested is not being used to test other specified account scripts, a first-level exclusive tag with a serial number can be added to the test account in sequence, and then an attempt can be made to add a second-level exclusive tag with the same serial number to the test account. The term "attempt" can be understood as follows: since the test account may have already been assigned to other script test tasks, the second-level exclusive tag may not be added successfully, so this addition of the second-level exclusive tag is an attempt. The first-level exclusive tag and the second-level exclusive tag each have a unique serial number. It can be understood that this serial number corresponds to the association between the script, device, and account. The first-level exclusive tag and the second-level exclusive tag have the following attributes. In this application, an account can only be used for script testing if a second-level exclusive tag has been added to it. During script testing, by adding a second-level exclusive tag, the account used for testing the script is exclusively used by that script, so that the account will not be repeatedly assigned, preventing the account from being used by other scripts halfway through the script's execution and causing the original script account to disconnect. Furthermore, a second-level exclusive tag with the same sequence number can only be added to an account after a first-level exclusive tag has been added to that account; therefore, the two are added sequentially. The same first-level exclusive tag can be added repeatedly to an account; that is, first-level exclusive tags are reentrant. For example, a first-level exclusive tag with the same sequence number can be added to an account multiple times. When a first-level exclusive tag is added to an account, it's equivalent to informing the system in advance that a certain script intends to add a second-level exclusive tag to that account. This allows the system to reserve account resources in advance for the script's testing, preventing other scripts using non-designated accounts from obtaining those resources first. This ensures that scripts using the designated account can obtain the account during the account allocation phase after initiation and can therefore run normally.Furthermore, adding a first-level exclusive tag to an account does not affect scripts that are currently being tested, ensuring that scripts currently using that account can successfully complete their testing tasks and effectively avoid test failures.

[0038] Furthermore, there are relationships between primary exclusive tags with different serial numbers and between secondary exclusive tags with different serial numbers. When an account adds a secondary exclusive tag, that account cannot add secondary exclusive tags with other serial numbers, but it is allowed to add primary exclusive tags with different serial numbers. Moreover, a test account can only be used to test a script if a secondary exclusive tag has been added. This ensures that once a test account is used for a test script, that script exclusively uses that test account during the test, preventing the test account from being repeatedly assigned to other test scripts and causing the script undergoing testing to disconnect. Allowing the addition of primary exclusive tags with different serial numbers allows other test scripts to be marked in advance as intending to use that test account; that is, the newly added primary exclusive tags do not affect each other. This reserves account resources for other test scripts in advance, allowing multiple scripts that need to use the same specified test account to queue up, ensuring that all scripts can complete the test. Table 1 illustrates, for example, the principles for adding numbered primary and secondary exclusive tags to the same test account, where IX represents a primary exclusive tag, X represents a secondary exclusive tag, and the numbers after IX and X represent the serial numbers.

[0039] As shown in Table 1, if a test account has already been given a secondary exclusive tag with a certain number (such as X1), it can add primary exclusive tags with other numbers (such as IX2, IX3), but cannot add other secondary exclusive tags (such as X2, X3); if a test account has already been given a primary exclusive tag with a certain number (such as IX2), it can add secondary exclusive tags with the same number (such as X2) and primary exclusive tags with other numbers (such as IX3), and can also re-enter primary exclusive tags with the same number (such as IX2), but cannot add secondary exclusive tags with other numbers (such as X1, X3).

[0040] Next, in response to the addition of the secondary exclusive tag to the test account, the test script is initiated, and the device and the test account with the added secondary exclusive tag are assigned to the test script (step S225). After the secondary exclusive tag is added to the test account, the test task for the test script is initiated. After initiating the test, it is first necessary to request the test data and test account required for script execution from the UAT platform. As determined in step S205, the test script is a script tested by a designated test account. In this case, the UAT platform prioritizes assigning a locked test account to the test script based on the association between the test script established by the exclusive tag and the designated test account.

[0041] As described above, the test script method of this application, by utilizing two levels of exclusive tags, effectively manages the use of test accounts. This allows test scripts specifying the same test account to share that account sequentially through a queuing system, avoiding the problem of insufficient account resources, meeting the needs of a large number of script tests, and effectively reducing system construction and operation management costs. Due to the existence of the two levels of exclusive tags, it avoids at least some scripts being unable to obtain a specified test account due to different test scripts vying for account resources. It also avoids test scripts that are not sensitive to account resources occupying account resources for extended periods while scripts on the specified account are unable to obtain those resources. This effectively reduces the feedback time of test tasks and prevents scripts from failing due to prolonged inability to occupy test accounts, thus improving the success rate of task execution. Addressing various problems in related technologies, the test script method of this application does not require providing a dedicated test account for the script to be tested; therefore, the relationship between the script and the test account is not strongly bound. When an account anomaly occurs, another account can be selected to continue testing, avoiding the cessation of testing. Moreover, the test script method of this application embodiment does not require offline designated accounts and manual testing, and can directly generate a valid test report on the network, improving the system users' ability to quickly locate and solve problems.

[0042] Figure 3 and Figure 4 The effects of methods for test scripts related to the art and methods for test scripts according to embodiments of this application are illustrated schematically. Figure 3As shown, in the test script method of related technologies, Script 1 is a script without a specified account. During its execution, the user initiates Script 2 with a specified account. However, due to insufficient account resources, the specified account required by Script 2 is already being used by Script 1, causing Script 2 to fail to acquire the account resource and its initiation to fail. At this point, it can only wait for the next script scheduling. Subsequently, after Script 1 finishes running, the system will uniformly schedule multiple scripts, including Script 2, Script 3, and Script 4. Although Script 3 and Script 4 are not exclusively tested by the specified account, the specified account is also available to Script 3 and Script 4. Therefore, a situation arises where Script 3 and Script 4 simultaneously compete with Script 2 for the test account, greatly increasing the possibility that Script 2 will fail to acquire the account. If a large number of scripts that are not sensitive to accounts are continuously initiating tests, it may eventually cause Script 2 to exceed the script scheduling time limit due to its inability to acquire the specified account, resulting in abnormal termination of Script 2. Figure 4 As shown, in the test script method according to the embodiments of this application, during the execution of script one, the user initiates script two with a specified account. However, because the specified account required by script two is already being used by script one, script two fails to acquire the account resource. Figure 3 Unlike other scenarios, when a user initiates Script Two, the UAT script scheduling module adds a first-level exclusive tag for Script Two to the designated account. Thus, when the system schedules multiple scripts after Script One finishes running, although Script Three and Script Four may simultaneously compete with Script Two for the same test account, the tag for Script Two prevents Script Three and Script Four from using that account. Script Two can then acquire the account resource first, while Script Three and Script Four can subsequently acquire other accounts with the same attributes. If multiple scripts specify the same account resource simultaneously, the UAT script scheduling module schedules them sequentially based on the user's initiation time. This ensures that all scripts specifying an account can be scheduled and initiated sequentially by the UAT script scheduling module, while scripts not specifying an account can dynamically acquire other non-specified account resources during their execution. Figure 3 and Figure 4 The comparison shows that the test script method in this application embodiment enables the script for the specified account to acquire account resources first during the scheduling phase, while preventing other test scripts that do not acquire the account resources. Furthermore, the script currently holding the account can successfully complete the test, avoiding test failure.

[0043] In some embodiments, attempting to add a secondary exclusive label with the same sequence number to the test account that has been given the primary exclusive label includes: after adding the primary exclusive label to the test account, determining whether the identifier of the device's currently associated account is consistent with the identifier of the test account; and in response to the consistency between the identifier of the device's currently associated account and the identifier of the test account, adding a secondary exclusive label to the test account. In this embodiment, it can first be checked from the storage system whether the account previously assigned to the test script through the aforementioned steps is consistent with the test account specified this time. If so, a secondary exclusive label with the same sequence number as the primary exclusive label previously added to the account can be directly added to the account. In this way, if the account specified by the test script happens to be the account used in the last script test on the device, the account can be reused directly, achieving account reuse and avoiding repeated login and logout of the same account on the same device, which would affect the efficiency of script execution.

[0044] In some embodiments, attempting to add a secondary exclusive label with the same serial number to the test account that has been given the primary exclusive label further includes: in response to a discrepancy between the identifier of the currently associated account of the device and the identifier of the test account, determining whether the test account has been assigned to a non-specified account script for testing; and in response to a test account not being assigned to a non-specified account script for testing, adding a secondary exclusive label to the test account. A non-specified account script refers to a script that, when testing, does not require a specified account, but can be tested using any account within the corresponding account group. In this embodiment, if the account specified in the test script is not the account used for the last script test on the device, the account used for the last script test on the device needs to be logged out, and a new specified account needs to be logged in on the device. Before logging in to the new specified account, it is necessary to determine whether the specified account has been assigned for testing non-specified account scripts. If not, the account can be used for script testing. At this time, a second exclusive label can be added to the account. Specifically, this can be determined by obtaining a list of assigned accounts and then checking whether the specified account exists in that list. This step prevents the designated account from being used for testing scripts on non-designated accounts, thus avoiding the scripts from disconnecting due to account logout. In a further embodiment, after logging into the new designated account on the device, the device's associated account is updated to the test account. This way, when the device is subsequently used by other script testing activities, the device's current associated account can be queried to further determine whether to continue using the account for account reuse or to log out and log into the new designated account.

[0045] In some embodiments, the method further includes: in response to the test account being assigned to a non-designated account script for testing, not adding a secondary exclusive tag to the test account. In this embodiment, since the test account has been assigned to a non-designated account script for testing, in order to prevent the testing of the non-designated account script from being interrupted, adding a secondary exclusive tag to the test account is stopped, and an account allocation failure is returned.

[0046] In the preceding description, step S215 determines whether the specified test account is being used to test scripts of other specified accounts. In some embodiments, after determining whether the specified test account is being used to test scripts of other specified accounts, in response to the specified test account being used to test the scripts of other specified accounts, a first-level exclusive tag with a serial number is added to the test account based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account, and the test of the script to be tested is not initiated. In this embodiment, similar to step S220, when the specified test account is being used to test the scripts of other specified accounts, a first-level exclusive tag is also added to the test account. This first-level exclusive tag associates the script, device, and account together. Unlike step S220, in this embodiment, given that the specified test account is being used to test the scripts of other specified accounts, in order not to affect the testing of the scripts of other specified accounts, no second-level exclusive tag is attempted for the test account; instead, the testing of the script to be tested is stopped. Because a first-level exclusive tag has been added to this test account, even if the current script to be tested cannot use this test account, other scripts also cannot use it for testing. Therefore, when the script to be tested initiates a test again in the future, it will be able to preferentially use the designated test account with the first-level exclusive tag.

[0047] The preceding embodiments described the case where the script to be tested is a test script for a specified account. The test script method of this application also includes a process for handling when the script to be tested is a test script for a non-specified account. Figure 5 A flowchart illustrating a method for using a test script according to an embodiment of this application is shown schematically. Figure 5 As shown, the method includes the following steps: In step S505, after determining whether the script to be tested should be tested by the designated test account (that is, after step S205), in response to the script to be tested not being tested by the designated test account, the test of the script to be tested is initiated. In step S510, the identifier of the device used to test the script to be tested is determined; In step S515, it is determined whether the attributes of the currently associated account of the device meet the attribute requirements of the test script for the test account; In step S520, in response to the fact that the attributes of the current associated account of the device meet the attribute requirements of the test script for the test account, the current associated account of the device is determined as the test account, and based on the identifier of the test script, the identifier of the device, and the identifier of the test account, a first-level exclusive tag and a second-level exclusive tag with the same sequence number are added to the test account in sequence.

[0048] The steps described above are described below.

[0049] First, in response to the fact that the script to be tested should not be tested by the designated test account, the test of the script to be tested is initiated (step S505). As described above, when the script to be tested should be tested by the designated test account, a first-level exclusive tag is first added to the test account through various means to achieve the purpose of queuing. Then, after successfully adding a second-level exclusive tag to the designated account, the script test is initiated. In the embodiment where the script to be tested should not be tested by the designated test account, the script test is initiated directly and an exclusive tag is added to the test account during the script test. Because there are many accounts that can be used for testing the script to be tested that are not tested by the designated test account, there is no need to lock the test account or queue it in advance, so the script test can be initiated directly. In this embodiment, the purpose of adding two exclusive tags to the account is mainly to prevent the account from being repeatedly assigned, which would cause the script to be used by other scripts halfway through its execution, resulting in the script being tested being disconnected.

[0050] After initiating the test, the identifier of the device used to test the script under test is determined (step S510). In this step, the UAT platform assigns a device to the script test, and the identifier of the device is, for example, the device ID number. The assigned device may already be associated with a test account, which was associated with the device when the previous script test was executed.

[0051] Then, it is determined whether the attributes of the device's currently associated account meet the attribute requirements of the script to be tested for the test account (step S515). As mentioned earlier, depending on the different test scenarios constructed by the user acceptance test cases, the accounts used need to be categorized and grouped. Script test cases that meet the same conditions can be tested by randomly using any available account within the corresponding account group during the account allocation phase. Determining whether the attributes of the device's currently associated account meet the attribute requirements of the script to be tested for the test account can be done by determining whether the associated account belongs to the account group used to test the script to be tested. If the associated account belongs to the account group corresponding to the script to be tested, then the attributes of the associated account can be considered to meet the attribute requirements of the script to be tested for the test account. In this case, the associated account can be used as a test account for script testing.

[0052] After determining whether the attributes of the device's currently associated account meet the attribute requirements of the script under test for the test account, in response to the fact that the attributes of the device's currently associated account meet the attribute requirements of the script under test for the test account, the device's currently associated account is determined as the test account, and based on the identifier of the script under test, the identifier of the device, and the identifier of the test account, a first-level exclusive tag and a second-level exclusive tag with the same sequence number are added to the test account in sequence (step S520). As mentioned earlier, when the attributes of the device's associated account meet the attribute requirements of the script under test for the test account, the associated account can be used as a test account for testing the script under test. At this time, a second-level exclusive tag can be added to the account to ensure that the account will not be used by other scripts during script testing, causing the current script to disconnect. As mentioned earlier, in order to add a second-level exclusive tag, a first-level exclusive tag with the same sequence number needs to be added first. Therefore, in this step, a first-level exclusive tag and a second-level exclusive tag with the same sequence number need to be added to the test account in sequence. This tag reflects the association between the script under test, the device, and the test account.

[0053] By following the steps above, when assigning a test account to a script that does not specify a test account, the assigned test account is an unassigned account, and therefore will not affect the script that specifies a test account from obtaining the specified account.

[0054] In some embodiments, after determining whether the attributes of the currently associated account of the device meet the attribute requirements of the script to be tested for the test account, in response to the situation where the attributes of the currently associated account of the device do not meet the attribute requirements of the script to be tested for the test account, a test account that meets the attribute requirements of the script to be tested for the test account and has not been added with a first-level exclusive tag is selected as the test account of the script to be tested. Based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account, a first-level exclusive tag and a second-level exclusive tag with the same sequence number are sequentially added to the test account. Then, the associated account of the device is updated to the test account. In this embodiment, if the account originally associated with the device does not meet the attribute requirements of the script test for the account, then a test account needs to be reassigned for the test script. In this case, an account that meets the attribute requirements of the script to be tested for the test account and has not been assigned to other scripts needs to be selected as the test account of the script to be tested. Specifically, the system can retrieve a list of exclusive tags for assigned accounts, filter out accounts in the account group associated with the script test that haven't been assigned a first-level exclusive tag, and then attempt to add exclusive tags to the accounts in this unassigned account list one by one. If adding a tag is successful, the associated account for the device is updated to the test account, and the script continues execution. If adding an exclusive tag fails, the system sequentially tries the next account in the unassigned account list. If adding exclusive tags to multiple accounts in the list fails, a failure message indicating insufficient accounts is returned. The reason for attempting to add exclusive tags to accounts in the unassigned account list is that during multi-script, multi-task execution, multiple devices may simultaneously request account resources with the same attributes. If an account is only assigned to one mobile device, it might only successfully add an exclusive tag for one device and script, failing to add exclusive tags for other devices and scripts. If adding an exclusive tag fails, iterating through the next account in the list ensures that each device is assigned an account with the same attributes as much as possible. In other embodiments, if an unassigned account list is traversed without obtaining a usable test account, an allocation failure is returned, and the system waits for the next scheduling of the script test task.

[0055] To prevent accounts from being locked by exclusive tags for extended periods and thus unusable for testing other scripts, the test script method in this application also removes the exclusive tags from the test account when certain conditions are met. In some embodiments, the test script method further includes deleting the primary and secondary exclusive tags of the test account after the script to be tested completes the test. For example, after the script test ends, the exclusive tags of the test accounts assigned in the script test task are deleted. Specifically, a list of all accounts assigned to the task can be obtained based on the script test task ID, and the primary and secondary exclusive tags of the assigned accounts can be deleted in batches. After deleting the exclusive tags, the account can be used without restriction in the test tasks of other scripts. In other embodiments, the test script method further includes: setting an expiration time for the primary and secondary exclusive tags while adding the primary and secondary exclusive tags to the test account; and deleting the primary and secondary exclusive tags of the test account in response to the expiration time. In this embodiment, a timeout fallback logic is applied, and the exclusive tag has an expiration time when it is added to the account. When the expiration time arrives, the exclusive tag will be deleted to prevent account resources from being permanently locked due to abnormal test tasks.

[0056] To better understand the test script method of this application, the following description will be based on practical application. Figure 6 This diagram illustrates the interface of the UAT testing system for initiating script tests at the task level. Users can initiate script tests through this interface. The interface displays the ID of the script to be tested. This section also includes an option to reuse the test account. This option allows users to choose whether the upcoming test is for a script using a specified account or a script using a different account. A script using a specified account can be one that has previously encountered problems and needs to be tested again with the same account to reproduce the issue. Furthermore, users can edit the task ID and provide a description for the test task for later use when retrieving test results.

[0057] Figure 7 This diagram illustrates the interface of the UAT testing system's script execution report. This interface displays relevant information about the script test. For example, the test report summary may show the ID of the current test report. The test task ID is... Figure 6The interface displays the task ID entered by the user. The test function point describes the specific function the script tests. For example, for a script involving online payments, the test function point might be the payment collection function. The script execution report will also display the script ID and test ID, and may also include the test start time and duration. Furthermore, the script execution report will show whether the test was successful through the execution results. If unsuccessful, the specific reason for the test failure will be displayed in the background error message. In addition, this interface can include an entry point to re-execute the script that encountered an error, such as... Figure 7 The "Re-execute Script" button is located in the bottom right corner. Figure 8 This schematically illustrates the interface of the UAT testing system that initiates script tests at the script level. By clicking... Figure 7 The "Re-execute script" button on the interface shown allows you to enter... Figure 8 The interface. Figure 8 The interface can also be used to initiate script tests. This interface also includes the option to reuse the same test account. This option allows users to choose whether the next test will be performed on a script using a specific account or a script using a different account. The interface also allows customers to choose whether to use the same equipment as the previous test for the next test.

[0058] Figure 9 The diagram illustrates the display interface for test account attributes. This interface includes a User Identification Number (UIN), which serves as the account identifier (ID), and may also include the username. As mentioned earlier, account attributes can be used as a basis for grouping account groups.

[0059] By performing specific operations within the above interface, a method for launching a test script according to an embodiment of this application will be initiated. Figure 10-12 A flowchart illustrating a method for using a test script according to an embodiment of this application is shown schematically. Figure 10 As shown, when a user initiates a script test task, the UAT task scheduling module first determines whether the script test task is executed by a designated test account. If the script test task is run by a designated account, the first operation is executed; if the script test task is run by a non-designated account, the second operation is executed.

[0060] Figure 11 A flowchart of the first operation is shown. (For example...) Figure 11As shown, when a script test task is run by a specified account, the UAT task scheduling module first determines the ID of the specified account and requests idle device resources for the task, determining its device ID. Then, it checks if the test account is currently being used to test other scripts specified by that account. If so, it adds a reentrant first-level exclusive tag to the account using the Redis storage system based on the task ID, device ID, and account ID, stops the test, and skips the task's scheduling. This first-level exclusive tag can have a timeout period, after which it is automatically deleted. If the test account is not currently being used to test other scripts specified by that account, it adds a first-level exclusive tag to the account and attempts to add a second-level exclusive tag. Adding a second-level exclusive tag can specifically include first confirming whether the account already has a first-level exclusive tag, and then querying the Redis storage system to see if the previously assigned account on the current device matches the current test account. If they match, it directly adds a second-level exclusive tag to the account and resets the timeout period. This allows for account reuse, avoiding the impact on script execution efficiency caused by repeatedly logging out and logging in with the same account on the same device. If the account associated with the device is inconsistent with the specified account, or if the association has expired, the account needs to be reassigned. Specifically, the account reassignment process involves retrieving a list of already assigned accounts and determining whether the specified account required for the script test has already been assigned. If it has, adding a secondary exclusive tag to the test account must be stopped, and an assignment failure report should be sent to the UAT platform. If the account has not been assigned, a secondary exclusive tag is added to the account, and a timeout is set. Then, the account associated with the device can be updated to the current test account, and an assignment success report should be sent to the UAT platform. The UAT task scheduling module then initiates the script test task. At this point, since the specified account has been locked in advance through the exclusive tag, when the script retrieves the account from the UAT platform, it can directly return the account and reset the account's expiration time.

[0061] Figure 12 A flowchart of the second operation is shown. (For example...) Figure 12As shown, when a script test task is run on a non-specified account, the script test task can be initiated directly, and a device can be assigned to the test script, determining the device ID. Then, based on the device ID, it is determined whether the previously assigned account on the current device meets the test account attribute requirements of the current script test pair. If it meets the requirements, a first-level exclusive tag and a second-level exclusive tag are directly added to the account, and the expiration time is reset. If it does not meet the requirements, the account needs to be reassigned. The process of reassigning the account is as follows: First, delete the account association information on the device. Then, obtain the list of assigned accounts (that is, accounts with added first-level exclusive tags), filter out the list of unassigned accounts (that is, accounts without added first-level exclusive tags) in the account group associated with the script test data, which are accounts that meet the attribute requirements of the test account for the script to be tested and have not been assigned to other scripts, use them as test accounts, add first-level exclusive tags and second-level exclusive tags to the test accounts, then update the device-associated accounts, and the script continues to execute the test.

[0062] After the script test is completed, the UAT task scheduling module deletes the account's secondary exclusive tags and primary exclusive tags in sequence. Alternatively, after the expiration time of the exclusive tags, the module deletes the account's secondary exclusive tags and primary exclusive tags in sequence to prevent account resources from being permanently locked due to task anomalies.

[0063] The above method enables scripts meeting the same testing conditions to share a single account serially, even with limited resources. This queues scripts running on a designated account, ensuring they prioritize that account and achieving account reuse. Furthermore, it prevents scripts running on undesignated accounts from consuming allocated accounts, effectively reducing system construction and operational costs, alleviating account resource shortages, and meeting the needs of numerous daily testing scenarios, thus significantly improving the return on investment. Simultaneously, it avoids resource contention between test tasks, preventing undesignated account resources from being hoarded while scripts running on designated accounts are unable to access resources. This effectively improves task feedback time and prevents scripts from becoming unusable due to prolonged account hoarding, facilitating quick problem identification and resolution for system users.

[0064] According to another aspect of this application, an apparatus for a test script is provided. Figure 13An exemplary structural block diagram of a test script apparatus 1300 according to an embodiment of this application is schematically depicted. The test script apparatus 1300 includes: an account determination module 1305, a device determination module 1310, a script occupancy determination module 1315, an exclusive tag addition module 1320, and a test initiation module 1325. The account determination module 1305 is configured to determine whether a script to be tested should be tested by a specified test account. The device determination module 1310 is configured to, in response to the statement that the script to be tested should be tested by a specified test account, determine the identifier of the test account based on the identifier of the script to be tested, and determine the identifier of the device used to test the script to be tested. The script occupancy determination module 1315 is configured to determine whether the specified test account is currently being used to test scripts of other specified accounts, wherein the other specified account scripts also specify the test account for testing. The exclusive label adding module 1320 is configured to, in response to the specified test account not being used to test other specified account scripts, add a first-level exclusive label with a serial number to the test account based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account, and attempt to add a second-level exclusive label with the same serial number as the first-level exclusive label to the test account with the added first-level exclusive label. The test account, the first-level exclusive label, and the second-level exclusive label are configured such that the test account with the added first-level exclusive label is only allowed to add second-level exclusive labels with the same serial number and not allowed to add second-level exclusive labels with different serial numbers, and the test account with the added second-level exclusive label is not allowed to add second-level exclusive labels with other serial numbers. The test initiation module 1325 is configured to, in response to the addition of the second-level exclusive label to the test account, initiate a test on the script to be tested and assign the device and the test account with the added second-level exclusive label to the script to be tested.

[0065] Figure 14 System 1400 is schematically illustrated, including an example computing device 1410 representing one or more systems and / or devices that can implement the various technologies described herein. Computing device 1410 may be, for example, a server of a service provider, a device associated with a server, a system-on-a-chip, and / or any other suitable computing device or computing system. (Refer to above) Figure 13 The apparatus 1300 for the described test script can take the form of a computing device 1410. Alternatively, the apparatus 1300 for the test script can be implemented as a computer program in the form of an application 1416.

[0066] The example computing device 1410 shown includes a processing system 1411 communicatively coupled to each other, one or more computer-readable media 1412, and one or more I / O interfaces 1413. Although not shown, the computing device 1410 may also include a system bus or other data and command transfer system that couples the various components to each other. The system bus may include any or a combination of different bus architectures, such as a memory bus or memory controller, a peripheral bus, a universal serial bus, and / or a processor or local bus utilizing any of the various bus architectures. Various other examples, such as control and data lines, are also conceived.

[0067] Processing system 1411 represents the functionality of performing one or more operations using hardware. Therefore, processing system 1411 is illustrated as including hardware elements 1414 that can be configured as processors, function blocks, etc. This may include application-specific integrated circuits (ASICs) or other logic devices formed using one or more semiconductors in the hardware. Hardware element 1414 is not limited by the materials in which it is formed or the processing mechanism employed therein. For example, a processor may consist of semiconductors and / or transistors (e.g., integrated circuits (ICs)). In such a context, processor-executable instructions may be electronically executable instructions.

[0068] Computer-readable medium 1412 is illustrated as including memory / storage device 1415. Memory / storage device 1415 represents a memory / storage capacity associated with one or more computer-readable media. Memory / storage device 1415 may include volatile media (such as random access memory (RAM)) and / or non-volatile media (such as read-only memory (ROM), flash memory, optical disk, magnetic disk, etc.). Memory / storage device 1415 may include fixed media (e.g., RAM, ROM, fixed hard disk drive, etc.) and removable media (e.g., flash memory, removable hard disk drive, optical disk, etc.). Computer-readable medium 1412 may be configured in various other ways as further described below.

[0069] One or more I / O interfaces 1413 represent functions that allow users to input commands and information to computing device 1410 using various input devices and optionally also allow information to be presented to the user and / or other components or devices using various output devices. Examples of input devices include keyboards, cursor control devices (e.g., mice), microphones (e.g., for voice input), scanners, touch functionality (e.g., capacitive or other sensors configured to detect physical touch), cameras (e.g., capable of detecting non-touch-related motion as gestures using visible or invisible wavelengths (such as infrared frequencies), etc. Examples of output devices include display devices (e.g., monitors or projectors), speakers, printers, network interface cards, haptic-responsive devices, etc. Therefore, computing device 1410 can be configured to support user interaction in various ways as further described below.

[0070] The computing device 1410 also includes an application 1416. The application 1416 may be, for example, a software instance of the device 1300 for test scripts, and may implement the techniques described herein in combination with other elements in the computing device 1410.

[0071] This document describes various technologies within the general context of software and hardware components or program modules. Generally, these modules include routines, programs, objects, elements, components, data structures, etc., that perform specific tasks or implement specific abstract data types. The terms "module," "function," and "component" as used herein generally refer to software, firmware, hardware, or a combination thereof. The technologies described herein are platform-independent, meaning that these technologies can be implemented on a variety of computing platforms with various processors.

[0072] Implementations of the described modules and technologies may be stored on or transmitted across some form of computer-readable medium. Computer-readable medium may include a variety of media accessible by a computing device. By way of example and not limitation, computer-readable medium may include "computer-readable storage medium" and "computer-readable signal medium".

[0073] In contrast to simple signal transmission, carrier waves, or signals themselves, a "computer-readable storage medium" refers to a medium and / or device capable of persistently storing information, and / or a tangible storage device. Therefore, a computer-readable storage medium refers to a non-signal-bearing medium. Computer-readable storage media include hardware such as volatile and non-volatile, removable and non-removable media and / or storage devices implemented using methods or techniques suitable for storing information (such as computer-readable instructions, data structures, program modules, logic elements / circuits, or other data). Examples of computer-readable storage media may include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technologies, CD-ROM, digital versatile disc (DVD) or other optical storage devices, hard disks, cassette tapes, magnetic tapes, disk storage devices or other magnetic storage devices, or other storage devices, tangible media, or articles of art suitable for storing desired information and accessible by a computer.

[0074] "Computer-readable signal medium" refers to a signal-bearing medium configured to transmit instructions, such as via a network, to a computing device. Signal media typically embody computer-readable instructions, data structures, program modules, or other data in modulated data signals, such as carrier waves, data signals, or other transmission mechanisms. Signal media also includes any information transmission medium. The term "modulated data signal" refers to a signal in which one or more of its characteristics are set or altered to encode information. By way of example and not limitation, communication media include wired media such as wired networks or direct connections, and wireless media such as acoustic, RF, infrared, and other wireless media.

[0075] As previously described, hardware element 1414 and computer-readable medium 1412 represent instructions, modules, programmable device logic, and / or fixed device logic implemented in hardware, which in some embodiments can be used to implement at least some aspects of the techniques described herein. Hardware elements may include components of integrated circuits or systems-on-a-chip, application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), complex programmable logic devices (CPLDs), and other implementations or other hardware devices in silicon. In this context, hardware elements can serve as processing devices for executing program tasks defined by instructions, modules, and / or logic embodied by the hardware element, and as hardware devices for storing instructions for execution, such as the previously described computer-readable storage medium.

[0076] The foregoing combinations can also be used to implement the various techniques and modules described herein. Therefore, software, hardware, or program modules and other program modules can be implemented as one or more instructions and / or logic embodied on some form of computer-readable storage medium and / or by one or more hardware elements 1414. The computing device 1410 can be configured to implement specific instructions and / or functions corresponding to the software and / or hardware modules. Thus, for example, by using the computer-readable storage medium and / or hardware elements 1414 of a processing system, modules can be implemented at least partially in hardware as modules executable as software by the computing device 1410. Instructions and / or functions can be executable / operable by one or more articles of art (e.g., one or more computing devices 1410 and / or processing systems 1411) to implement the techniques, modules, and examples described herein.

[0077] In various embodiments, the computing device 1410 can be configured in various ways. For example, the computing device 1410 can be implemented as a computer-type device, including personal computers, desktop computers, multi-screen computers, laptop computers, netbooks, etc. The computing device 1410 can also be implemented as a mobile device, including mobile devices such as mobile phones, portable music players, portable gaming devices, tablet computers, multi-screen computers, etc. The computing device 1410 can also be implemented as a television-type device, including devices with or connected to a generally large screen in a leisure viewing environment. These devices include televisions, set-top boxes, game consoles, etc.

[0078] The techniques described herein can be supported by these various configurations of computing device 1410, and are not limited to specific examples of the techniques described herein. Functionality can also be implemented, wholly or partially, on “cloud” 1420 using distributed systems, such as through platform 1422 as described below.

[0079] Cloud 1420 includes and / or represents platform 1422 for resource 1424. Platform 1422 abstracts the underlying functionality of the hardware (e.g., servers) and software resources of cloud 1420. Resource 1424 may include applications and / or data that can be used when performing computer processing on a server located remotely from computing device 1410. Resource 1424 may also include services provided via the Internet and / or via subscriber networks such as cellular or Wi-Fi networks.

[0080] Platform 1422 can abstract resources and functions to connect computing device 1410 to other computing devices. Platform 1422 can also be used to abstract resource hierarchy to provide a corresponding level of hierarchy for any encountered needs for resource 1424 implemented via platform 1422. Therefore, in interconnect device embodiments, the implementation of the functions described herein can be distributed throughout system 1400. For example, functions can be implemented partly on computing device 1410 and partly through platform 1422, which abstracts the functions of cloud 1420.

[0081] This application provides a computer program product or computer program including computer instructions stored in a computer-readable storage medium. A processor of a computing device reads the computer instructions from the computer-readable storage medium and executes the computer instructions, causing the computing device to perform the test script provided in the various optional implementations described above.

[0082] It should be understood that, for clarity, embodiments of this application have been described with reference to different functional units. However, it will be apparent that, without departing from this application, the functionality of each functional unit may be implemented in a single unit, in multiple units, or as part of other functional units. For example, functionality described as being performed by a single unit may be performed by multiple different units. Therefore, references to specific functional units are considered merely as references to the appropriate units used to provide the described functionality, and not as indicating a strict logical or physical structure or organization. Thus, this application may be implemented in a single unit, or may be physically and functionally distributed among different units and circuits.

[0083] It will be understood that although terms such as "first," "second," etc., may be used herein to describe various devices, elements, components, or parts, these devices, elements, components, or parts should not be limited by these terms. These terms are used only to distinguish one device, element, component, or part from another device, element, component, or part.

[0084] Although this application has been described in conjunction with some embodiments, it is not intended to be limited to the specific forms set forth herein. Rather, the scope of this application is limited only by the appended claims. Additionally, although individual features may be included in different claims, these may be advantageously combined, and inclusion in different claims does not imply that such a combination of features is not feasible and / or advantageous. The order of features in the claims does not imply that the features must be in any particular order of their operation. Furthermore, in the claims, the word "comprising" does not exclude other elements, and the terms "a" or "an" do not exclude a plurality. Reference numerals in the claims are provided only as explicit examples and should not be construed as limiting the scope of the claims in any way.

Claims

1. A method for testing scripts, characterized in that, The method includes: Determine whether the script to be tested should be tested by a designated test account; In response to the requirement that the script to be tested should be tested by a designated test account, the identifier of the test account is determined based on the identifier of the script to be tested, and the identifier of the device used to test the script to be tested is determined. Determine whether the test account is being used to test scripts on other specified accounts, wherein the scripts on other specified accounts also specify the test account for testing. In response to the fact that the test account is not currently being used to test the script of the other designated account, based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account, a first-level exclusive tag with a serial number is added to the test account, so that the test account cannot be assigned to test non-designated account scripts. And an attempt is made to add a second-level exclusive tag with the same serial number as the first-level exclusive tag to the test account with the added first-level exclusive tag. The test account with the added first-level exclusive tag is allowed to add second-level exclusive tags with the same serial number but is not allowed to add second-level exclusive tags with different serial numbers. The test account can only be used to test the script to be tested if a second-level exclusive tag is added, and the test account is only allowed to add one second-level exclusive tag. In response to the addition of the secondary exclusive label to the test account, the test of the script to be tested is initiated, and the device and the test account with the added secondary exclusive label are assigned to the script to be tested for the purpose of the test.

2. The method as described in claim 1, wherein, Attempting to add a second-level exclusive label with the same serial number as the first-level exclusive label to the test account that has the first-level exclusive label added includes: After adding a first-level exclusive tag to the test account, determine whether the identifier of the device's currently associated account is consistent with the identifier of the test account; In response to the fact that the identifier of the currently associated account of the device is consistent with the identifier of the test account, a secondary exclusive tag is added to the test account.

3. The method as described in claim 2, wherein, The attempt to add a second-level exclusive label with the same serial number as the first-level exclusive label to the test account that has the first-level exclusive label also includes: In response to the discrepancy between the identifier of the currently associated account of the device and the identifier of the test account, it is determined whether the test account has been assigned to a non-specified account script for testing; In response to the fact that the test account was not assigned to a non-designated account script for testing, a secondary exclusive tag is added to the test account.

4. The method as described in claim 3, wherein, The method further includes: Update the device's current associated account to the test account.

5. The method as described in claim 3, wherein, The attempt to add a second-level exclusive label with the same serial number as the first-level exclusive label to the test account that has the first-level exclusive label also includes: In response to the fact that the test account has been assigned to a non-designated account script for testing, no secondary exclusive tag is added to the test account.

6. The method of claim 1, further comprising: After determining whether the specified test account is being used to test other specified account scripts, in response to the test account being used to test other specified account scripts, a first-level exclusive tag with a serial number is added to the test account based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account, and the test of the script to be tested is not initiated.

7. The method of claim 1, further comprising: After determining whether the script to be tested should be tested by the designated test account, in response to the script not being tested by the designated test account, the test of the script to be tested is initiated. Determine the identifier of the device used to test the script under test; Determine whether the attributes of the currently associated account of the device meet the attribute requirements of the test script for the test account; In response to the fact that the attributes of the device’s current associated account meet the attribute requirements of the test script for the test account, the device’s current associated account is determined as the test account, and based on the identifier of the test script, the identifier of the device, and the identifier of the test account, a first-level exclusive tag and a second-level exclusive tag with the same sequence number are added to the test account in sequence.

8. The method of claim 7, further comprising: After determining whether the attributes of the current associated account of the device meet the attribute requirements of the test script for the test account, in response to the fact that the attributes of the current associated account of the device do not meet the attribute requirements of the test script for the test account, the test account that meets the attribute requirements of the test script for the test account and has not been added with a first-level exclusive tag is taken as the test account of the test script. Based on the identifier of the test script, the identifier of the device, and the identifier of the test account, a first-level exclusive tag and a second-level exclusive tag with the same sequence number are added to the test account in sequence. Update the associated account of the device to the test account.

9. The method of claim 1, further comprising: After the script to be tested completes the test, delete the primary exclusive tag and the secondary exclusive tag of the test account.

10. The method of any one of claims 1, 6, 7, and 8, further comprising: When adding the first-level exclusive tag to the test account, an expiration time is set for the first-level exclusive tag, and / or, when adding the second-level exclusive tag to the test account, an expiration time is set for the second-level exclusive tag; In response to the expiration of the primary exclusive label, the primary exclusive label is deleted from the test account, and / or, in response to the expiration of the secondary exclusive label, the secondary exclusive label is deleted from the test account.

11. An apparatus for a test script, characterized in that, The device includes: The account determination module is configured to determine whether the script to be tested should be tested by a specified test account; A first device determination module is configured to, in response to the requirement that the script to be tested should be tested by a designated test account, determine the identifier of the test account based on the identifier of the script to be tested, and determine the identifier of the device used to test the script to be tested. The script usage determination module is configured to determine whether the specified test account is being used to test scripts of other specified accounts, wherein the scripts of other specified accounts also specify the test account for testing. An exclusive tag adding module is configured to, in response to the test account not being used to test other designated account scripts, add a first-level exclusive tag with a serial number to the test account based on the identifier of the script to be tested, the identifier of the device, and the identifier of the test account, so that the test account cannot be assigned to test non-designated account scripts, and attempt to add a second-level exclusive tag with the same serial number as the first-level exclusive tag to the test account with the added first-level exclusive tag, wherein the test account with the added first-level exclusive tag is allowed to add second-level exclusive tags with the same serial number but is not allowed to add second-level exclusive tags with different serial numbers, the test account can only be used to test the script to be tested if a second-level exclusive tag is added, and the test account is only allowed to add one second-level exclusive tag; The designated account script test initiation module is configured to initiate a test on the script to be tested in response to the addition of the secondary exclusive label to the test account, and to assign the device and the test account with the added secondary exclusive label to the script to be tested for the test.

12. A computing device, comprising: Memory, which is configured to store computer-executable instructions; A processor configured to perform the method according to any one of claims 1 to 10 when the computer-executable instructions are executed by the processor.

13. A computer-readable storage medium storing computer-executable instructions that, when executed, perform the method according to any one of claims 1 to 10.

14. A computer program product comprising computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, perform the method according to any one of claims 1 to 10.

Citation Information

Patent Citations

  • Electronic equipment response method, device, electronic equipment and readable storage medium

    CN110362493A

  • Applet debugging method, device and equipment and storage medium

    CN111078554A