CN110543429A - Test case debugging method and device and storage medium - Google Patents

Test case debugging method and device and storage medium Download PDF

Info

Publication number
CN110543429A
CN110543429A CN201910857347.0A CN201910857347A CN110543429A CN 110543429 A CN110543429 A CN 110543429A CN 201910857347 A CN201910857347 A CN 201910857347A CN 110543429 A CN110543429 A CN 110543429A
Authority
CN
China
Prior art keywords
step code
code
target step
test case
target
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.)
Granted
Application number
CN201910857347.0A
Other languages
Chinese (zh)
Other versions
CN110543429B (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

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; and judging whether the first target step code is executed successfully or not and outputting an execution result. According to the method, the first target step code in the case is determined, so that the tester can be positioned to any step in the current test case, and the user experience is improved; by judging whether the first target step code can be executed or not, a tester can set a skip step code in advance; by executing the executable first target step code alone, the 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 and device and storage medium
Technical Field
the invention relates to the technical field of financial technology (Fintech), in particular to a test case debugging method and device and a computer readable storage medium.
background
with the development of computer technology, more and more technologies (big data, distributed, Blockchain, artificial intelligence, etc.) are applied to the financial field, and the traditional financial industry is gradually changing to financial technology (Fintech), but higher requirements are also put forward on the technologies due to the requirements of security and real-time performance of the financial industry. For a software product testing system of a bank, at present, a tester usually executes a whole case to check whether the steps of the case are accurate after writing a test case. If the error step occurs, the tester needs to repeatedly execute the whole case after modifying the error step, and judge whether the modified step can be successfully executed or not until the whole case is successfully executed. In the process of performing positioning analysis on problems in a use case, a tester needs to repeatedly execute the use case, and actually most of executed steps are not helpful to 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 debugging process of the whole use case is caused.
Disclosure of Invention
the invention mainly aims to provide a test case debugging method, a test case debugging device and a computer readable storage medium, and aims to solve the technical problem of low debugging efficiency in the whole case debugging process.
in order to achieve the above object, the present invention provides a test case debugging method, which includes the following steps:
When a use case debugging instruction is received, determining a first target step code in a current test case based on related parameters in the use case debugging instruction, wherein the related parameters at least comprise an operation type parameter 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 successfully executed according to a preset verification manner and outputting an 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;
And 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 successfully executed according to a preset verification manner and outputting an 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 a 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 or not;
If the blocking queue is empty, executing the following 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, after the step of creating and cyclically monitoring the blocking queue and determining whether the blocking queue is full, the method further includes:
If the blocking queue is not empty, after the existing step codes in the blocking queue are completely executed, executing the following 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 an operation process of a step code in the browser;
And adding the ID value into a 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 steps 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 a next step code of the first target step code which is not executable;
adding the third target step code to the block queue and determining whether the third target step code is executable.
As above, the test case debugging method further includes: and if detecting that all executable step codes in the current test case are successfully executed, generating and displaying debugging completion information of the current test case.
in addition, to achieve the above object, the present invention further provides a test case debugging apparatus, including:
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 an operation type parameter and a page element positioning path;
The object code judging module is used for adding the first object step code to a preset blocking queue and judging whether the first object step code can be executed or not;
The object code execution module is used for acquiring and executing the first object step code from the blocking queue if the first object step code is executable;
and the target code checking module is used for verifying whether the first target step code is successfully executed according to a preset checking mode and outputting an execution result of the first target step code.
optionally, the test case debugging apparatus further includes:
The object code modification module is used for receiving a modified first object step code input by a user to update the first object step code if the execution result shows that the execution of the first object step code fails;
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 the preset verification mode and outputting the execution result of the first target step code until the modified first target step code is successfully executed.
Optionally, the test case debugging apparatus further includes:
and the code obtaining and judging module is used for obtaining 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 if the execution result shows that the first target step code is successfully executed, wherein the step code to be judged is a 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 or not;
If the blocking queue is empty, executing the following 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 object code execution module is further configured to:
If the blocking queue is not empty, after the existing step codes in the blocking queue are completely executed, executing the following 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 apparatus further includes:
the time domain session generation module is used for 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;
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, to achieve the above object, the present invention further provides a test case debugging apparatus, including: the test case debugging method comprises a memory, a processor and a test case debugging program which is stored on 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, to achieve the above object, the present invention further provides a computer-readable storage medium, where a test case debugging program is stored on the computer-readable storage medium, and the test case debugging program, 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 test case debugging method comprises the steps of 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; 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 the mode, the first target step code in the case is determined according to the relevant parameters, so that a tester can accurately position any step in the current test case, and the 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 currently, and the condition that other step codes are executed in an inserting queue is avoided; whether the first target step code is executable or not is judged, so that a tester can set some step codes to be skipped in advance, the time for executing the step codes is reduced, the tester can debug the first target step code by executing the executable first target step code, the debugging efficiency is improved, and the technical problem of low debugging efficiency in the debugging process of the whole case is solved.
drawings
FIG. 1 is a schematic diagram of an apparatus in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating a test case debugging method according to a first embodiment of the present invention;
FIG. 3 is a detailed flow chart of the steps of the first embodiment of the present invention shown in FIG. 2.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
As shown in fig. 1, fig. 1 is a schematic device structure diagram of a hardware operating 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 server equipment, and a Java virtual machine runs on the test case debugging 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 a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also 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 non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the present solution, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a kind of computer storage medium, may include therein an operating system, a network communication module, a user interface module, and a test case debugging program.
in the apparatus shown in fig. 1, the network interface 1004 is mainly used for connecting to a backend server and performing data communication with the backend 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 configured to call a test case debugging program stored in the memory 1005 and perform operations in the 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 schematic flowchart of a first embodiment of a test case debugging method according to 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 the current test case based on the relevant parameters in the case debugging instruction, wherein the relevant parameters at least comprise an operation type parameter and a page element positioning path;
At present, when a tester debugs a program, the tester usually executes the whole case to check whether the steps of the case are accurate after the test case is written. If the error step occurs, the tester needs to repeatedly execute the whole case after modifying the error step, and judge whether the modified step can be successfully executed or not until the whole case is successfully executed. In the process of positioning and analyzing problems in the use case, a tester needs to repeatedly execute the use case, and actually most of executed steps are not helpful to positioning and analyzing the problems, and the problems can be reproduced only by a plurality of key steps, so that the problem of low debugging efficiency in the debugging process of the whole use case is caused. For example, when a tester executes a UI automation test case including 10 step codes, after the test case is executed for the first time, the first execution result shows that the third step code has been reported wrong. And the tester modifies the third step code for the first time, then executes the test case for the second time, and finds that the third step code after the first modification still reports errors. And executing the whole test case for the fifth time after the tester modifies the third step code for the fifth time, and finding that the fifth execution result shows that the third step code is successfully executed, but the seventh step code begins to report an error. The above-mentioned specific problem shows that the whole debugging process is very inefficient when the whole use case of multiple vehicles is repeatedly executed for modifying the successful single-step code.
in the embodiment, in order to solve the above problem, the invention provides a test case debugging method, that is, a first target step code in a case is determined according to a relevant parameter, so that a tester can accurately position any step in a 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 currently, and the condition that other step codes are executed in an inserting queue is avoided; whether the first target step code is executable or not is judged, so that a tester can set some step codes to be skipped in advance, the time for executing the step codes is reduced, the tester can debug the first target step code by executing the executable first target step code, the debugging efficiency is improved, and the technical problem of low debugging efficiency in the debugging process of the whole case is solved. The test case debugging method is applied to a server side and a user side, and is realized by adopting a producer-consumer mode through two threads of a producer and a consumer and a blocking queue. 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 products into the storage space, the consumer takes the products 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, two threads, producer and consumer, share a single blocking queue. The producer thread adds step codes to the block queue, and the consumer thread takes the step codes out of the block queue for execution. Specifically, the case debugging instruction comprises a debugging starting instruction and a step selecting instruction, the debugging starting instruction is an instruction for starting a debugging mode, and the step selecting instruction is an instruction for a tester to select a certain step code in the current test case. 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 side, the user side initiates a time domain Session request to the server side, the server side receives the Session request and stores the Session, and the Session is maintained between the user browser and the user side. The user side detects a test case to be debugged currently, and acquires a Uniform Resource Locator (URL) of the current test case. And the user side opens the browser page corresponding to the current test case according to the URL. And the user terminal 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 debugging 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 side 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 relevant parameters at least include an operation type parameter of the first target step code, a path for positioning the page element, and may further include an input value and a variable corresponding to the first target step code, and the operation type parameter may be a delay, a click, a mouse hover, or the like. The determination mode of the first target step code may be that a tester manually adds the relevant parameters corresponding to the first target step code on a step code relevant parameter page, or that a user side directly obtains the relevant parameters corresponding to the first target step code when jumping from the previous step code to the first target step according to an automatic jumping rule. In a specific embodiment, if the first target step code is a 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 debugging page of the browser, and the user side can determine the fourth step code in the current test case according to the three parameters input by the tester, where the positioning path "// div [ @ class ═ mean-root" ]/div "and the input value" 3 ".
step S20, adding the first target step code to a preset blocking queue, and determining whether the first target step code is executable;
In this embodiment, the user side obtains the first target step code from the current test case, and adds the first target step code to the preset blocking queue. Wherein the blocking queue is a queue which supports two additional operations on a queue basis. When the queue is full, the queue can block 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 performing 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 process, the producer thread is used to add the acquired first target step code to the block 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 determines that the first target step code is an executable code, the user obtains the first target step code from the blocking queue, and drives the server to execute the first target step code through the debugging actuator in the current debugging mode. The debugging executor is a module for executing the step codes of the use case in the debugging mode. The specific judgment condition may be: if the skip field does not exist in the first target step code, the user side judges that the first target step code is an executable code. During execution, the browser synchronously displays relevant operations of the first target step code, such as clicking a button, inputting a user name and the like. And the server records a log and an execution result of executing the first target step code, and intercepts and stores a page screenshot of the execution process of the first target step code. In the above process, the consumer thread is used to retrieve and execute the first target step code from the block queue.
Step S40, verifying whether the first target step code is successfully executed according to a preset verification manner, and outputting an execution result of the first target step code.
in this embodiment, a tester selects one or more verification modes in a preset verification mode before a first target step code is executed, a user side 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 an execution result of the first target step code on a page. Wherein, the preset checking mode can be as follows: judging whether the screenshot of the execution page 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 mark attribute of the page element corresponding to the first target step code through an interface provided by a 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 an interface provided by the Selenium WebDriver framework. In the above process, the consumer thread is used to determine whether the first target step code was executed successfully.
The invention provides a test case debugging method, a test case debugging device and a computer readable storage medium. The test case debugging method comprises the steps of 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 an operation type parameter 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. By the mode, the first target step code in the case is determined according to the relevant parameters, so that a tester can accurately position any step in the current test case, and the 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 currently, and the condition that other step codes are executed in an inserting queue 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 the tester can debug the first target step code by executing the executable first target step code, so that the debugging efficiency is improved; by judging the execution condition of the first target step code and outputting the corresponding execution result, the tester can directly obtain the execution result of the first target step code without spending time to execute other steps in the current embodiment, the debugging efficiency of the tester is improved, and the technical problem of low debugging efficiency in the debugging process of the whole case is solved.
referring to fig. 3, fig. 3 is a detailed flow chart of the first embodiment of the present invention.
based on the first embodiment shown in fig. 2, a second embodiment of the test case debugging method according to the present invention is provided. 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 maintains the connection with the server through the session identification code SessionID of the time domain, and the server 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 a preset verification mode, modifying the first target step code on a page of the browser. And the user side stores the related modified data into a local database. The modified first target step code can be a first target step code which is instantly edited again on a browser page by a tester; or after adding a new step code before the first target step code, combining the new step code with the first target step code.
Step S60, executing the modified first target step code, and returning to the step of executing the step of verifying whether the first target step code is successfully executed according to the preset verification manner, and outputting the execution result of the first target step code until the modified first target step code is successfully executed.
in this embodiment, the debugging 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 a page of the browser. If the execution result of the first target step code after the first modification still shows that the execution fails, the tester modifies the first target step code again and executes the first target step code until the first target step code after the multiple modifications can be successfully executed and outputs the execution success result. The modified first target code may be a first target step code after being modified once, or may be a first target step code after being modified for multiple times, where the specific number of times of modification is determined according to specific situations, but the modified first target step code must be a modified first target step code that can be successfully run.
Further, after step S40, the method further includes:
step S01, if the execution result shows that the first target step code is successfully executed, acquiring a step code to be determined in the current test case as a second target step code, and determining whether the second target step code is executable, where the step code to be determined is a next step code of the first target step code that is successfully executed.
In this embodiment, the user maintains the connection with the server through the SessionID, and the server displays the execution result corresponding to the first target step code on the page of the browser. And 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 result of the successful execution of the first target step code, and then the debugging of the first target step is completed. And the user side acquires the step code to be judged in the current test case as a second target step code. And the second target step code is the next step code of the first target step code which is successfully executed in the current test case. The consumer thread is used in this embodiment to drive the server to display the first target step code execution result and 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. The test case debugging method further enables a tester to finish debugging the first target step code independently by executing the failed first target step code until the debugging is successful, so that the debugging efficiency is improved, and the user experience is improved; by automatically jumping to the next step after the first target step code is successfully executed, the operation of a tester is simplified, and the user experience is improved.
not shown in the figure, a third embodiment of the test case debugging method according to the present invention is proposed based on the first embodiment shown in fig. 2.
In this embodiment, before step S20, the method further includes:
Step a, establishing and circularly monitoring the blocking queue, and judging whether the blocking queue is empty or not;
In this embodiment, the ue creates a congestion queue and listens to the congestion queue in a loop. The user end judges whether the step code in the blocking queue is empty. Wherein the step code storage space of the blocking queue is preset to add only one step code at a time. In a specific embodiment, to determine whether the blocking queue is empty, the user side generates a corresponding return value whenever a step code in the blocking queue is added or deleted. And the user side 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 following 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 user side obtains the information that the step code in the congestion queue is empty after the user side determines that the step code is empty, the user side adds the first target step code to the congestion queue and determines whether the first target step code is executable. In an embodiment, if the current return value matches a preset return value, the ue determines that the step code in the congestion queue is empty.
Step c, if the blocking queue is not empty, after the existing step codes in the blocking queue are executed, executing the following 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 obtains the information that the step code in the blocking queue is not empty after the ue determines that the step code is not empty, the ue waits for the original step code in the blocking queue to be fetched and executed. And after the code debugging in the original step is finished, the user side judges whether the current blocking queue is empty or not. The method comprises the steps of obtaining a current blocking queue, wherein the blocking queue is preset to buffer one step code, and the original step code is obtained and executed. And the user side adds the first target step code into the currently empty blocking queue and judges whether the first step code can be executed or not.
Further, in this embodiment, before step a, the method further includes:
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, a user side initiates a time domain Session request to a server side, the server side receives the Session request, and obtains and stores a Session id corresponding to the Session request, so as to maintain the connection between the user side and the user browser of the server side through the Session id, drive the browser in the server to execute a step code, and display an operation process of the step code.
And e, 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 this embodiment, the user side detects a test case to be debugged currently, and obtains a Uniform Resource Locator (URL) of the current test case. And the user side adds the ID value into the URL of the current test case, and acquires the step code debugging page corresponding to the current test case according to the URL. The consumer thread is used in this embodiment to cycle through the snoop block queue.
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 comprises the steps of monitoring whether a blocking queue is empty or not, and only waiting for the blocking queue to be empty again when the blocking queue is full, then placing a first target step code, so that the first target step code can only be independently executed in the current test case, and the interference of step codes outside the blocking queue is avoided; by maintaining the connection between the ID value in the time domain session and the server, the single step code is not immediately disconnected after the execution fails, and the step code can be continuously modified and executed until the debugging succeeds, so that the debugging efficiency is improved.
not shown in the figure, a fourth embodiment of the test case debugging method according to the present invention is proposed based on the first embodiment shown in fig. 2.
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 determines that the first target step code is the unexecutable code, the unexecutable prompt message corresponding to the first target step code is generated. In a specific embodiment, if the first target step code is considered to be a skippable step by the tester, and before debugging the current test case, the first target step code is added with the non-executable field, when the user side acquires the first target step from the blocking queue, the non-executable field is detected, and corresponding non-executable prompt information is generated and displayed to the tester. The tester can know that the first target step code is a skippable step code from the prompt message.
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 side deletes the first target step code from the blocking queue, and obtains the third target step code in the current test case. And 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 process 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 can be executed or not.
in this embodiment, before adding the third target step code to the congestion queue, the ue first determines whether the congestion queue is full, and if not, the ue adds the third step code to the congestion queue; if yes, the user end waits for the blocking queue to be not full, then adds the third step code to the blocking queue, and judges whether the third target step code can be executed or not.
Further, the test case debugging method of the present invention further comprises:
And i, if all executable step codes in the current test case are successfully executed, generating and displaying debugging completion information of the current test case.
in this embodiment, when the user side detects that all the preset settings in the current test case are executable, the corresponding debugging completion information is generated and displayed to the 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 when the user terminal detects the identification field in the blocking queue and receives the execution success information or the non-execution information of the last step code. After step S1, the tester sees the debug completion information, and if the current test case is successfully executed, clicks to end the debugging, sets the debug mode to false, and closes the browser. The user end 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. The test case debugging method further displays non-executable prompt information to a user, so that the user can know that the codes in the step are set to be skipped before, 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 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 an operation type parameter and a page element positioning path;
The object code judging module is used for adding the first object step code to a preset blocking queue and judging whether the first object step code can be executed or not;
the object code execution module is used for acquiring and executing the first object step code from the blocking queue if the first object step code is executable;
And the target code checking module is used for verifying whether the first target step code is successfully executed according to a preset checking mode and outputting an execution result of the first target step code.
the test case debugging device further comprises:
The object code modification module is used for receiving a modified first object step code input by a user to update the first object step code if the execution result shows that the execution of the first object step code fails;
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 the preset verification mode and outputting the 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:
and the code obtaining and judging module is used for obtaining 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 if the execution result shows that the first target step code is successfully executed, wherein the step code to be judged is a 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 or not;
if the blocking queue is empty, executing the following 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 object code execution module is further to:
if the blocking queue is not empty, after the existing step codes in the blocking queue are completely executed, executing the following 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 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;
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 a next step code of the first target step code which is not executable;
Adding the third target step code to the block queue and determining 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 debugging completion information of the current test case if detecting that all executable step codes in the current test case are successfully executed.
The method executed by each program module can refer to each embodiment of the exception handling method of the service of the present invention, and is not described herein again.
the invention also provides a computer readable storage medium.
the computer readable storage medium of the present invention stores a test case debugging program, and the test case debugging program implements the steps of the test case debugging method as described above when executed by the processor.
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 details are not described here.
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 an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
the above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
through the above description of the embodiments, those skilled in the art will clearly understand that the method of the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but in many cases, the former is a better implementation manner. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) as described above and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, an air conditioner, or a network device) to execute the method according to the embodiments of the present invention.
the above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (16)

1. a test case debugging method is characterized by comprising the following steps:
when a use case debugging instruction is received, determining a first target step code in a current test case based on related parameters in the use case debugging instruction, wherein the related parameters at least comprise an operation type parameter 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.
2. the test case debugging method according to claim 1, wherein after the step of verifying whether the first target step code is successfully executed according to a preset verification manner and outputting the execution result of the first target step code, the method further comprises:
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;
And 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 according to claim 1, wherein after the step of verifying whether the first target step code is successfully executed according to a preset verification manner and outputting the execution result of the first target step code, the method further comprises:
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 a next step code of the first target step code which is successfully executed.
4. The test case debugging method of claim 1, wherein before the steps 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 comprises:
Creating and circularly monitoring the blocking queue, and judging whether the blocking queue is empty or not;
If the blocking queue is empty, executing the following 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 4, wherein after the steps of creating and cyclically listening to the blocked queue and determining whether the blocked queue is full, the method further comprises:
If the blocking queue is not empty, after the existing step codes in the blocking queue are completely executed, executing the following 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.
6. the test case debugging method of claim 4, wherein before the step of creating and cyclically listening to the blocking queue and determining whether the blocking queue is empty, the method 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 an operation process of a step code in the browser;
and adding the ID value into a 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.
7. the test case debugging method of claim 1, wherein after the steps 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 comprises:
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 a next step code of the first target step code which is not executable;
Adding the third target step code to the block queue and determining whether the third target step code is executable.
8. the test case debugging method of any one of claims 1-7, further comprising:
And if detecting that all executable step codes in the current test case are successfully executed, generating and displaying debugging completion information of the current test case.
9. a test case debugging apparatus, comprising:
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 an operation type parameter and a page element positioning path;
The object code judging module is used for adding the first object step code to a preset blocking queue and judging whether the first object step code can be executed or not;
the object code execution module is used for acquiring and executing the first object step code from the blocking queue if the first object step code is executable;
And the target code checking module is used for verifying whether the first target step code is successfully executed according to a preset checking mode and outputting an execution result of the first target step code.
10. the test case debugging apparatus according to claim 9, wherein the test case debugging apparatus further comprises:
The object code modification module is used for receiving a modified first object step code input by a user to update the first object step code if the execution result shows that the execution of the first object step code fails;
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 the preset verification mode and outputting the execution result of the first target step code until the modified first target step code is successfully executed.
11. the test case debugging apparatus according to claim 9, wherein the test case debugging apparatus further comprises:
And the code obtaining and judging module is used for obtaining 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 if the execution result shows that the first target step code is successfully executed, wherein the step code to be judged is a next step code of the first target step code which is successfully executed.
12. The test case debugging apparatus of claim 9, wherein the object code execution module is further configured to:
Creating and circularly monitoring the blocking queue, and judging whether the blocking queue is empty or not;
If the blocking queue is empty, executing the following 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.
13. the test case debugging apparatus of claim 12, wherein the object code execution module is further configured to:
if the blocking queue is not empty, after the existing step codes in the blocking queue are completely executed, executing the following 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.
14. the test case debugging apparatus according to claim 12, wherein the test case debugging apparatus further comprises:
the time domain session generation module is used for 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;
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.
15. a test case debugging apparatus, comprising: a memory, a processor, and a test case debugging program stored on the memory and executable on the processor, the test case debugging program, when executed by the processor, implementing the steps of the test case debugging method of any of claims 1-8.
16. A computer-readable storage medium, having a test case debugging program stored thereon, wherein the test case debugging program, when executed by a processor, implements the steps of the test case debugging method according to any one of claims 1 to 8.
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 true CN110543429A (en) 2019-12-06
CN110543429B 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)

Cited By (3)

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

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102449563A (en) * 2009-05-27 2012-05-09 三菱电机株式会社 Sequence program debugging device, debugging method, and program
US20130042222A1 (en) * 2011-08-08 2013-02-14 Computer Associates Think, Inc. Automating functionality test cases
CN106445818A (en) * 2016-09-13 2017-02-22 郑州云海信息技术有限公司 Debug method and device for automated scripts based on model driving
CN106970870A (en) * 2016-01-14 2017-07-21 腾讯科技(北京)有限公司 Webpage test platform, webpage method of testing and webpage test system
CN107463500A (en) * 2017-08-09 2017-12-12 网易(杭州)网络有限公司 Adjustment method, medium, system and the computing device of test script
US20180150385A1 (en) * 2016-11-30 2018-05-31 International Business Machines Corporation Enabling non-blocking runtime application debugging for a single threaded server environment
US20180189165A1 (en) * 2015-10-26 2018-07-05 Hitachi, Ltd. Method for assisting with debugging, and computer system
CN108763085A (en) * 2018-05-31 2018-11-06 平安科技(深圳)有限公司 On-line debugging device, method and the computer readable storage medium of test cases
CN109800159A (en) * 2018-12-27 2019-05-24 百富计算机技术(深圳)有限公司 Program debugging method, program debugging device, terminal device and storage medium
CN109857642A (en) * 2018-12-30 2019-06-07 贝壳技术有限公司 A kind of the block type adjustment method and debugging tool of UI automatized script

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102449563A (en) * 2009-05-27 2012-05-09 三菱电机株式会社 Sequence program debugging device, debugging method, and program
US20130042222A1 (en) * 2011-08-08 2013-02-14 Computer Associates Think, Inc. Automating functionality test cases
US20180189165A1 (en) * 2015-10-26 2018-07-05 Hitachi, Ltd. Method for assisting with debugging, and computer system
CN106970870A (en) * 2016-01-14 2017-07-21 腾讯科技(北京)有限公司 Webpage test platform, webpage method of testing and webpage test system
CN106445818A (en) * 2016-09-13 2017-02-22 郑州云海信息技术有限公司 Debug method and device for automated scripts based on model driving
US20180150385A1 (en) * 2016-11-30 2018-05-31 International Business Machines Corporation Enabling non-blocking runtime application debugging for a single threaded server environment
CN107463500A (en) * 2017-08-09 2017-12-12 网易(杭州)网络有限公司 Adjustment method, medium, system and the computing device of test script
CN108763085A (en) * 2018-05-31 2018-11-06 平安科技(深圳)有限公司 On-line debugging device, method and the computer readable storage medium of test cases
CN109800159A (en) * 2018-12-27 2019-05-24 百富计算机技术(深圳)有限公司 Program debugging method, program debugging device, terminal device and storage medium
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 (6)

* Cited by examiner, † Cited by third party
Title
FRANZ WOTAWA等: "Debugging and test case generation using constraints and mutations" *
吴寒冰: "Selenium自动化测试系统的设计与实现", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
林科学: "软件测试/调试技术应用研究", 《中国优秀硕士学位论文全文数据库 信息科技辑》 *
胡静红: "基于TestComplete的Web应用自动化测试平台的设计与实现" *
葛晋鹏: "物流软件自动化测试用例管理和执行调度的设计与实现" *
蒋宇阳: "自动化测试系统远程调试子系统的设计与实现" *

Cited By (6)

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

Also Published As

Publication number Publication date
CN110543429B (en) 2023-05-16

Similar Documents

Publication Publication Date Title
CN108108297B (en) Method and device for automatic testing
CN108595329B (en) Application testing method and device and computer storage medium
CN107908541B (en) Interface testing method and device, computer equipment and storage medium
US9342237B2 (en) Automated testing of gesture-based applications
US7877681B2 (en) Automatic context management for web applications with client side code execution
CN111026645B (en) User interface automatic test method and device, storage medium and electronic equipment
US20190227917A1 (en) Adaptive system for mobile device testing
CN110543429B (en) Test case debugging method, device and storage medium
CN105302722B (en) CTS automatic testing method and device
CN111104315A (en) Test script generation method and device and computer readable storage medium
CN111078567B (en) Report generation method, terminal and storage medium of automatic test platform
CN112241360B (en) Test case generation method, device, equipment and storage medium
WO2019214109A1 (en) Monitoring device and method for testing process, and computer readable storage medium
US11169910B2 (en) Probabilistic software testing via dynamic graphs
CN115617780A (en) Data import method, device, equipment and storage medium
US10083108B1 (en) Automated stack-based computerized application crawler
CN113268409B (en) Method, apparatus, device and medium for tracking logical nodes during automated testing
JP5006824B2 (en) Test program management system
KR20150025106A (en) Verification apparatus, terminal device, system, method and computer-readable medium for monitoring of application verification result
CN110232013B (en) Test method, test device, controller and 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
CN114218072A (en) Test script generation method and device, storage medium and computer equipment
CN110413518B (en) Control object library generation method and device and computer readable storage medium
CN113326193A (en) Applet testing method and device

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