CN105786705A - Execution method and device of nested loop test scripts - Google Patents

Execution method and device of nested loop test scripts Download PDF

Info

Publication number
CN105786705A
CN105786705A CN201610107238.3A CN201610107238A CN105786705A CN 105786705 A CN105786705 A CN 105786705A CN 201610107238 A CN201610107238 A CN 201610107238A CN 105786705 A CN105786705 A CN 105786705A
Authority
CN
China
Prior art keywords
script
test script
partial circulating
module
content
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.)
Pending
Application number
CN201610107238.3A
Other languages
Chinese (zh)
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.)
Shanghai Feixun Data Communication Technology Co Ltd
Original Assignee
Shanghai Feixun Data Communication Technology 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 Shanghai Feixun Data Communication Technology Co Ltd filed Critical Shanghai Feixun Data Communication Technology Co Ltd
Priority to CN201610107238.3A priority Critical patent/CN105786705A/en
Publication of CN105786705A publication Critical patent/CN105786705A/en
Pending legal-status Critical Current

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/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 an execution method and device of nested loop test scripts.The nested loop test scripts comprise a large loop test script.A small loop test script is nested in the large loop test script.The small loop test script comprises a script content, a first mark position for marking the script content, and a loop frequency N of the script content.The method includes the steps of determining the to-be-run small loop test script according to the first marking position, analyzing and executing the small loop test script N times, and analyzing and executing the large loop test script.Part of the loop content in a test case is controlled by nesting a small loop in a for loop, the script content is simplified, the test running efficiency is improved, and the method is a flexible test script recording and executing method.

Description

The execution method of nested loop test script and device
Technical field
The present invention relates to software test field, particularly to execution method and the device of a kind of nested loop test script.
Background technology
Software automated testing is a kind of process that machine independently performs that is converted into by the behavioral test driven by people, performs step by step according to the description of test case, the actual test result obtained and expected result is compared.In software automated testing process, it is not necessary to human intervention, it is that machine is installed test script voluntarily and performed.Such automatic test can save substantial amounts of human resources.Thus, automatic test is very important by test script, determines the effect of test run.
In the process of test, it is sometimes desirable to repeatedly run some scripts in a large number;The test case also having repeatability in circulation sometimes occur, namely nested loop test script, also has the existence of partial circulating in systemic circulation.
Under normal circumstances, the test script performing to circulate is circulated by for and controls, and is for overall test case, rather than for partial content in test case.In current nested loop test scheme, generally partial circulating being used as systemic circulation to process, namely performing partial circulating is realized by the full content of repetition systemic circulation, thus includes some test scripts that there is no need, not only script is tediously long, and reduces the operational efficiency of test script.
Summary of the invention
Present invention aim to address that at present partial circulating is used as systemic circulation by nested loop test script to process, script is tediously long, the technical problem that the operational efficiency of test script is low.
For realizing above goal of the invention, on the one hand, the present invention provides a kind of execution method of nested loop test script, and described nested loop test script includes systemic circulation test script, is nested with partial circulating test script in described systemic circulation test script;
Described partial circulating test script includes the cycle-index N of content for script, the first flag bit and described content for script for identifying described content for script;
Described execution method includes:
Described partial circulating test script to be run is determined according to described first flag bit;
Resolve and perform described partial circulating test script n times;
Resolve and perform described systemic circulation test script.
Further, described partial circulating test script also includes the second flag bit for identifying described cycle-index N.
Further, described parsing perform described partial circulating test script n times and include:
Described cycle-index N is obtained according to described second flag bit;
Perform the content for script n times of described partial circulating test script.
Further, described determine described partial circulating test script to be run according to described flag bit after also include:
Described partial circulating test script is stored in another test document.
On the other hand, the present invention provides the execution device of a kind of nested loop test script, and described nested loop test script includes systemic circulation test script, is nested with partial circulating test script in described systemic circulation test script;
Described partial circulating test script includes the cycle-index N of content for script, the first flag bit and described content for script for identifying described content for script;
Described execution device includes:
Partial circulating test script determines that module, described partial circulating test script determine that module is for determining described partial circulating test script to be run according to described first flag bit;
Partial circulating test script resolves and performs module, and described partial circulating test script resolves and performs module and is used for resolving and perform described partial circulating test script n times;
Systemic circulation test script resolves and performs module, and described systemic circulation test script resolves and performs module and is used for resolving and perform described systemic circulation test script.
Further, described partial circulating test script also includes the second flag bit for identifying described cycle-index N.
Further, the parsing of described partial circulating test script and execution module include obtaining script cycle-index module and script execution module;
Described acquisition script cycle-index module is for obtaining described cycle-index N according to described second flag bit;
Described script execution module is for performing the content for script n times of described partial circulating test script.
Further, described partial circulating test script also includes script memory module after determining module, and described script memory module is for being stored in described partial circulating test script in another test document.
Compared with prior art, the invention has the beneficial effects as follows:
The present invention controls part circulating content in test case by circulating nested inside partial circulating, not only without influence on systemic circulation process, and partial circulating can be realized, reduce the number of content for script, reduce unnecessary script to run, simple and convenient, improve test run efficiency, the problem solving systemic circulation nesting partial circulating, is that one test script flexibly is recorded and execution method.
Accompanying drawing explanation
Fig. 1 is the flow chart that the present invention performs embodiment of the method 1;
Fig. 2 is the flow chart that the present invention performs embodiment of the method 2;
Fig. 3 is the flow chart that the present invention performs embodiment of the method 3;
Fig. 4 is the theory diagram that the present invention performs device embodiment 1;
Fig. 5 is the theory diagram that the present invention performs device embodiment 2;
Fig. 6 is the theory diagram that the present invention performs device embodiment 3.
Detailed description of the invention
Below in conjunction with the drawings and specific embodiments, the invention will be further described.
The following relevant present invention performs in three embodiments of method, and nested loop test script includes systemic circulation test script, is nested with partial circulating test script in systemic circulation test script;Partial circulating test script includes the cycle-index N of content for script, the first flag bit and content for script for identifying content for script.
Embodiment 1
As it is shown in figure 1, the execution method of the nested loop test script of the present invention, specifically include following steps:
S100: determine partial circulating test script to be run according to the first flag bit;
S110: resolve and perform partial circulating test script n times;
S120: resolve and perform systemic circulation test script.
Embodiment 2
As in figure 2 it is shown, the execution method of the nested loop test script of the present invention, partial circulating test script also includes the second flag bit for identifying cycle-index N, specifically includes following steps:
S200: determine partial circulating test script to be run according to the first flag bit;
S210: obtain partial circulating test script cycle-index N according to the second flag bit;
S215: perform the content for script n times of partial circulating test script;
S220: resolve and perform systemic circulation test script.
Embodiment 3
As it is shown on figure 3, the execution method of the nested loop test script of the present invention, partial circulating test script also includes the second flag bit for identifying cycle-index N, specifically includes following steps:
S300: determine partial circulating test script to be run according to the first flag bit;
S305: partial circulating test script is stored in another test document;
S310: obtain partial circulating test script cycle-index N according to the second flag bit;
S315: perform the content for script n times of partial circulating test script
S320: resolve and perform systemic circulation test script.
The present invention is first, it is settled that need the test content of partial circulating, and when recording script, for example, add the first flag bit before the script needing partial circulating starts, such as #, (noting, flag bit here can not be the same with other flag bits, in order to avoid causing conflict;Flag bit is not necessarily defined to only one of which character, it is possible to before and after being, several characters collectively constitute a flag bit), the first flag bit # content below is the content for script of partial circulating test script;The second flag bit is added, such as two % after the content for script needing partial circulating terminates;Being the cycle-index N of partial circulating between two % of the second flag bit, such as N=3, then the form of this example partial circulating interpolation flag bit is as follows:
# partial circulating test script content % cycle-index N%.
Above-described embodiment is only an example of the application.It is understood that described flag bit can also have other method for expressing, for instance, the first above-mentioned flag bit can be made up of two identical or different identifiers, no longer repeats one by one herein.
During testing results script, call jar bag;When jar Packet analyzing script has #, jar can intercept the content for script between # and %, then this content for script is stored in another text, in txt file, jar bag intercepts the cycle-index N between two % more afterwards, starts the cycle over the content for script in n times partial circulating.When systemic circulation and partial circulating exist simultaneously, when jar bag goes to partial circulating, with systemic circulation (as, fot circulates) it doesn't matter, jar can perform the content for script of partial circulating length by length, after the content for script of circulation complete primary school circulation, then performs the content for script of systemic circulation.Thus achieve systemic circulation nesting partial circulating, reduce the number of content for script, simple to operate, improve script operational efficiency.
The following relevant present invention performs in three embodiments of device, and nested loop test script includes systemic circulation test script, is nested with partial circulating test script in systemic circulation test script;Partial circulating test script includes the cycle-index N of content for script, the first flag bit and content for script for identifying content for script.
Embodiment 4
As shown in Figure 4, the execution device of the nested loop test script of the present invention, including:
Partial circulating test script determines that module, partial circulating test script determine that module is for determining partial circulating test script to be run according to the first flag bit;
Partial circulating test script resolves and performs module, and partial circulating test script resolves and performs module and is used for resolving and perform partial circulating test script n times;
Systemic circulation test script resolves and performs module, and systemic circulation test script resolves and performs module and is used for resolving and perform systemic circulation test script.
Embodiment 5
As it is shown in figure 5, the execution device of the nested loop test script of the present invention, partial circulating test script also includes the second flag bit for identifying cycle-index N, including:
Partial circulating test script determines that module, partial circulating test script determine that module is for determining partial circulating test script to be run according to the first flag bit;
Partial circulating test script resolves and performs module, specifically includes acquisition script cycle-index module and script execution module;Obtain script cycle-index module for obtaining cycle-index N according to the second flag bit;Script execution module is for performing the content for script n times of partial circulating test script;
Systemic circulation test script resolves and performs module, and systemic circulation test script resolves and performs module and is used for resolving and perform systemic circulation test script.
Embodiment 6
As shown in Figure 6, the execution device of the nested loop test script of the present invention, partial circulating test script also includes the second flag bit for identifying cycle-index N, including:
Partial circulating test script determines that module, partial circulating test script determine that module is for determining partial circulating test script to be run according to the first flag bit;
Script memory module, script memory module is for being stored in partial circulating test script in another test document;
Partial circulating test script resolves and performs module, specifically includes acquisition script cycle-index module and script execution module;Obtain script cycle-index module for obtaining cycle-index N according to the second flag bit;Script execution module is for performing the content for script n times of partial circulating test script;
Systemic circulation test script resolves and performs module, and systemic circulation test script resolves and performs module and is used for resolving and perform systemic circulation test script.
In addition to the implementation, the present invention can also have other embodiments, all employings to be equal to replacement or the technical scheme of equivalent transformation formation, all falls within the protection domain of application claims.

Claims (8)

1. the execution method of nested loop test script, described nested loop test script includes systemic circulation test script, is nested with partial circulating test script in described systemic circulation test script;It is characterized in that,
Described partial circulating test script includes the cycle-index N of content for script, the first flag bit and described content for script for identifying described content for script;
Described execution method includes:
Described partial circulating test script to be run is determined according to described first flag bit;
Resolve and perform described partial circulating test script n times;
Resolve and perform described systemic circulation test script.
2. perform method as claimed in claim 1, it is characterised in that described partial circulating test script also includes the second flag bit for identifying described cycle-index N.
3. perform method as claimed in claim 2, it is characterised in that described parsing also performs described partial circulating test script n times and includes:
Described cycle-index N is obtained according to described second flag bit;
Perform the content for script n times of described partial circulating test script.
4. perform method as claimed in claim 1, it is characterised in that described determine described partial circulating test script to be run according to described flag bit after also include:
Described partial circulating test script is stored in another test document.
5. the execution device of nested loop test script, described nested loop test script includes systemic circulation test script, is nested with partial circulating test script in described systemic circulation test script;It is characterized in that,
Described partial circulating test script includes the cycle-index N of content for script, the first flag bit and described content for script for identifying described content for script;
Described execution device includes:
Partial circulating test script determines that module, described partial circulating test script determine that module is for determining described partial circulating test script to be run according to described first flag bit;
Partial circulating test script resolves and performs module, and described partial circulating test script resolves and performs module and is used for resolving and perform described partial circulating test script n times;
Systemic circulation test script resolves and performs module, and described systemic circulation test script resolves and performs module and is used for resolving and perform described systemic circulation test script.
6. perform device as claimed in claim 5, it is characterised in that described partial circulating test script also includes the second flag bit for identifying described cycle-index N.
7. perform device as claimed in claim 6, it is characterised in that described partial circulating test script resolves and performs module and includes obtaining script cycle-index module and script execution module;
Described acquisition script cycle-index module is for obtaining described cycle-index N according to described second flag bit;
Described script execution module is for performing the content for script n times of described partial circulating test script.
8. performing device as claimed in claim 5, it is characterised in that described partial circulating test script also includes script memory module after determining module, described script memory module is for being stored in described partial circulating test script in another test document.
CN201610107238.3A 2016-02-26 2016-02-26 Execution method and device of nested loop test scripts Pending CN105786705A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610107238.3A CN105786705A (en) 2016-02-26 2016-02-26 Execution method and device of nested loop test scripts

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610107238.3A CN105786705A (en) 2016-02-26 2016-02-26 Execution method and device of nested loop test scripts

Publications (1)

Publication Number Publication Date
CN105786705A true CN105786705A (en) 2016-07-20

Family

ID=56403658

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610107238.3A Pending CN105786705A (en) 2016-02-26 2016-02-26 Execution method and device of nested loop test scripts

Country Status (1)

Country Link
CN (1) CN105786705A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109766228A (en) * 2017-11-09 2019-05-17 北京京东尚科信息技术有限公司 Verification method and device on a kind of line based on interface
WO2019218464A1 (en) * 2018-05-17 2019-11-21 平安科技(深圳)有限公司 Application program testing method and apparatus, and mobile terminal and medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040255279A1 (en) * 2003-04-22 2004-12-16 Alasdair Rawsthorne Block translation optimizations for program code conversation
CN105117343A (en) * 2015-09-18 2015-12-02 厦门美图移动科技有限公司 Method and device for performing automatic testing based on text

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040255279A1 (en) * 2003-04-22 2004-12-16 Alasdair Rawsthorne Block translation optimizations for program code conversation
CN105117343A (en) * 2015-09-18 2015-12-02 厦门美图移动科技有限公司 Method and device for performing automatic testing based on text

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
黄璞生: "《计算机算法语言》", 31 December 1990 *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109766228A (en) * 2017-11-09 2019-05-17 北京京东尚科信息技术有限公司 Verification method and device on a kind of line based on interface
WO2019218464A1 (en) * 2018-05-17 2019-11-21 平安科技(深圳)有限公司 Application program testing method and apparatus, and mobile terminal and medium

Similar Documents

Publication Publication Date Title
US10620945B2 (en) API specification generation
CN106022483B (en) The method and apparatus converted between machine learning model
CN106569824B (en) Method and apparatus, the method and apparatus of page rendering of page data compiling
CN107273269B (en) Log analysis method and device
CN104834603B (en) A kind of controlling stream towards regression test changes domain of influence analysis method and system
US9182953B2 (en) Hybrid dynamic code compiling device, method, and service system thereof
CN102665231B (en) Method of automatically generating parameter configuration file for LTE (Long Term Evolution) system
CN103942137A (en) Browser compatibility testing method and device
CN108804304B (en) Test case generation method and device, storage medium and electronic equipment
CN102736943B (en) Dynamic compiling and executing method of embedded browser engine
KR102533070B1 (en) Method for prioritizing resources based on dependency of web resources, recording medium and device for performing the method
CN105786705A (en) Execution method and device of nested loop test scripts
CN106326112B (en) A kind of method and apparatus that procedure operation is corrected automatically
CN107182078B (en) Method for analyzing circuit switched fallback test report of terminal, terminal and storage device
CN105022667B (en) One kind being based on built-in browser CSS engine parallel methods
CN104932910A (en) Method and system for application program interface extension
CN107015986A (en) A kind of reptile crawls the method and device of webpage
CN105938496A (en) Webpage content extraction method and apparatus
RU2005115976A (en) PARTIAL UNSOLVED INPUT DATA ANALYSIS MECHANISM
CN109240922B (en) Method for extracting webshell software gene to carry out webshell detection based on RASP
CN113794732B (en) Method, device, equipment and storage medium for deploying simulation network environment
US20080104576A1 (en) Method and arrangement for locating input domain boundaries
CN108830082B (en) XSS vulnerability detection parameter automatic selection method based on output point position
CN111596970B (en) Method, device, equipment and storage medium for dynamic library delay loading
CN106293862B (en) A kind of analysis method and device of expandable mark language XML data

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20160720

RJ01 Rejection of invention patent application after publication