CN110543429B - Test case debugging method, device and storage medium - Google Patents

Test case debugging method, device and storage medium Download PDF

Info

Publication number
CN110543429B
CN110543429B CN201910857347.0A CN201910857347A CN110543429B CN 110543429 B CN110543429 B CN 110543429B CN 201910857347 A CN201910857347 A CN 201910857347A CN 110543429 B CN110543429 B CN 110543429B
Authority
CN
China
Prior art keywords
step code
code
target step
target
test case
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910857347.0A
Other languages
Chinese (zh)
Other versions
CN110543429A (en
Inventor
骆春光
王惠惠
曾波
曾庆熙
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
WeBank Co Ltd
Original Assignee
WeBank Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by WeBank Co Ltd filed Critical WeBank Co Ltd
Priority to CN201910857347.0A priority Critical patent/CN110543429B/en
Publication of CN110543429A publication Critical patent/CN110543429A/en
Application granted granted Critical
Publication of CN110543429B publication Critical patent/CN110543429B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The invention discloses a test case debugging method, a device and a storage medium, wherein the method comprises the steps of determining a first target step code in a current test case; adding the first target step code to the blocking queue and executing the first target step code when the first target step code is executable; judging whether the first target step code is executed successfully or not and outputting an execution result. According to the method and the device, the first target step code in the use case is determined, so that the tester can locate any step in the current test case, and the user experience is improved; by judging whether the first target step code is executable or not, a tester can set the skip step code in advance; by executing the executable first target step code separately, execution time is reduced; by judging and outputting the execution result of executing the single step, the execution result of the single step is directly obtained, and the debugging efficiency is improved.

Description

Test case debugging method, device and storage medium
Technical Field
The present invention relates to the field of financial technology (Fintech), and in particular, to a test case debugging method, apparatus, device, and computer readable storage medium.
Background
With the development of computer technology, more and more technologies (big data, distributed, blockchain, artificial intelligence, etc.) are applied in the financial field, and the traditional financial industry is gradually changing to the financial technology (Fintech), but due to the requirements of security and real-time performance of the financial industry, higher requirements are also put forward on the technologies. For a software product testing system of a bank, currently, a tester usually executes the whole case after writing the test case to check whether the steps of the case are accurate. If the error step occurs, the tester needs to repeatedly execute the whole use case after modifying the error step, and judges whether the modified step can be successfully executed or not until the whole use case is successfully executed. In the process of carrying out positioning analysis on the problems in the use cases, a tester needs to repeatedly execute the use cases, but most of actually executed steps do not help in positioning analysis of the problems, and only a few key steps can find the problems, so that the problem of low debugging efficiency in the whole debugging process of the use cases is caused.
Disclosure of Invention
The invention mainly aims to provide a test case debugging method, a device and a computer readable storage medium, and aims to solve the technical problem of low debugging efficiency in the whole process of debugging a test case.
In order to achieve the above object, the present invention provides a test case debugging method, which includes the following steps:
when a case debugging instruction is received, determining a first target step code in a current test case based on related parameters in the case debugging instruction, wherein the related parameters at least comprise operation type parameters and a page element positioning path;
adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not;
if the first target step code is executable, acquiring and executing the first target step code from the blocking queue;
and verifying whether the first target step code is successfully executed according to a preset verification mode, and outputting an execution result of the first target step code.
Optionally, after the step of verifying whether the first target step code is executed successfully according to the preset verification mode and outputting the execution result of the first target step code, the method further includes:
if the execution result shows that the first target step code fails to be executed, receiving a modified first target step code input by a user so as to update the first target step code;
Executing the modified first target step code, returning to execute the step of verifying whether the first target step code is successfully executed according to a preset verification mode, and outputting an execution result of the first target step code until the modified first target step code is successfully executed
Optionally, after the step of verifying whether the first target step code is executed successfully according to the preset verification mode and outputting the execution result of the first target step code, the method further includes:
and if the execution result shows that the first target step code is successfully executed, acquiring a step code to be judged in the current test case as a second target step code, and judging whether the second target step code is executable or not, wherein the step code to be judged is the next step code of the first target step code which is successfully executed.
Optionally, before the step of adding the first target step code to a preset blocking queue and determining whether the first target step code is executable, the method further includes:
creating and circularly monitoring the blocking queue, and judging whether the blocking queue is empty;
If the blocking queue is empty, executing the steps of: and adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not.
Optionally, after the step of creating and cyclically monitoring the blocking queue and determining whether the blocking queue is empty, the method further includes:
if the blocking queue is not empty, waiting for the execution of the existing step codes in the blocking queue to be completed, and executing the steps: and adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not.
Optionally, before the step of creating and cyclically monitoring the blocking queue and determining whether the blocking queue is empty, the method further includes:
establishing connection with a browser, generating a time domain session, and acquiring an ID value of the time domain session so as to display the running process of step codes in the browser;
and adding the ID value into the uniform resource locator of the current test case, and acquiring and displaying a step code debugging page of the browser according to the uniform resource locator.
Optionally, after the step of adding the first target step code to a preset blocking queue and determining whether the first target step code is executable, the method further includes:
If the first target step code is not executable, generating and displaying non-executable prompt information corresponding to the first target step code so as to prompt a user that the first target step code is preset to be non-executable;
deleting the first target step code from the blocking queue, and acquiring a step code to be executed in the current test case as a third target step code, wherein the step code to be executed is the next step code of the first target step code which is not executable;
and adding the third target step code to the blocking queue, and judging whether the third target step code is executable.
The test case debugging method as described above, further includes: if all executable step codes in the current test case are detected to be executed successfully, generating and displaying debugging completion information of the current test case.
In addition, in order to achieve the above object, the present invention also provides a test case debugging apparatus, including:
the target code determining module is used for determining a first target step code in the current test case based on related parameters in the case debugging instruction when the case debugging instruction is received, wherein the related parameters at least comprise operation type parameters and page element positioning paths;
The target code judging module is used for adding the first target step code to a preset blocking queue and judging whether the first target step code is executable or not;
the target code executing module is used for acquiring and executing the first target step code from the blocking queue if the first target step code is executable;
and the target code verification module is used for verifying whether the first target step code is successfully executed according to a preset verification mode and outputting an execution result of the first target step code.
Optionally, the test case debugging device further includes:
the target code modification module is used for receiving the modified first target step code input by a user if the execution result shows that the first target step code fails to be executed, so as to update the first target step code;
and the target code debugging module is used for executing the modified first target step code, returning to execute the step of verifying whether the first target step code is successfully executed according to a preset verification mode, and outputting an execution result of the first target step code until the modified first target step code is successfully executed.
Optionally, the test case debugging device further includes:
the code obtaining judging module is used for obtaining a step code to be judged in the current test case as a second target step code if the execution result shows that the first target step code is successfully executed, and judging whether the second target step code is executable or not, wherein the step code to be judged is the next step code of the first target step code which is successfully executed.
Optionally, the object code execution module is further configured to:
creating and circularly monitoring the blocking queue, and judging whether the blocking queue is empty;
if the blocking queue is empty, executing the steps of: and adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not.
Optionally, the object code execution module is further configured to:
if the blocking queue is not empty, waiting for the execution of the existing step codes in the blocking queue to be completed, and executing the steps: and adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not.
Optionally, the test case debugging device further includes:
The time domain session generation module is used for establishing connection with the browser, generating a time domain session and acquiring an ID value of the time domain session so as to display the running process of the step code in the browser;
and the debugging page acquisition module is used for adding the ID value into the uniform resource locator of the current test case, and acquiring and displaying the step code debugging page of the browser according to the uniform resource locator.
In addition, in order to achieve the above object, the present invention also provides a test case debugging apparatus, including: the system comprises a memory, a processor and a test case debugging program which is stored in the memory and can run on the processor, wherein the test case debugging program realizes the steps of the test case debugging method when being executed by the processor.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a test case debugging program which, when executed by a processor, implements the steps of the test case debugging method described above.
The invention provides a test case debugging method, a test case debugging device and a computer readable storage medium. The method for debugging the test case comprises the steps that when a test case debugging instruction is received, a first target step code in the current test case is determined based on relevant parameters in the test case debugging instruction; adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not; and if the first target step code is executable, acquiring and executing the first target step code from the blocking queue. By means of the method, the first target step code in the use case is determined according to the relevant parameters, so that a tester can accurately position any step in the current test case, and user experience is improved; the first target step code is put into the blocking queue, so that the first target step code is preferentially executed at present, and the situation of queue execution of other step codes is avoided; by judging whether the first target step code is executable or not, a tester can set some step codes to be skipped in advance, so that the time for executing the step codes is reduced, and by executing the executable first target step code, the tester can debug the first target step code, and the debugging efficiency is improved, so that the technical problem of low debugging efficiency in the whole use case debugging process is solved.
Drawings
FIG. 1 is a schematic diagram of a device architecture of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart of a first embodiment of a test case debug method according to the present invention;
fig. 3 is a detailed flowchart illustrating steps of the first embodiment of the present invention in fig. 2.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of an apparatus structure of a hardware running environment according to an embodiment of the present invention.
The test case debugging device of the embodiment of the invention can be a PC or a server device, and a Java virtual machine is operated on the device.
As shown in fig. 1, the test case debugging apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
It will be appreciated by those skilled in the art that the structure shown in fig. 1 is not limiting of the present solution and may include more or fewer components than shown, or certain components may be combined, or a different arrangement of components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a test case debugging program may be included in the memory 1005, which is one type of computer storage medium.
In the apparatus shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server, and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be used to call a test case debugger stored in the memory 1005 and perform operations in a test case debugging method described below.
Based on the hardware structure, the embodiment of the test case debugging method is provided.
Referring to fig. 2, fig. 2 is a flow chart of a first embodiment of the test case debugging method of the present invention, where the test case debugging method includes:
step S10, when a case debugging instruction is received, determining a first target step code in a current test case based on related parameters in the case debugging instruction, wherein the related parameters at least comprise operation type parameters and a page element positioning path;
Currently, when debugging a program, a tester usually executes the whole case after writing the test case to check whether the steps of the case are accurate. If the error step occurs, the tester needs to repeatedly execute the whole use case after modifying the error step, and judges whether the modified step can be successfully executed or not until the whole use case is successfully executed. In the process of carrying out positioning analysis on the problems in the use cases, a tester needs to repeatedly execute the use cases, but most of actually executed steps do not help in positioning analysis of the problems, and only a few key steps can reproduce the problems, so that the problem of low debugging efficiency in the whole debugging process of the use cases is caused. For example, after a tester executes a UI automation test case including 10 step codes, after the test case is executed for the first time, the result of the first execution shows that the third step code reports errors. The tester carries out the first modification on the third step code, then executes the test case for the second time, and discovers that the third step code after the first modification is still reported to be wrong. And executing the whole test case for the fifth time until the tester modifies the third step code for the fifth time, wherein the result of the fifth execution shows that the third step code is successfully executed, but the seventh step code starts to report errors. The above specific problem shows that the whole use case of multiple vehicles is repeatedly executed in order to modify the problem of successful single step code, and the efficiency of the whole debugging process is very low.
In this embodiment, in order to solve the above-mentioned problem, the present invention provides a test case debugging method, that is, according to relevant parameters, a first target step code in a case is determined, so that a tester can accurately locate any step in the current test case, thereby improving user experience; the first target step code is put into the blocking queue, so that the first target step code is preferentially executed at present, and the situation of queue execution of other step codes is avoided; by judging whether the first target step code is executable or not, a tester can set some step codes to be skipped in advance, so that the time for executing the step codes is reduced, and by executing the executable first target step code, the tester can debug the first target step code, and the debugging efficiency is improved, so that the technical problem of low debugging efficiency in the whole use case debugging process is solved. The test case debugging method is applied to a server side and a user side, and is realized through two threads and a blocking queue of a producer and a consumer by adopting a producer-consumer mode. The producer-consumer model is a design model. The producer and the consumer share the same storage space in the same time period, the producer adds the product into the storage space, the consumer takes the product out of the storage space, and when the storage space is empty, the consumer is blocked; when the storage space is full, the producer blocks. In the present invention, the producer and consumer share a blocking queue. The producer thread adds step codes to the blocking queue, and the consumer thread takes the step codes out of the blocking queue for execution. Specifically, the case debugging instruction includes a debugging start instruction and a step selection instruction, wherein the debugging start instruction is an instruction for starting a debugging mode, and the step selection instruction is an instruction for a tester to select a certain step code in the current test case. The tester clicks on a code debugging page of the user side to start debugging, the debugging mode is set to be true, and the user side receives a debugging starting instruction triggered by the tester and starts the debugging mode. The tester starts a user browser on the server at the user end, the user end initiates a time domain Session request to the server end, the server end receives the Session request and stores the Session, so that the Session is maintained between the user browser and the user end. The user side detects the test case which is ready to be debugged currently and acquires the uniform resource locator (URL, uniform Resource Locator) of the current test case. And the user side opens a browser page corresponding to the current test case according to the URL. The user side starts the debugging executor and determines a first target step code in the current test case. The first target step code is a step code which needs to be debugged currently, and if other step codes exist before the first target step code in the current test case, the first target step code is not associated with the other step codes. And the user receives the step selection instruction, and determines a first target step code corresponding to the relevant parameter in the current test case according to the relevant parameter. The related parameters at least comprise operation type parameters of the first target step code and a path for positioning the page element, and can also comprise input values and variables corresponding to the first target step code, wherein the operation type parameters can be delay, clicking, mouse hovering and the like. The determination mode of the first target step code may be that a tester manually adds the relevant parameter corresponding to the first target step code in the relevant parameter page of the step code, or may be that the user side directly obtains the relevant parameter corresponding to the first target step code when jumping from the last step code to the first target step according to an automatic jump rule. In a specific embodiment, if the first target step code is the fourth step code in the current test case, the tester inputs an operation type parameter "mouse hover" corresponding to the fourth step code in a debug page of the browser, positions a path "// div =" menu-root "]/div" and an input value "3", and the user side can determine the fourth step code in the current test case according to the three parameters input by the tester.
Step S20, adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not;
in this embodiment, the user side obtains a first target step code from the current test case, and adds the first target step code to a preset blocking queue. Wherein a blocking queue is a queue that supports two additional operations on a queue basis. When the queue is full, the queue blocks the producer thread until the queue is not full; when the queue is empty, the consumer thread waits for the queue to become non-empty. The blocking queue is just suitable for the stored queue, and the step code for executing debugging is stored in the queue. The user side judges whether the first target step code is an executable code. Specifically, the user side sets a skip field in the local database in advance, and judges whether the first target step code is an executable step code according to whether the skip field exists in the first target step. In the above procedure, the producer thread is used to add the acquired first target step code to the blocking queue.
Step S30, if the first target step code is executable, acquiring and executing the first target step code from the blocking queue;
In this embodiment, if the user side determines that the first target step code is an executable code, the user side obtains the first target step code from the blocking queue, and drives the server to execute the first target step code through the debug executor in the current debug mode. Wherein the debug executor is a module for executing the use case step code in the debug mode. The specific judgment conditions can be as follows: if the skip field does not exist in the first target step code, the user terminal judges that the first target step code is an executable code. During execution, the browser synchronously displays the relevant operations of the first target step code, such as clicking a button, entering a user name, etc. The server side records the log and the execution result of the first target step code, and intercepts and stores the screenshot of the first target step code execution process. In the above procedure, the consumer thread is used to obtain and execute the first target step code from the blocking queue.
Step S40, verifying whether the first target step code is successfully executed according to a preset verification mode, and outputting an execution result of the first target step code.
In this embodiment, the tester selects one or more verification modes from the preset verification modes before the first target step code is executed, the user receives a verification mode selection instruction triggered by the tester, verifies whether the first target step code is executed successfully according to the selected verification mode, and outputs the execution result of the first target step code on the page. The preset verification mode may be: judging whether the execution page screenshot of the first target step is matched with a preset picture or not through an image recognition algorithm; judging whether the page element value corresponding to the first target step code is matched with a preset value or not; checking the marking attribute of the page element corresponding to the first target step code through an interface provided by driving software Selenium WebDriver in the selenium element frame webpage, and judging whether the page element can be edited; and judging whether the page element value corresponding to the first target step code contains preset characters and the like. Specifically, the user side checks whether the editable attribute value of the page element corresponding to the first target step code is true through the interface provided by the Selenium WebDriver framework. In the above process, the consumer thread is configured to determine whether the first target step code is executed successfully.
The invention provides a test case debugging method, a test case debugging device and a computer readable storage medium. The method for debugging the test case comprises the steps that when a test case debugging instruction is received, a first target step code in the current test case is determined based on relevant parameters in the test case debugging instruction, wherein the relevant parameters at least comprise operation type parameters and page element positioning paths; adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not; if the first target step code is executable, acquiring and executing the first target step code from the blocking queue; and verifying whether the first target step code is successfully executed according to a preset verification mode, and outputting an execution result of the first target step code. By means of the method, the first target step code in the use case is determined according to the relevant parameters, so that a tester can accurately position any step in the current test case, and user experience is improved; the first target step code is put into the blocking queue, so that the first target step code is preferentially executed at present, and the situation of queue execution of other step codes is avoided; by judging whether the first target step code is executable or not, a tester can set some step codes to be skipped in advance, so that the time for executing the step codes is reduced, and by executing the executable first target step code, the tester can debug the first target step code, and the debugging efficiency is improved; by judging the execution condition of the first target step code and outputting a corresponding execution result, a tester can directly obtain the execution result of the first target step code without spending time executing other steps in the current embodiment, so that the debugging efficiency of the tester is improved, and the technical problem of low debugging efficiency in the whole use case debugging process is solved.
Referring to fig. 3, fig. 3 is a schematic diagram of a refinement flow according to a first embodiment of the present invention.
Based on the first embodiment shown in fig. 2, a second embodiment of the test case debugging method of the present invention is presented. In this embodiment, after the step S40, the method further includes:
step S50, if the execution result shows that the first target step code fails to be executed, receiving a modified first target step code input by a user so as to update the first target step code;
in this embodiment, the user terminal maintains connection with the server terminal through the time domain session identity code SessionID, and the server terminal displays the execution result corresponding to the first target step code on the page of the browser. And after the user side judges that the execution of the first target step code fails according to the preset verification mode, the first target step code is modified on the page of the browser. The user side saves the relevant modification data to a local database. The modified first target step code can be the first target step code which is re-edited on the page of the browser by the tester in real time; or after adding a new step code before the first target step code, the new step code is combined with the first target step code.
Step S60, executing the modified first target step code,and returning to the step of executing the execution of the first target step code according to the preset verification mode, verifying whether the execution of the first target step code is successful, and outputting the execution result of the first target step code until the execution of the modified first target step code is successful
In this embodiment, the debug module drives the server to execute the modified first target step code through the connection between the server and the user maintained by the SessionID. And the server displays the execution process and the result of the modified first target step code on the page of the browser. If the execution result of the first target step code after the first modification is still the display execution failure, the tester will modify the first target step code again and execute the first target step code until the first target step code after multiple modifications can be successfully executed and output the execution success result. The modified first target step code may be a first target step code after being modified once, or may be a first target step code after being modified multiple times, where the specific number of modification times is specific to the specific situation, but the modified first target step code must be a modified first target step code that can be successfully operated.
Further, after step S40, the method further includes:
and step S01, if the execution result shows that the first target step code is successfully executed, acquiring a step code to be judged in the current test case as a second target step code, and judging whether the second target step code is executable or not, wherein the step code to be judged is the next step code of the first target step code which is successfully executed.
In this embodiment, the user terminal maintains connection with the server terminal through the SessionID, and the server terminal displays the execution result corresponding to the first target step code on the page of the browser. If the user side judges that the first target step code is successfully executed according to the preset verification mode, the debugging page of the server side synchronously displays the successful execution result of the first target step code, and then the debugging of the first target step is completed. The user side obtains a step code to be judged in the current test case as a second target step code. The second target step code is the next step code of the first target step code successfully executed in the current test case. The consumer thread is used in this embodiment to drive the server to display the result of the execution of the first target step code and to execute the modified first target step code.
The invention provides a test case debugging method, a test case debugging device and a computer readable storage medium. According to the test case debugging method, the first target step code which fails to be executed is debugged until the debugging is successful, so that a tester can independently debug the first target step code, the debugging efficiency is improved, and the user experience is improved; by automatically jumping to the next step after the code of the first target step is successfully executed, the operation of a tester is simplified, and the user experience is improved.
A third embodiment of the test case debugging method of the present invention is presented based on the first embodiment shown in fig. 2 and not shown in the drawings.
In this embodiment, before step S20, the method further includes:
step a, creating and circularly monitoring the blocking queue, and judging whether the blocking queue is empty;
in this embodiment, the client creates a blocking queue and loops listening to this blocking queue. The user terminal judges whether the step code in the blocking queue is empty. The step code storage space of the blocking queue is preset to be capable of adding only one step code at a time. In a specific embodiment, to determine whether the blocking queue is empty, the ue generates a corresponding return value whenever a step code is added or deleted in the blocking queue. And the user terminal judges whether the current return value is matched with the preset return value or not according to the acquired current return value.
Step b, if the blocking queue is empty, executing the steps of: and adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not.
In this embodiment, if the ue determines that the step code in the blocking queue is empty, the ue adds the first target step code to the blocking queue, and determines whether the first target step code is executable. In a specific embodiment, if the current return value matches with the preset return value, the ue determines that the step code in the blocking queue is empty.
Step c, if the blocking queue is not empty, waiting for the execution of the existing step codes in the blocking queue to be completed, and executing the steps: and adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not.
In this embodiment, if the ue determines that the step code in the blocking queue is not empty, the ue waits for the original step code in the blocking queue to be fetched and executed. After the debugging of the original step code is completed, the user terminal judges whether the current blocking queue is empty or not. Because the blocking queue is preset to only cache one step code, and the original step code is executed, the user side obtains the information that the current blocking queue is empty. The user side adds the first target step code into the currently empty blocking queue and judges whether the first step code is executable or not.
Further, in this embodiment, before step a, the method further includes:
step d, establishing connection with a browser, generating a time domain session, and acquiring an ID value of the time domain session so as to display the running process of the step code in the browser;
in this embodiment, a tester starts a user browser on a server, the user initiates a time domain Session request to the server, the server receives the Session request, and acquires and stores a Session id corresponding to the Session request, so as to maintain connection between the user browser on the server and the user browser on the user terminal through the Session id, and drive the browser in the server to execute step codes and display the running process of the step codes.
And e, adding the ID value into the uniform resource locator of the current test case, and acquiring and displaying a step code debugging page of the browser according to the uniform resource locator.
In this embodiment, the user side detects a test case currently ready for debugging, and obtains a uniform resource locator (URL, uniform Resource Locator) of the current test case. The user side adds the ID value to the URL of the current test case, and obtains a step code debugging page corresponding to the current test case according to the URL. The consumer thread is used in this embodiment to loop snoop blocking queues.
The invention provides a test case debugging method, a test case debugging device and a computer readable storage medium. The test case debugging method further monitors whether the blocking queue is empty or not, and only waits for the blocking queue to be empty again when the blocking queue is full, and then puts the first target step code into the blocking queue, so that the first target step code can only be independently executed in the current test case, and interference of step codes outside the blocking queue is avoided; the ID value in the time domain session is kept connected with the server, so that a single step code is not disconnected immediately after the execution fails, and the step code can be continuously modified and executed until the debugging is successful, and the debugging efficiency is improved.
A fourth embodiment of the test case debugging method of the present invention is presented based on the first embodiment shown in fig. 2 and not shown in the drawings.
In this embodiment, after step S20, the method further includes:
step f, if the first target step code is not executable, generating and displaying non-executable prompt information corresponding to the first target step code so as to prompt a user that the first target step code is preset to be non-executable;
in this embodiment, if the user side determines that the first target step code is an unexecutable code, then unexecutable prompt information corresponding to the first target step code is generated. In a specific embodiment, if the first target step code is considered as a skipped step by the tester, and before the current test case is debugged, the first target step code is added with an unexecutable field, and when the user side obtains the first target step from the blocking queue, the unexecutable field is detected, and a corresponding unexecutable prompt message is generated and displayed to the tester. From this prompt, the tester can learn that the first target step code is a skipped step code.
Step g, deleting the first target step code from the blocking queue, and acquiring a step code to be executed in the current test case as a third target step code, wherein the step code to be executed is a next step code of the first target step code which is not executable;
in this embodiment, the user terminal deletes the first target step code from the blocking queue, and obtains the third target step code from the current test case. The third target step code is the next step code of the first target step code which is not executable in the current test case. The above procedure is to skip the first target step code and then automatically execute the next step code in sequence.
And h, adding the third target step code to the blocking queue, and judging whether the third target step code is executable or not.
In this embodiment, before the user end adds the third target step code to the blocking queue, it is first determined whether the blocking queue is full, and if not, the user end adds the third target step code to the blocking queue; if the block queue is full, the user side waits for the block queue to be not full, then adds the third step code to the block queue, and judges whether the third target step code can be executed.
Further, the test case debugging method of the invention further comprises the following steps:
and step i, if all executable step codes in the current test case are detected to be executed successfully, generating and displaying debugging completion information of the current test case.
In this embodiment, when the user side detects that all preset settings in the current test case are executable, corresponding debug completion information is generated and displayed to a tester. The specific detection mode can be as follows: and adding an identification field in the last step code of the current test case in advance, and generating and displaying debugging completion information corresponding to the current test case if the user side detects the identification field in the blocking queue and receives the execution success information or the non-executable information of the last step code. After step S1, the tester sees the debugging completion information, and knows that the current test case is successfully executed, and clicks to finish debugging, sets the debugging mode as false, and closes the browser. And the user terminal exits the current debugging mode and closes the Session.
The invention provides a test case debugging method, a test case debugging device and a computer readable storage medium. According to the test case debugging method, the non-executable prompt information is further displayed to the user, so that the user can know that the code of the step is skipped before the code is set, and the user experience is improved; by automatically jumping to the next step code when the first target step code is not executable, the operation of the tester is simplified.
The invention also provides a test case debugging device, which comprises:
the target code determining module is used for determining a first target step code in the current test case based on related parameters in the case debugging instruction when the case debugging instruction is received, wherein the related parameters at least comprise operation type parameters and page element positioning paths;
the target code judging module is used for adding the first target step code to a preset blocking queue and judging whether the first target step code is executable or not;
the target code executing module is used for acquiring and executing the first target step code from the blocking queue if the first target step code is executable;
and the target code verification module is used for verifying whether the first target step code is successfully executed according to a preset verification mode and outputting an execution result of the first target step code.
The test case debugging device further comprises:
the target code modification module is used for receiving the modified first target step code input by a user if the execution result shows that the first target step code fails to be executed, so as to update the first target step code;
And the target code debugging module is used for executing the modified first target step code, returning to execute the step of verifying whether the first target step code is successfully executed according to a preset verification mode, and outputting an execution result of the first target step code until the modified first target step code is successfully executed.
The test case debugging device further comprises:
the code obtaining judging module is used for obtaining a step code to be judged in the current test case as a second target step code if the execution result shows that the first target step code is successfully executed, and judging whether the second target step code is executable or not, wherein the step code to be judged is the next step code of the first target step code which is successfully executed.
The object code execution module is further to:
creating and circularly monitoring the blocking queue, and judging whether the blocking queue is empty;
if the blocking queue is empty, executing the steps of: and adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not.
The object code execution module is further to:
If the blocking queue is not empty, waiting for the execution of the existing step codes in the blocking queue to be completed, and executing the steps: and adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not.
The test case debugging device further comprises:
the time domain session generation module is used for establishing connection with the browser, generating a time domain session and acquiring an ID value of the time domain session so as to display the running process of the step code in the browser;
and the debugging page acquisition module is used for adding the ID value into the uniform resource locator of the current test case, and acquiring and displaying the step code debugging page of the browser according to the uniform resource locator.
The test case debugging device further comprises an information prompting module, wherein the information prompting module is used for:
if the first target step code is not executable, generating and displaying non-executable prompt information corresponding to the first target step code so as to prompt a user that the first target step code is preset to be non-executable;
deleting the first target step code from the blocking queue, and acquiring a step code to be executed in the current test case as a third target step code, wherein the step code to be executed is the next step code of the first target step code which is not executable;
And adding the third target step code to the blocking queue, and judging whether the third target step code is executable.
The test case debugging device further comprises:
and the detection unit is used for generating and displaying the debugging completion information of the current test case if all executable step codes in the current test case are detected to be executed successfully.
The method executed by each program module may refer to each embodiment of the exception handling method of the service of the present invention, which is not described herein.
The invention also provides a computer readable storage medium.
The computer readable storage medium of the present invention stores thereon a test case debugging program which, when executed by a processor, implements the steps of the test case debugging method described above.
The method implemented when the test case debugging program is executed may refer to each embodiment of the test case debugging method of the present invention, and will not be described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (14)

1. The test case debugging method is characterized by comprising the following steps of:
when a case debugging instruction is received, determining a first target step code in a current test case based on relevant parameters in the case debugging instruction, wherein the relevant parameters at least comprise operation type parameters and page element positioning paths, the first target step code is any step code which needs to be debugged in the current test case, and if at least one fourth step code exists before the first target step code, the first target step code is not associated with the at least one fourth step code;
creating and circularly monitoring a blocking queue, and judging whether the blocking queue is empty;
if the blocking queue is empty, adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not;
if the first target step code is executable, acquiring and executing the first target step code from the blocking queue;
verifying whether the first target-step code is successfully executed according to a preset verification mode, and outputting an execution result of the first target-step code;
The determining whether the first target step code is executable includes:
judging whether the first target step code contains an inexecutable field, wherein the inexecutable field is added into the first target step code by a tester before debugging the current test case;
if no non-executable fields are included, determining that the first target step code is executable.
2. The test case debugging method of claim 1, wherein after the step of verifying whether the first target step code is executed successfully according to a preset verification manner and outputting the execution result of the first target step code, further comprising:
if the execution result shows that the first target step code fails to be executed, receiving a modified first target step code input by a user so as to update the first target step code;
executing the modified first target step code, returning to execute the step of verifying whether the first target step code is successfully executed according to a preset verification mode, and outputting an execution result of the first target step code until the modified first target step code is successfully executed
3. The test case debugging method of claim 1, wherein after the step of verifying whether the first target step code is executed successfully according to a preset verification manner and outputting the execution result of the first target step code, further comprising:
and if the execution result shows that the first target step code is successfully executed, acquiring a step code to be judged in the current test case as a second target step code, and judging whether the second target step code is executable or not, wherein the step code to be judged is the next step code of the first target step code which is successfully executed.
4. The test case debugging method of claim 3, wherein after the steps of creating and cyclically listening to the blocking queue and determining whether the blocking queue is empty, further comprising:
if the blocking queue is not empty, waiting for the execution of the existing step codes in the blocking queue to be completed, and executing the steps: and adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not.
5. The test case debugging method of claim 3, wherein the creating and looping through monitoring the blocking queue, before the step of determining whether the blocking queue is empty, further comprises:
Establishing connection with a browser, generating a time domain session, and acquiring an ID value of the time domain session so as to display the running process of step codes in the browser;
and adding the ID value into the uniform resource locator of the current test case, and acquiring and displaying a step code debugging page of the browser according to the uniform resource locator.
6. The test case debugging method of claim 1, wherein after the step of adding the first target step code to a preset blocking queue and determining whether the first target step code is executable, further comprising:
if the first target step code is not executable, generating and displaying non-executable prompt information corresponding to the first target step code so as to prompt a user that the first target step code is preset to be non-executable;
deleting the first target step code from the blocking queue, and acquiring a step code to be executed in the current test case as a third target step code, wherein the step code to be executed is the next step code of the first target step code which is not executable;
and adding the third target step code to the blocking queue, and judging whether the third target step code is executable.
7. The test case debugging method of any one of claims 1-6, wherein the test case debugging method further comprises:
if all executable step codes in the current test case are detected to be executed successfully, generating and displaying debugging completion information of the current test case.
8. A test case debugging device, characterized in that the test case debugging device comprises:
the system comprises a target code determining module, a target code determining module and a processing module, wherein the target code determining module is used for determining a first target step code in a current test case based on relevant parameters in a case debugging instruction when the case debugging instruction is received, wherein the relevant parameters at least comprise operation type parameters and page element positioning paths, the first target step code is any step code which needs to be debugged in the current test case, and if at least one fourth step code exists before the first target step code, the first target step code is not associated with the at least one fourth step code;
the target code judging module is used for creating and circularly monitoring a blocking queue and judging whether the blocking queue is empty or not;
if the blocking queue is empty, adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not;
The target code executing module is used for acquiring and executing the first target step code from the blocking queue if the first target step code is executable;
the target code verification module is used for verifying whether the first target step code is successfully executed according to a preset verification mode and outputting an execution result of the first target step code;
the object code judging module is specifically configured to:
judging whether the first target step code contains an inexecutable field, wherein the inexecutable field is added into the first target step code by a tester before debugging the current test case;
if no non-executable fields are included, determining that the first target step code is executable.
9. The test case debugging apparatus of claim 8, wherein the test case debugging apparatus further comprises:
the target code modification module is used for receiving the modified first target step code input by a user if the execution result shows that the first target step code fails to be executed, so as to update the first target step code;
and the target code debugging module is used for executing the modified first target step code, returning to execute the step of verifying whether the first target step code is successfully executed according to a preset verification mode, and outputting an execution result of the first target step code until the modified first target step code is successfully executed.
10. The test case debugging apparatus of claim 8, wherein the test case debugging apparatus further comprises:
the code obtaining judging module is used for obtaining a step code to be judged in the current test case as a second target step code if the execution result shows that the first target step code is successfully executed, and judging whether the second target step code is executable or not, wherein the step code to be judged is the next step code of the first target step code which is successfully executed.
11. The test case debugging apparatus of claim 8, wherein the object code execution module is further to:
if the blocking queue is not empty, waiting for the execution of the existing step codes in the blocking queue to be completed, and executing the steps: and adding the first target step code to a preset blocking queue, and judging whether the first target step code is executable or not.
12. The test case debugging apparatus of claim 8, wherein the test case debugging apparatus further comprises:
the time domain session generation module is used for establishing connection with the browser, generating a time domain session and acquiring an ID value of the time domain session so as to display the running process of the step code in the browser;
And the debugging page acquisition module is used for adding the ID value into the uniform resource locator of the current test case, and acquiring and displaying the step code debugging page of the browser according to the uniform resource locator.
13. A test case debugging device, characterized in that the test case debugging device comprises: a memory, a processor and a test case debug program stored on the memory and executable on the processor, which when executed by the processor implements the steps of the test case debug method of any of claims 1 to 7.
14. A computer readable storage medium, wherein a test case debugging program is stored on the computer readable storage medium, which when executed by a processor implements the steps of the test case debugging method of any of claims 1 to 7.
CN201910857347.0A 2019-09-10 2019-09-10 Test case debugging method, device and storage medium Active CN110543429B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910857347.0A CN110543429B (en) 2019-09-10 2019-09-10 Test case debugging method, device and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910857347.0A CN110543429B (en) 2019-09-10 2019-09-10 Test case debugging method, device and storage medium

Publications (2)

Publication Number Publication Date
CN110543429A CN110543429A (en) 2019-12-06
CN110543429B true CN110543429B (en) 2023-05-16

Family

ID=68713290

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910857347.0A Active CN110543429B (en) 2019-09-10 2019-09-10 Test case debugging method, device and storage medium

Country Status (1)

Country Link
CN (1) CN110543429B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111897724B (en) * 2020-07-21 2022-12-06 国云科技股份有限公司 Automatic testing method and device suitable for cloud platform
CN113377650B (en) * 2021-06-09 2022-06-21 重庆紫光华山智安科技有限公司 Automatic test case operation method and device, test equipment and storage medium
CN115145333B (en) * 2022-07-26 2023-04-28 珠海格力电器股份有限公司 Method and device for debugging cooking equipment, processor and debugging system

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763085A (en) * 2018-05-31 2018-11-06 平安科技(深圳)有限公司 On-line debugging device, method and the computer readable storage medium of test cases
CN109857642A (en) * 2018-12-30 2019-06-07 贝壳技术有限公司 A kind of the block type adjustment method and debugging tool of UI automatized script

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5279901B2 (en) * 2009-05-27 2013-09-04 三菱電機株式会社 Sequence program debugging apparatus, debugging method, and program
US8893087B2 (en) * 2011-08-08 2014-11-18 Ca, Inc. Automating functionality test cases
US10235270B2 (en) * 2015-10-26 2019-03-19 Hitachi Ltd. Method for assisting with debugging, and computer system
CN106970870B (en) * 2016-01-14 2023-02-24 腾讯科技(北京)有限公司 Webpage test platform, webpage test method and webpage test system
CN106445818B (en) * 2016-09-13 2019-05-10 郑州云海信息技术有限公司 A kind of automatized script adjustment method and device based on model-driven
US10558553B2 (en) * 2016-11-30 2020-02-11 International Business Machines Corporation Enabling non-blocking runtime application debugging for a single threaded server environment
CN107463500B (en) * 2017-08-09 2020-05-01 网易(杭州)网络有限公司 Debugging method, medium, system and computing device of test script
CN109800159B (en) * 2018-12-27 2021-02-23 百富计算机技术(深圳)有限公司 Program debugging method, program debugging device, terminal device, and storage medium

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763085A (en) * 2018-05-31 2018-11-06 平安科技(深圳)有限公司 On-line debugging device, method and the computer readable storage medium of test cases
CN109857642A (en) * 2018-12-30 2019-06-07 贝壳技术有限公司 A kind of the block type adjustment method and debugging tool of UI automatized script

Non-Patent Citations (4)

* Cited by examiner, † Cited by third party
Title
Franz Wotawa等.Debugging and test case generation using constraints and mutations.《2011 Proceedings of the Ninth International Workshop on Intelligent Solutions in Embedded Systems》.2011,第1-6页. *
胡静红.基于TestComplete的Web应用自动化测试平台的设计与实现.《中国优秀硕士学位论文全文数据库 信息科技辑》.2015,(第(2015)09期),I138-87. *
葛晋鹏.物流软件自动化测试用例管理和执行调度的设计与实现.《中国优秀硕士学位论文全文数据库 信息科技辑》.2019,(第(2019)08期),I138-233. *
蒋宇阳.自动化测试系统远程调试子系统的设计与实现.《中国优秀硕士学位论文全文数据库 信息科技辑》.2015,(第(2015)12期),I140-370. *

Also Published As

Publication number Publication date
CN110543429A (en) 2019-12-06

Similar Documents

Publication Publication Date Title
CN108595329B (en) Application testing method and device and computer storage medium
US10853232B2 (en) Adaptive system for mobile device testing
CN110543429B (en) Test case debugging method, device and storage medium
US7877681B2 (en) Automatic context management for web applications with client side code execution
CN108521353B (en) Processing method and device for positioning performance bottleneck and readable storage medium
CN105302722B (en) CTS automatic testing method and device
CN110765018B (en) Automatic interface testing method and equipment
CN110196809B (en) Interface testing method and device
CN109977012B (en) Joint debugging test method, device, equipment and computer readable storage medium of system
US20150331784A1 (en) System and method for controlling test script execution by smartphone
CN111078567A (en) Report generation method, terminal and storage medium of automatic test platform
CN115617780A (en) Data import method, device, equipment and storage medium
EP3734460B1 (en) Probabilistic software testing via dynamic graphs
JP5006824B2 (en) Test program management system
WO2016188101A1 (en) Service system test method and device
CN113268409A (en) Method, apparatus, device and medium for tracking logical nodes during automated testing
CN110413518B (en) Control object library generation method and device and computer readable storage medium
CN110874278A (en) Embedding method of external system, workflow system, device and storage medium
US20140245159A1 (en) Transport script generation based on a user interface script
CN115344490A (en) Method and device for testing software product, storage medium and electronic equipment
CN111124915B (en) Coverage rate detection method, coverage rate detection device, and storage medium
CN108108369B (en) Method and device for processing calling error of common interface library
CN116932413B (en) Defect processing method, defect processing device and storage medium for test task
CN113094281B (en) Test method and device for hybrid App
JP6353759B2 (en) Test execution device, test execution method, and computer program

Legal Events

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