CN108536593A - CS Framework Softwares automated testing method based on UI and system - Google Patents

CS Framework Softwares automated testing method based on UI and system Download PDF

Info

Publication number
CN108536593A
CN108536593A CN201810282603.3A CN201810282603A CN108536593A CN 108536593 A CN108536593 A CN 108536593A CN 201810282603 A CN201810282603 A CN 201810282603A CN 108536593 A CN108536593 A CN 108536593A
Authority
CN
China
Prior art keywords
test case
script
test
function
case script
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
CN201810282603.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.)
Taihua Wisdom Industry Group Co Ltd
Original Assignee
Taihua Wisdom Industry Group 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 Taihua Wisdom Industry Group Co Ltd filed Critical Taihua Wisdom Industry Group Co Ltd
Priority to CN201810282603.3A priority Critical patent/CN108536593A/en
Publication of CN108536593A publication Critical patent/CN108536593A/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/3664Environments for testing or debugging software
    • 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 present invention provides a kind of CS Framework Softwares automated testing method and system based on UI.This method includes:Identify the title and identification information of tested software all parts;According to the description file of the title of each component and identification information forming member;Test is called to prepare script to obtain the running environment data of tested software;Test case, which is formed, according to the title of test case script executes list;The sequence that the title of test case script in list is executed according to test case executes each test case script in list for test case, test case perform script is called, using running environment data initialization tested software, implementation of test cases script;Check results script is called to verify the implementing result of test case script;It after whole test case scripts are finished, call and generates the test report that report script generates tested software, the present invention realizes the automatic test to CS Framework Softwares.

Description

CS Framework Softwares automated testing method based on UI and system
Technical field
The present invention relates to the software test fields of CS frameworks, and in particular to a kind of CS Framework Softwares automation survey based on UI Method for testing and system.
Background technology
Software regression testing is the huge work of a workload, and manual test is completely covered test case and wastes very much people Power and time, endless all standing may then omit defect, influence product quality, and in the case, Automation regression testing can be with Regression test is completed unattendedly, and whether in current version still normal, by tester if verifying the normal function of previous version Member releases from uninteresting regression test, improves working efficiency.
Current major part UI automatic tests are using commercial testing tool or the test frame increased income, business testing tool work( Energy comparative maturity, but it is costly, lack flexibility, can not freely customize test method, and test script and operation class The method degree of coupling is higher, if software size is huge, demand becomes more frequent, and test case will be difficult to safeguard after changing interface.It opens Source test frame is relatively flexible, and there is highly scalable, most automated test frames to be based on page object model support Structure is only applicable to web applications, can not test the software of CS frameworks.
Therefore it provides a kind of CS Framework Softwares automated testing method and system based on UI, realize the software of CS frameworks It realizes automatic test, is this field urgent problem to be solved.
Invention content
The present invention provides a kind of CS Framework Softwares automated testing method and system based on UI, solves the prior art Middle automated test frame can not test the technical issues of software of CS frameworks.
In order to solve the above technical problem, the present invention provides a kind of CS Framework Softwares automatic test side based on UI Method, this method include:
Identifying the title and identification information of tested software all parts, wherein the tested software is the software of CS frameworks, The component of the tested software includes one kind or more in menu, window, dialog box, button, input frame, combobox and choice box Kind, each component is in same level or different levels, and in same level, the identification information and the component are unique It is corresponding;
For each of recognizing the component, retouching for the component is formed according to the title of the component and identification information State file;
Preset test is called to prepare script to obtain the running environment data of the tested software;
Test case is formed according to the title of preset test case script and executes list, wherein the test case is held Row-column list includes the title of at least one test case script, includes multiple surveys when the test case executes list When the title of case script on probation, the title of each test case script sorts in a predetermined order;
The sequence that the title of test case script described in list is executed according to the test case is used for the test Example executes each test case script in list, preset test case perform script is called, using the running environment Tested software described in data initialization executes the test case script, wherein the test case script can call described It is the description file of component, preset for describing the file of global constant and preset operating method function;
It often runs succeeded after a test case script, calls preset check results script to the test case The implementing result of script is verified, and marks test result corresponding with the test case script, to the execution As a result after being verified, the tested software is closed, returns to the step of calling the test case perform script;
After all the test case script is finished, preset generation report script is called to generate described tested soft The test report of part, wherein the test report includes the test result.
Through the above technical solutions, in same level, identification information is uniquely corresponding with component, changes conventional frame use Coordinate or component names identification avoid the problem that leading to not identification because interface changes;Test case script and test case Perform script is the script that user writes in advance according to tested software, by calling test case perform script that can execute correspondence Test case script, realize the process that executes automatically, it is the script for CS Framework Software bespokes that test, which prepares script, For providing the materials such as required file, template to the operation of CS Framework Softwares, as running environment data;Test case script Title be arranged in sequence test case execute list in, pass through test case execute list in test case script name Title transfers test case script successively, can orderly execute all test case scripts automatically, realizes automatic test, and And check results script can verify the implementing result of test case script, whether automatic decision test case script is held It goes successfully, whole flow process realizes automatic operating, reduces personnel's input, reduces testing cost.
Further:Preset operating method function includes:It obtains the function of menu, obtain function, the point of page elements It hits the function of menu, click the function of button, the function of theactivewindow, the function of alternative pack, the function for inputting text, verification The peace of the function of test result, the function of sectional drawing, the function of selection region, the function for generating test report, configuration tested software The function for filling path, closes the function of tested software, the function for restarting tested software, shortcut key at the function for starting tested software The function of the function of operation, the function for initializing tested software and/or abnormality processing;
The preset file for describing global constant includes:For describe to preserve executable program path, file path, The file of file name and/or conventional characters.
The test case script can also call the function of quick key operation, and the function of the quick key operation includes behaviour Make the function of the shortcut key of the menu or the button;
The test case script can also call preset test data file, wherein the test data file packet It includes using the input data needed for the tested software;
The test case script can also mutually be called according to preset test case set membership table, wherein described Test case set membership table is used to define the set membership between each test case script;
The test case script includes level-one test case script and two level test case script, wherein the level-one Test case script is used to test the general purpose routine operating procedure of the tested software, and the two level test case script is for surveying The detailed service operating procedure of the tested software is tried, the two level test case script calls the level-one in the process of implementation Test case script.
Through the above technical solutions, the fundamental operation to tested software may be implemented in preset operating method function, holding Operating method function is directly transferred when row test case script, the complexity of test case script can be reduced;Test data The operating procedure specifically quantified is provided when file is for implementation of test cases script, test case set membership table can be determined Set membership between adopted test case makes mutually quote the multiplexing improved between test case between test case script Degree.
Further:Include using tested software described in the running environment data initialization:
Detect the process that whether there is the tested software in operating system;
If there is the process, then after process described in positive closing, the tested software is opened, clear history trace, And load the running environment data.
Through the above technical solutions, to it when initialization tested software can prevent tested software to be in a certain operation interface He generates interference at operating procedure.
Further:While executing the test case script, call preset check results script to the survey Before the implementing result of case script on probation is verified, the method further includes:
Process to executing the test case script is monitored, when monitoring not recognize institute in the given time When stating component to be operated in test case script, the operating procedure time-out of the test case script test is determined;
When the operating procedure time-out of test case script test, the tested software is restarted in misregistration daily record, The test case script is executed again;
When the operating procedure time-out of the same test case script test is more than pre-determined number, the test is used Case script label is not carried out successful status information, and executes test case script described in list according to the test case The sequence of title calls preset test case perform script to execute next test case script;
Wherein, when the operating procedure of test case script test time-out does not occur, the test case foot is indicated Originally it runs succeeded.
Through the above technical solutions, the execution step to test case script carries out monitoring abnormal state, it can be to avoid survey Case script on probation wastes time when not responding in the process of implementation, by setting the value of predetermined time, tested software can be made to exist It is directly closed after not responded more than the predetermined time, and restarts tested software, execute the test case script, Ke Yipai again Except because of the case where historical data influences test case script normal operation in tested software, if the test case script is not yet just Often operation can then exclude the case where historical data in tested software influences the test case script.
Further:Preset check results script is called to verify the implementing result of the test case script, And the step of marking test result corresponding with the test case script, includes:
It calls the check results script verification to preset the state of checkpoint, and the state of the default checkpoint is carried out Sectional drawing;
When the state of the checkpoint meets the predetermined state of the checkpoint, label and the test case script phase Corresponding test result is to pass through, and when the state of the checkpoint is unsatisfactory for the predetermined state, label is used with the test The corresponding test result of case script is not pass through;
Wherein, the test report of the tested software further includes the sectional drawing of the default checkpoint.
Through the above technical solutions, testing to the state of checkpoint and sectional drawing can intuitively find out test case foot The result of this execution.
In order to solve the above technical problem, the present invention provides a kind of CS Framework Software automatic tests system based on UI System, the system include:
Basal layer, the basal layer include that test prepares script, test case perform script, check results script and generation Report script, wherein the test prepares the running environment data that script is used to obtain tested software, and the tested software is CS The software of framework, the test case perform script are used to, using tested software described in the running environment data initialization, hold Row test case script, the check results script are marked for being verified to the implementing result of the test case script Note test result corresponding with the test case script, the survey for generating report script and being used to generate the tested software Examination report, wherein the test report includes the test result;
Object layer, the object layer include all parts of the tested software description file and for describe it is global often The file of amount, wherein the description file is formed according to the title and identification information of the component, the component of the tested software Including one or more in menu, window, dialog box, button, input frame, combobox and choice box, at each component In same level or different levels, in same level, the identification information and the component are uniquely corresponding;
Tool layer, the tool layer include preset operating method function;
Use-case layer, the use-case layer include that test case executes list and the test case script, wherein the test Use-case executes the title that list includes at least one test case script, includes multiple when the test case executes list When the title of the test case script, the title of each test case script sorts in a predetermined order, and the test is used Case script can call the description file, is described for describing the file of global constant and the operating method function,
Wherein, the test case perform script executes test case script described in list according to the test case The sequence of title, executes each test case script in the test case execution list, and the check results script exists It often runs succeeded and the implementing result of the test case script is verified after a test case script, the generation Report script generates the test report of the tested software after all test case scripts are finished.
Through the above technical solutions, test case, handling function, object and test data are carried out abstract separation, drop The low workload and difficulty of maintenance test use-case, basal layer, which is used to provide test to automatic testing process, to be prepared script, surveys Example perform script, check results script and generation report script on probation, run through entire testing process;Tool layer is for realizing right The fundamental operation of tested software;Object layer is used to store whole components, global constant and the shortcut key of tested software;Use-case layer is used List and test case set membership table are executed in the whole test case script of storage, test data file, test case.
Further:Preset operating method function includes:It obtains the function of menu, obtain function, the point of page elements It hits the function of menu, click the function of button, the function of theactivewindow, the function of alternative pack, the function for inputting text, verification The peace of the function of test result, the function of sectional drawing, the function of selection region, the function for generating test report, configuration tested software The function for filling path, closes the function of tested software, the function for restarting tested software, shortcut key at the function for starting tested software The function of the function of operation, the function for initializing tested software and/or abnormality processing;
The preset file for describing global constant includes:For describe to preserve executable program path, file path, The file of file name and/or conventional characters.
The object layer further includes the function of preset quick key operation, and the test case script can also call fast The function of key operation, the function of the quick key operation include the function for the shortcut key for operating the menu or the button;
The use-case layer further includes preset test data file and preset test case set membership table, wherein institute It includes using the input data needed for the tested software to state test data file, and the test case set membership table is for fixed Set membership between each test case script of justice, the test case script can also call the test data text It part and is mutually called according to the test case set membership table;
The test case script includes level-one test case script and two level test case script, wherein the level-one Test case script is used to test the general purpose routine operating procedure of the tested software, and the two level test case script is for surveying The detailed service operating procedure of the tested software is tried, the two level test case script calls the level-one in the process of implementation Test case script.
Through the above technical solutions, operating method function can carry test case script in implementation of test cases script For some basis operating procedure, and all test case scripts can call operation method function, reduce test It with the complexity of case script, and reduces user and writes the workload of test case script, while reducing test case The error rate of script;Meanwhile test case script can directly access path and the file path of executable program, to obtain Take corresponding executable program and file, by call file name and the corresponding file of conventional characters name acquiring and Conventional characters;And user defines test after having write test case script according to the subordinate relation between test case script Use-case set membership table makes mutually be called according to test case set membership table between test case script.
Further:The test case perform script is used for soft using being tested described in the running environment data initialization When part, specific the step of executing, includes:
Detect the process that whether there is the tested software in operating system;
If there is the process, then after process described in positive closing, the tested software is opened, clear history trace, And load the running environment data.
Through the above technical solutions, can ensure that tested software empties the cache data before implementation of test cases, ensure Test case script normally executes.
Further:The test case perform script be additionally operable to while executing the test case script execute with Lower step:
Process to executing the test case script is monitored, when monitoring not recognize institute in the given time When stating component to be operated in test case script, the operating procedure time-out of the test case script test is determined;
When the operating procedure time-out of test case script test, the tested software is restarted in misregistration daily record, The test case script is executed again;
When the operating procedure time-out of the same test case script test is more than pre-determined number, the test is used Case script label is not carried out successful status information, and executes test case script described in list according to the test case The sequence of title calls preset test case perform script to execute next test case script;
Wherein, when the operating procedure of test case script test time-out does not occur, the test case foot is indicated Originally it runs succeeded.
It can be rung in tested software through the above technical solutions, carrying out exception monitoring to the implementation procedure of test case script Tested software is automatically closed when answering time-out and restarts tested software, when no sound is performed a plurality of times in performed test case script At once the status information executed not successfully is marked, it can be to avoid the test case because of the historical data in tested software to performed by The case where script interferes improves the accuracy of test result.
Further:The check results script is verified in the implementing result to the test case script, and is marked When remembering test result corresponding with the test case script, following steps are specifically executed:
The state of checkpoint is preset in verification, and carries out sectional drawing to the state of the default checkpoint;
When the state of the checkpoint meets the predetermined state of the checkpoint, label and the test case script phase Corresponding test result is to pass through, and when the state of the checkpoint is unsatisfactory for the predetermined state, label is used with the test The corresponding test result of case script is not pass through;
Wherein, the test report of the tested software further includes the sectional drawing of the default checkpoint.
Through the above technical solutions, sectional drawing is preserved and is incorporated into test report, user can be facilitated intuitively to see It to the status information of checkpoint, is combined with the test report of html format, user is facilitated comprehensively to obtain the execution of tested software As a result.
Compared with prior art, CS Framework Softwares automated testing method and system of the invention based on UI, realize Following advantageous effect:
One, software of the present invention for CS frameworks carries out automatic test, and the software automation for having filled up CS frameworks is surveyed The blank in examination field;
Two, test case, handling function, object and test data are carried out abstract separation by the present invention, reduce maintenance The workload and difficulty of test case reduce personnel's input instead of a large amount of manual operations, can on one's own time certainly It is dynamic to execute, it improves work efficiency and shortens the project development period, reduce software cost;
Three, the present invention is different from using coordinate or component in conventional method using unique identification information come identification component Title identification component can change the problem of leading to not identification to avoid because of interface.
Description of the drawings
It is combined in the description and the attached drawing of a part for constitution instruction shows the embodiment of the present invention, and even With its explanation together principle for explaining the present invention.
Fig. 1 is the CS Framework Software automated testing method flow charts based on UI in embodiment one;
Fig. 2 is the CS Framework Software automated testing method flow charts based on UI in embodiment two;
Fig. 3 is the CS Framework Software automatization test system block diagrams based on UI.
Specific implementation mode
Carry out the various exemplary embodiments of detailed description of the present invention now with reference to attached drawing.It should be noted that:Unless in addition having Body illustrates that the unlimited system of component and the positioned opposite of step, numerical expression and the numerical value otherwise illustrated in these embodiments is originally The range of invention.
It is illustrative to the description only actually of at least one exemplary embodiment below, is never used as to the present invention And its application or any restrictions that use.
Technology, method and apparatus known to person of ordinary skill in the relevant may be not discussed in detail, but suitable In the case of, the technology, method and apparatus should be considered as part of specification.
In shown here and discussion all examples, any occurrence should be construed as merely illustrative, without It is as limitation.Therefore, other examples of exemplary embodiment can have different values.
It should be noted that:Similar label and letter indicate similar terms in following attached drawing, therefore, once a certain Xiang Yi It is defined, then it need not be further discussed in subsequent attached drawing in a attached drawing.
Embodiment one:
A kind of CS Framework Software automated testing methods based on UI are present embodiments provided, it can be to the software of CS frameworks Automatically it is tested, shortens the project development period instead of a large amount of manual operationss to improve working efficiency.In the method, first The running environment data for first obtaining tested software, initialize tested software;Then it is formed and is surveyed according to preset test case title Example on probation executes list, all test cases in implementation of test cases list, and terminal check test result simultaneously generates test report It accuses.Specifically, being the CS Framework Software automated testing methods provided by the invention based on UI as shown in Figure 1, this method includes Following step S101 to step S107:
S101:Identify the title and identification information of tested software all parts;
Wherein, tested software is the software of CS frameworks, the component of tested software include menu, window, dialog box, button, The elements such as input frame, combobox and choice box, identification information are the unique ID code of each component, and all parts are in same layer Grade or different levels, and in same level, identification information is uniquely corresponding with component;The present invention is marked using identification information Each component is different from using coordinate or the method for component names flag member in traditional software coding, can be to avoid because of interface Change leads to not the problem of identification, and accuracy is high, strong environmental adaptability.
S102:For each component recognized, according to the description file of the title of component and identification information forming member;
After the description file of forming member, be described file can be saved in library of object, be used convenient for preset test Case script transfers each component by describing file.
S103:Preset test is called to prepare script to obtain the running environment data of tested software;
Wherein, it is the script provided exclusively for test CS Framework Softwares that test, which prepares script, and test, which prepares script, to be The default test for supporting a variety of CS Framework Softwares general prepares script, or user individually compiles for certain CS Framework Softwares The test write prepares script, when tested software and preset test preparation script mismatch, needs user according to current tested The attribute bespoke test of software prepares script, to ensure that running environment data are mutually compatible with tested software.Test is executed The materials such as the execution of test case script required file, template can be generated after preparing script, as running environment data.
S104:Test case, which is formed, according to the title of preset test case script executes list;
It can be excel tables that test case, which executes list, wherein each preset test case script all has test Use-case script name, user can name according to the purpose of every test case script for test case script, and title is pressed Test case is arranged according to predetermined order to execute in list.Specifically, user can carry out test case script according to function Sequence, can also be ranked up test case script according to usage degree difference.
S105:The sequence that the title of test case script in list is executed according to test case is executed for test case Each test case script name in list, calls preset test case perform script, using at the beginning of running environment data Beginningization tested software, implementation of test cases script;
Each test case script is executed by test case perform script, judges the expected results of every test case Whether it is consistent with actual result.Wherein, each test case script can call the description file of above-mentioned component, preset use File in description global constant and preset operating method function, due to above-mentioned component, global constant and operating method letter Number has been pre-set before testing begins, is kept the process of implementation of test cases more convenient, is reduced workload, is improved Working efficiency.
Wherein, preset operating method function includes:The function for obtaining menu, clicks dish at the function for obtaining page elements Function, the check test of single function, the click function of button, the function of theactivewindow, the function of alternative pack, input text As a result the function of function, sectional drawing, the function of selection region, the function for generating test report, the installation road for configuring tested software The function of diameter, closes the function of tested software, the function for restarting tested software, quick key operation at the function for starting tested software Function, initialize tested software function and abnormality processing function etc.;Operating method function is used in implementation of test cases The operating procedure on some bases is provided test case script when script, and all test case scripts can call behaviour Make method function, reduce the complexity of test case script, and reduces the work that user writes test case script Amount, while reducing the error rate of test case script.
File for describing global constant includes:For describing to preserve executable program path, file path, filename The file of title and/or conventional characters.In implementation of test cases script, test case script can directly access executable program Path and file path, to obtain corresponding executable program and file, while can pass through and call filename Claim file corresponding with conventional characters name acquiring and conventional characters;The step transfers preset operating method function with above-mentioned It is combined, the common execution efficiency for improving test case script, simplify test case script writes step.In addition, user exists It has write and test case set membership table is defined according to the subordinate relation between test case script after test case script, made survey It can mutually be called according to test case set membership table between case script on probation.
Further, test case script can also call preset test data file, test data file for pair The operating procedure specifically quantified is provided when implementation of test cases script, user can be according to the specific ginseng of specific tested software Number sets specific test data file, for example, when test electric business class CS Framework Softwares, test data file may include setting The amount of money etc. of specific Payment Amount, the price range of the different commodity of screening, the various discount coupons of definition.
Further, test case script can also call the function of quick key operation, the function of quick key operation to include The function of the shortcut key of actions menu or button, can be further simplified test case script, facilitate test case script to dish The operation of list or button.
S106:It often runs succeeded after a test case script, calls preset check results script to test case foot This implementing result is verified, and marks test result corresponding with test case script, and school is being carried out to implementing result After testing, tested software, return to step S105 are closed;
Wherein, preset check results script is the script that user writes for the desired effect of each test case, After test case script is finished, check results script can verify the implementing result of this test case, school Tested software is closed after testing, and returns to the step of calling test case perform script, is continued to execute test case and is executed row Other test case scripts in table, and check results, so cycle are executed until test case executes the test case in list Test case script corresponding to script name all executes completion.
S107:After whole test case scripts are finished, preset generation report script is called to generate tested software Test report, wherein test report includes test result.
In conclusion this method can test tested software automatically, user only needs pre-set required survey Case script, test data on probation etc. can be tested automatically, reduced personnel's input, improved work efficiency.
Embodiment two:
The embodiment of the present invention two on the basis of the above embodiment 1, it is soft to provide a kind of CS frameworks being based preferably on UI Part automated testing method, related place can refer to the description of above-described embodiment one, and specifically, Fig. 2 is the embodiment of the present invention two The CS Framework Software automated testing method flow charts based on UI, this method comprises the following steps S201 to S205:
S201:Identify the title and identification information of tested software all parts;
Wherein, tested software is the software of CS frameworks, the component of tested software include menu, window, dialog box, button, The elements such as input frame, combobox and choice box, identification information are the unique ID code of each component, and all parts are in same layer Grade or different levels, and in same level, identification information is uniquely corresponding with component;The present invention is marked using identification information Each component is different from using coordinate or the method for component names flag member in traditional software coding, can be to avoid because of interface Change leads to not the problem of identification, and accuracy is high, strong environmental adaptability.
S202:For each component recognized, according to the description file of the title of component and identification information forming member;
After the description file of forming member, be described file can be saved in library of object, be used convenient for preset test Case script transfers each component by describing file.
S203:Preset test is called to prepare script to obtain the running environment data of tested software;
Wherein, it is the script provided exclusively for test CS Framework Softwares that test, which prepares script, and test, which prepares script, to be The default test for supporting a variety of CS Framework Softwares general prepares script, or user individually compiles for certain CS Framework Softwares The test write prepares script, when tested software and preset test preparation script mismatch, needs user according to current tested The attribute bespoke test of software prepares script, to ensure that running environment data are mutually compatible with tested software.Test is executed The materials such as the execution of test case script required file, template can be generated after preparing script, as running environment data.
S204:Detect the process that whether there is the tested software in operating system;
If there is the process, then after process described in positive closing, the tested software is opened, clear history trace, And load the running environment data;If there is no the process of the tested software, then enter next step;
The step is for initializing tested software, to other operating procedures when tested software being prevented to be in a certain operation interface Generate interference.For example, when whether test tested software can input account number cipher and normally log in, if the tested software has been located It in login status, then needs that tested software is closed and logged off, if having stored the account of user in the tested software Number password, then need clear history trace, to remove the account number cipher information to prestore.
S205:Test case, which is formed, according to the title of preset test case script executes list;
It can be excel tables that test case, which executes list, wherein each preset test case script all has test Use-case script name, user can name according to the purpose of every test case script for test case script, and title is pressed Test case is arranged according to predetermined order to execute in list.Specifically, user can carry out test case script according to function Sequence, can also be ranked up test case script according to usage degree difference.
Specifically, preset test case script includes level-one test case script and two level test case script;Its In, level-one test case script mainly includes the operating procedure of general purpose routine, and two level test case script includes mainly detailed industry The operating procedure of business;Level-one test case script and two level test case script are arranged in test case and execute list respectively In, and two level test case script can call level-one test case script in the process of implementation, when transferring and execute some When two level test case script, by level-one test case script that the two level test case script is transferred while being performed, at this time User can select to ignore the level-one test case script transferred, to achieve the effect that reduce workload, improve testing efficiency.
S206:The sequence that the title of test case script in list is executed according to test case is executed for test case Each test case script name in list, calls preset test case perform script, using at the beginning of running environment data Beginningization tested software, implementation of test cases script;
S207:The process of implementation of test cases script is monitored, judge test case script operating procedure whether Time-out
When the operating procedure time-out for the test case script being carrying out, S208 is entered step;When the survey being carrying out When the operating procedure of case script on probation has not timed out, S209 is entered step.
Judge test case script operating procedure whether time-out method be:When monitoring not know in the given time When being clipped to component to be operated in the test case script, the operating procedure time-out of the test case script test is determined; When recognizing component to be operated in the test case script in the given time, the operation step of the test case is judged Suddenly it has not timed out.
Specifically, user can set the predetermined time according to the requirement of the response speed to tested software, such as set certain The predetermined time of test case script is 60S, if the test is used after timing when starting to execute the test case script, 60S Case script does not execute normally, can not transfer component, and then None- identified indicates the test case to component to be operated Script operation step time-out.
S208:Misregistration daily record, restarts tested software, executes the test case script again;When the same test When being more than pre-determined number with the operating procedure time-out of case script, successful state is not carried out to the test case script markup and is believed Breath, and according to the sequence of the title of test case script described in test case execution list, preset test is called to use Example perform script executes next test case script.
For example, setting pre-determined number is twice, when the operating procedure time-out of test case script, to restart tested software, The test case script is executed again, if the operating procedure again time out of the test case script, it was demonstrated that the test case foot This can not still be executed after restarting tested software, and the suitable of the title of the test case script in list is executed according to test case Sequence calls preset test case perform script to execute next test case script.User, can be with by the way that pre-determined number is arranged Restart tested software after test case script operation time-out and execute the test case again, tested software can be excluded and held The case where being influenced by the historical operation step of other test case scripts when row test case script, and predetermined time be arranged Number is bigger, and the reliability of test result is higher.
S209:Preset check results script verification is called to preset the state of checkpoint, and the state to presetting checkpoint Carry out sectional drawing;When the state of checkpoint meets the predetermined state of checkpoint, label is corresponding with the test case script Test result is to pass through, and when the state of checkpoint is unsatisfactory for predetermined state, marks test corresponding with test case script As a result it is not pass through;
Specifically, user can set checkpoint simultaneously according to the testing requirement of test case script in check results script And the preset state of checkpoint is set, for example, it is desired to which executing the payment page in step to certain test case script carries out school Test, it is contemplated that inspection result be open payment page window when automatic spring dummy keyboard, i.e., checkpoint be payment the page, verification As a result script carries out school when the execution step to test case script goes to payment page window to the state of the window It tests, pop-up dummy keyboard is checked whether, if not popping up dummy keyboard, then it represents that the state of default checkpoint is not verified; Indicate that the state for presetting checkpoint checks the state of checkpoint by examining user's later stage if popping up dummy keyboard.
S210:Verification judges whether the test case that test case executes in list all executes completion behind checkpoint;
Step S206 is returned to if not completing, by calling test case perform script to execute remaining test case foot This, step S211 is carried out if all executing completion.
S211:It calls and generates report script generation test report;
Specifically, test report includes test result and sectional drawing, test report is html formats.
In conclusion this method alleviates the workload of tester, greatly reduces instead of a large amount of manual operations The complexity of test case script, and increase exception monitoring link, when can be long to avoid the test case script of execution Between without response testing efficiency is impacted, improve the accuracy of test result.
Embodiment three:
The present embodiment is on the basis of embodiment one and embodiment two, it is proposed that a kind of CS Framework Softwares based on UI are automatic Change test system, as shown in figure 3, including through the basal layer of entire test process script, for storing all tested softwares Component, the object layer of global constant and shortcut key, the tool layer for storing preset operating method function and for depositing Store up the use-case layer of all test case scripts.Wherein tested software is the software of CS frameworks, specifically:
Basal layer includes that test prepares script, test case perform script, check results script and generates report script, is surveyed Examination prepares the running environment data that script is used to obtain tested software, and soft using being tested described in running environment data initialization When part, specific the step of executing, includes:Detect the process that whether there is tested software in operating system;If there is process, then After positive closing process, the tested software, clear history trace, and load operating environmental data are opened;
Test preparation script is the script provided exclusively for test CS Framework Softwares, and test prepares script can be more to support The general default test of kind CS Framework Softwares prepares script, or user individually compiles for the CS Framework Softwares of certain classification The test write prepares script, when tested software and preset test preparation script mismatch, needs user according to current tested The attribute bespoke test of software prepares script, to ensure that running environment data are mutually compatible with tested software;Test case is held This travel far and wide for using running environment data initialization tested software, implementation of test cases script;
Check results script marks and the test case for being verified to the implementing result of test case script The corresponding test result of script, specifically, the checkpointed state that check results script executes test case step carries out school Test, when test case script executes the state of checkpoint is consistent with preset checkpointed state in step when, labeled as passing through, and And sectional drawing is carried out to checkpointed state;When test case script executes the state with preset checkpointed state of checkpoint in step When not being inconsistent, sectional drawing is carried out labeled as not passing through, and to checkpointed state;
The test report that report script is used to generate tested software is generated, generates report script by shot image information and execution Result information is integrated into the test report of html formats, and test report includes test result.
The description file and the file for describing global constant that object layer includes all parts of tested software, wherein Description file is formed according to the title and identification information of the component, the component of tested software include menu, window, dialog box, Button, input frame, combobox and choice box etc., all parts are in same level or different levels, in same level, mark Information is uniquely corresponding with component;Object layer is used to store all components of tested software and describes the file of global constant, just Required component or global constant are directly invoked in the process of implementation in test case.Specifically, the text for describing global constant Part includes:File for describing preservation executable program path, file path, file name and/or conventional characters.Specifically , object layer further includes the function of preset quick key operation, and test case script can also call the function of quick key operation, The function of quick key operation includes the function of the shortcut key of actions menu or button.
Tool layer is the common support tool of the automatization test system, if for providing drying method and being inherited and sealed Dress realizes the fundamental operation to tested software.Specifically, tool layer includes preset operating method function, operating method function Including:The function for obtaining menu, the function for obtaining page elements, the function for clicking menu, function, the theactivewindow for clicking button Function, the function of alternative pack, the input function of text, the function of check test result, the function of sectional drawing, selection region Function, the function for generating test report, the function of installation path for configuring tested software, the function for starting tested software, closing The function of tested software, the function for restarting tested software, quick key operation function, initialize tested software function and/or The function of abnormality processing;Operating method function is used to provide some bases to test case script in implementation of test cases script Operating procedure, and all test case scripts can call operation method function, reduce test case script Complexity, and reduce user and write the workload of test case script, while reducing test case script error rate.
Use-case layer includes that test case executes list, the test case script, test case set membership table and survey Try data file.
Specifically, it is excel tables that test case, which executes list, each test case script all has corresponding test case Script name, user can name according to the purpose of every test case script for test case script, and by title according to pre- The fixed test case that is sequentially arranged in executes in list.Specifically, user can be ranked up test case script according to function, Test case script can also be ranked up according to usage degree difference.Test case script can call description file, use In the file and operating method function of description global constant.
Further, preset test case script includes level-one test case script and two level test case script; Wherein, level-one test case script mainly includes the operating procedure of general purpose routine, and two level test case script includes mainly detailed The operating procedure of business;Level-one test case script and two level test case script are arranged in test case and execute list respectively In, and two level test case script can call level-one test case script in the process of implementation, when transferring and execute some When two level test case script, by level-one test case script that the two level test case script is transferred while being performed, at this time User can select to ignore the level-one test case script transferred, to achieve the effect that reduce workload, improve testing efficiency.
Test case set membership table is used to define the set membership between test case script, to improve test case foot Reusing degree between this.
There is provided the operating procedure that specifically quantifies when test data file is for implementation of test cases script, user can be with Specific test data file test case script is set according to the design parameter of specific tested software in the process of implementation may be used To directly invoke test data file.
The CS Framework Softwares automatization test system based on UI is by test case, handling function, object and tests number According to abstract separation is carried out, reduce the workload and difficulty of maintenance test use-case reduces people instead of a large amount of manual operations Member input, can execute automatically on one's own time, improve work efficiency and shorten the project development period, reduce software at This.
It should be understood by those skilled in the art that, the embodiment of the present invention can be provided as method, apparatus or computer program Product.Therefore, the present invention can be used complete hardware embodiment, complete software embodiment or combine software and hardware.

Claims (10)

1. the CS Framework Software automated testing methods based on UI, which is characterized in that including:
Identify the title and identification information of tested software all parts, wherein the tested software is the software of CS frameworks, described The component of tested software include it is one or more in menu, window, dialog box, button, input frame, combobox and choice box, Each component is in same level or different levels, and in same level, the identification information and the component are uniquely right It answers;
For each of recognizing the component, the description text of the component is formed according to the title of the component and identification information Part;
Preset test is called to prepare script to obtain the running environment data of the tested software;
Test case is formed according to the title of preset test case script and executes list, wherein the test case executes row Table includes the title of at least one test case script, includes that multiple tests are used when the test case executes list When the title of case script, the title of each test case script sorts in a predetermined order;
The sequence that the title of test case script described in list is executed according to the test case, holds for the test case Each test case script in row-column list, calls preset test case perform script, using the running environment data The tested software is initialized, the test case script is executed, wherein the test case script can call the component Description file, preset for describing the file of global constant and preset operating method function;
It often runs succeeded after a test case script, calls preset check results script to the test case script Implementing result verified, and corresponding with test case script test result is marked, to the implementing result After being verified, the tested software is closed, returns to the step of calling the test case perform script;
After all the test case script is finished, preset generation report script is called to generate the tested software Test report, wherein the test report includes the test result.
2. the CS Framework Software automated testing methods according to claim 1 based on UI, which is characterized in that
Preset operating method function includes:Obtain menu function, obtain page elements function, click menu function, Click the letter of the function of button, the function of theactivewindow, the function of alternative pack, the function for inputting text, check test result Number, the function of sectional drawing, selection region function, generate test report function, configure tested software installation path function, Start tested software function, close the function of tested software, the function for restarting tested software, quick key operation function, just The function of beginningization tested software and/or the function of abnormality processing;
The preset file for describing global constant includes:For describing to preserve executable program path, file path, file The file of title and/or conventional characters;
The test case script can also call the function of quick key operation, and the function of the quick key operation includes operation institute State the function of the shortcut key of menu or the button;
The test case script can also call preset test data file, wherein the test data file includes making With the input data needed for the tested software;
The test case script can also mutually be called according to preset test case set membership table, wherein the test Use-case set membership table is used to define the set membership between each test case script;
The test case script includes level-one test case script and two level test case script, wherein the level-one test It is used to test the general purpose routine operating procedure of the tested software with case script, the two level test case script is for testing institute The detailed service operating procedure of tested software is stated, the two level test case script calls the level-one to test in the process of implementation Use case script.
3. the CS Framework Software automated testing methods according to claim 1 based on UI, which is characterized in that described in use Tested software includes described in running environment data initialization:
Detect the process that whether there is the tested software in operating system;
If there is the process, then after process described in positive closing, the tested software, clear history trace are opened, and add Carry the running environment data.
4. the CS Framework Software automated testing methods according to claim 1 based on UI, which is characterized in that executing institute While stating test case script, preset check results script is called to carry out school to the implementing result of the test case script Before testing, the method further includes:
Process to executing the test case script is monitored, when monitoring not recognize the survey in the given time In case script on probation when component to be operated, the operating procedure time-out of the test case script test is determined;
When the operating procedure time-out of test case script test, misregistration daily record restarts the tested software, again Execute the test case script;
When the operating procedure time-out of the same test case script test is more than pre-determined number, to the test case foot This label is not carried out successful status information, and the title of test case script described in list is executed according to the test case Sequence, call preset test case perform script to execute next test case script;
Wherein, when the operating procedure of test case script test time-out does not occur, indicate that the test case script is held It goes successfully.
5. the CS Framework Software automated testing methods according to claim 1 based on UI, which is characterized in that call default Check results script the implementing result of the test case script is verified, and mark and the test case script phase The step of corresponding test result includes:
It calls the check results script verification to preset the state of checkpoint, and the state of the default checkpoint is cut Figure;
When the state of the checkpoint meets the predetermined state of the checkpoint, label is corresponding with the test case script Test result be pass through, when the state of the checkpoint is unsatisfactory for the predetermined state, label with the test case foot This corresponding test result is not pass through;
Wherein, the test report of the tested software further includes the sectional drawing of the default checkpoint.
6. a kind of CS Framework Software automatization test systems based on UI, which is characterized in that including:
Basal layer, the basal layer include that test prepares script, test case perform script, check results script and generates report Script, wherein the test prepares the running environment data that script is used to obtain tested software, and the tested software is CS frameworks Software, the test case perform script is used to, using tested software described in the running environment data initialization, execute survey Case script on probation, the check results script for being verified to the implementing result of the test case script, and mark with The corresponding test result of test case script, the test report for generating report script and being used to generate the tested software It accuses, wherein the test report includes the test result;
Object layer, the object layer include the description file of all parts of the tested software and for describing global constant File, wherein the description file is formed according to the title and identification information of the component, and the component of the tested software includes One or more in menu, window, dialog box, button, input frame, combobox and choice box, each component is in same One level or different levels, in same level, the identification information and the component are uniquely corresponding;
Tool layer, the tool layer include preset operating method function;
Use-case layer, the use-case layer include that test case executes list and the test case script, wherein the test case The title that list includes at least one test case script is executed, includes multiple described when the test case executes list When the title of test case script, the title of each test case script sorts in a predetermined order, the test case foot Originally the description file can be called, is described for describing the file of global constant and the operating method function,
Wherein, the test case perform script executes the title of test case script described in list according to the test case Sequence, execute the test case and execute each test case script in list, the check results script is held often It goes and the implementing result of the test case script is verified after a successfully test case script, the generation report Script generates the test report of the tested software after all test case scripts are finished.
7. the CS Framework Software automatization test systems according to claim 6 based on UI, which is characterized in that
Preset operating method function includes:Obtain menu function, obtain page elements function, click menu function, Click the letter of the function of button, the function of theactivewindow, the function of alternative pack, the function for inputting text, check test result Number, the function of sectional drawing, selection region function, generate test report function, configure tested software installation path function, Start tested software function, close the function of tested software, the function for restarting tested software, quick key operation function, just The function of beginningization tested software and/or the function of abnormality processing;
The preset file for describing global constant includes:For describing to preserve executable program path, file path, file The file of title and/or conventional characters;
The object layer further includes the function of preset quick key operation, and the test case script can also call shortcut key to grasp The function of work, the function of the quick key operation include the function for the shortcut key for operating the menu or the button;
The use-case layer further includes preset test data file and preset test case set membership table, wherein the survey Examination data file includes using the input data needed for the tested software, and the test case set membership table is each for defining Set membership between a test case script, the test case script can also call the test data file and It is mutually called according to the test case set membership table;
The test case script includes level-one test case script and two level test case script, wherein the level-one test It is used to test the general purpose routine operating procedure of the tested software with case script, the two level test case script is for testing institute The detailed service operating procedure of tested software is stated, the two level test case script calls the level-one to test in the process of implementation Use case script.
8. the CS Framework Software automatization test systems according to claim 6 based on UI, which is characterized in that the test Use-case perform script is used for:
Detect the process that whether there is the tested software in operating system;
If there is the process, then after process described in positive closing, the tested software, clear history trace are opened, and add Carry the running environment data.
9. the CS Framework Software automatization test systems according to claim 6 based on UI, which is characterized in that the test Use-case perform script is additionally operable to execute following steps while executing the test case script:
Process to executing the test case script is monitored, when monitoring not recognize the survey in the given time In case script on probation when component to be operated, the operating procedure time-out of the test case script test is determined;
When the operating procedure time-out of test case script test, misregistration daily record restarts the tested software, again Execute the test case script;
When the operating procedure time-out of the same test case script test is more than pre-determined number, to the test case foot This label is not carried out successful status information, and the title of test case script described in list is executed according to the test case Sequence, call preset test case perform script to execute next test case script;
Wherein, when the operating procedure of test case script test time-out does not occur, indicate that the test case script is held It goes successfully.
10. the CS Framework Software automatization test systems according to claim 6 based on UI, which is characterized in that the school It tests result script to verify in the implementing result to the test case script, and marks opposite with the test case script When the test result answered, following steps are specifically executed:
The state of checkpoint is preset in verification, and carries out sectional drawing to the state of the default checkpoint;
When the state of the checkpoint meets the predetermined state of the checkpoint, label is corresponding with the test case script Test result be pass through, when the state of the checkpoint is unsatisfactory for the predetermined state, label with the test case foot This corresponding test result is not pass through;
Wherein, the test report of the tested software further includes the sectional drawing of the default checkpoint.
CN201810282603.3A 2018-04-02 2018-04-02 CS Framework Softwares automated testing method based on UI and system Pending CN108536593A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201810282603.3A CN108536593A (en) 2018-04-02 2018-04-02 CS Framework Softwares automated testing method based on UI and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201810282603.3A CN108536593A (en) 2018-04-02 2018-04-02 CS Framework Softwares automated testing method based on UI and system

Publications (1)

Publication Number Publication Date
CN108536593A true CN108536593A (en) 2018-09-14

Family

ID=63482242

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201810282603.3A Pending CN108536593A (en) 2018-04-02 2018-04-02 CS Framework Softwares automated testing method based on UI and system

Country Status (1)

Country Link
CN (1) CN108536593A (en)

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062817A (en) * 2018-10-15 2018-12-21 网宿科技股份有限公司 Automated testing method and system
CN109634492A (en) * 2018-10-23 2019-04-16 中国平安人寿保险股份有限公司 Combobox designated value input method, device and computer readable storage medium
CN110109829A (en) * 2019-04-15 2019-08-09 福建天晴在线互动科技有限公司 Intelligent dialogue automates method of calibration, storage medium
CN111124245A (en) * 2019-12-24 2020-05-08 维沃移动通信有限公司 Control method and electronic equipment
CN112015638A (en) * 2020-07-30 2020-12-01 西安雷风电子科技有限公司 Automatic testing method and system
CN112306893A (en) * 2020-11-27 2021-02-02 平安普惠企业管理有限公司 UI page testing method and device, computer equipment and storage medium
CN112882931A (en) * 2021-02-06 2021-06-01 重庆富民银行股份有限公司 Automatic testing method and device based on DDT
CN115657633A (en) * 2022-09-26 2023-01-31 北京罗克维尔斯科技有限公司 Electronic control unit electric detection method and device, storage medium and electronic equipment
CN115827499A (en) * 2023-02-22 2023-03-21 江苏北弓智能科技有限公司 UI automation test method
CN117472785A (en) * 2023-12-25 2024-01-30 银河麒麟软件(长沙)有限公司 Openstack test method and system under Linux system

Cited By (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109062817A (en) * 2018-10-15 2018-12-21 网宿科技股份有限公司 Automated testing method and system
CN109634492A (en) * 2018-10-23 2019-04-16 中国平安人寿保险股份有限公司 Combobox designated value input method, device and computer readable storage medium
CN110109829B (en) * 2019-04-15 2022-12-09 福建天晴在线互动科技有限公司 Intelligent dialogue automatic checking method and storage medium
CN110109829A (en) * 2019-04-15 2019-08-09 福建天晴在线互动科技有限公司 Intelligent dialogue automates method of calibration, storage medium
CN111124245A (en) * 2019-12-24 2020-05-08 维沃移动通信有限公司 Control method and electronic equipment
CN112015638A (en) * 2020-07-30 2020-12-01 西安雷风电子科技有限公司 Automatic testing method and system
CN112306893A (en) * 2020-11-27 2021-02-02 平安普惠企业管理有限公司 UI page testing method and device, computer equipment and storage medium
CN112882931A (en) * 2021-02-06 2021-06-01 重庆富民银行股份有限公司 Automatic testing method and device based on DDT
CN112882931B (en) * 2021-02-06 2023-05-09 重庆富民银行股份有限公司 Automatic test method and device based on DDT
CN115657633A (en) * 2022-09-26 2023-01-31 北京罗克维尔斯科技有限公司 Electronic control unit electric detection method and device, storage medium and electronic equipment
CN115827499A (en) * 2023-02-22 2023-03-21 江苏北弓智能科技有限公司 UI automation test method
CN115827499B (en) * 2023-02-22 2023-04-25 江苏北弓智能科技有限公司 UI (user interface) automatic testing method
CN117472785A (en) * 2023-12-25 2024-01-30 银河麒麟软件(长沙)有限公司 Openstack test method and system under Linux system
CN117472785B (en) * 2023-12-25 2024-04-16 银河麒麟软件(长沙)有限公司 Openstack test method and system under Linux system

Similar Documents

Publication Publication Date Title
CN108536593A (en) CS Framework Softwares automated testing method based on UI and system
US10698702B1 (en) Automating interactions with software user interface
US10909028B1 (en) Multi-version regression tester for source code
US9189377B1 (en) Automation testing using descriptive maps
US8381184B2 (en) Dynamic test coverage
US8881109B1 (en) Runtime documentation of software testing
US20020133807A1 (en) Automation and isolation of software component testing
US10459830B2 (en) Executable code abnormality detection
CN107832207A (en) Interface performance test method, apparatus, storage medium and computer equipment
US20130086203A1 (en) Multi-level monitoring framework for cloud based service
US8904358B1 (en) Methods, systems, and articles of manufacture for synchronizing software verification flows
Misirli et al. Ai-based software defect predictors: Applications and benefits in a case study
CN108845940A (en) A kind of enterprise information system automated function test method and system
CN103399814B (en) The method and device of automatic test
US10509719B2 (en) Automatic regression identification
US11436133B2 (en) Comparable user interface object identifications
CN108446223A (en) A kind of business scenario automated testing method based on on-the-flier compiler
US10365995B2 (en) Composing future application tests including test action data
CN113590454A (en) Test method, test device, computer equipment and storage medium
CN107357721B (en) Method and device for testing system
CN106528429A (en) UI testing method and device
CN117370203B (en) Automatic test method, system, electronic equipment and storage medium
Saadatmand Towards automating integration testing of. NET applications using Roslyn
Mascheroni et al. Continuous Testing Improvement Model
CN111367796B (en) Application program debugging 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
RJ01 Rejection of invention patent application after publication

Application publication date: 20180914

RJ01 Rejection of invention patent application after publication