CN109308250A - A kind of GUI automated testing method and system - Google Patents

A kind of GUI automated testing method and system Download PDF

Info

Publication number
CN109308250A
CN109308250A CN201710618522.1A CN201710618522A CN109308250A CN 109308250 A CN109308250 A CN 109308250A CN 201710618522 A CN201710618522 A CN 201710618522A CN 109308250 A CN109308250 A CN 109308250A
Authority
CN
China
Prior art keywords
test
test case
picture
unit
automatic
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
CN201710618522.1A
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 FULHAN MICROELECTRONICS Co Ltd
Original Assignee
SHANGHAI FULHAN MICROELECTRONICS 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 FULHAN MICROELECTRONICS Co Ltd filed Critical SHANGHAI FULHAN MICROELECTRONICS Co Ltd
Priority to CN201710618522.1A priority Critical patent/CN109308250A/en
Publication of CN109308250A publication Critical patent/CN109308250A/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/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/362Software debugging
    • G06F11/366Software debugging using diagnostics

Landscapes

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

Abstract

The invention discloses a kind of GUI automated testing method and systems, and this method comprises the following steps: step 1, generate test case;Step 2 parses the automatic test relevant information of each test case to the test case of generation from test case table;Step 3, creation/update primary standard picture library;Step 4, automatic test is carried out according to step 1 and step 2, obtain test picture, and test picture is compared with standard drawing valut, test result is obtained, through the invention, the deployment and implementation of GUI automatic test need to can only be rapidly completed by way of editor/modification test case, it brings great convenience to the implementation of GUI automatic test, while having saved a large amount of cost.

Description

A kind of GUI automated testing method and system
Technical field
The present invention relates to a kind of GUI automated testing method and systems, are based on EXCEL test case more particularly to one kind GUI automated testing method and system.
Background technique
GUI (Graphical User Interface, graphic user interface) has become one of interactive software most For important component part, it is widely present in various application software and software tool.GUI is that user's operation is brought greatly It is convenient, but also gui software is more complicated, is more difficult to test.
Currently, the test based on GUI, substantially based on manual test, executing test according to Excel test case is most often The means seen.With the continuous development of software technology, software size is increasingly huge, software function is increasingly sophisticated, version iteration day Gradually frequently, manual test is because of its intrinsic limitation -- high cost, poor efficiency, it is difficult to ensure that the test quality of gui software.
For current GUI automated test tool mainly based on commercialization, basic use " records script → editor/enhancing foot The mode of sheet → playback script " automates to realize, this mode needs tester to be proficient in programming, it is also desirable to which one relatively unrestrained Long process automates to realize, in addition commercialized GUI automated test tool is generally all expensive, these are wanted to implement The enterprise of GUI automatic test brings great challenge on financial resources, human and material resources.
Summary of the invention
In order to overcome the deficiencies of the above existing technologies, purpose of the present invention is to provide a kind of automatic test sides GUI The deployment of GUI automatic test need to can be only rapidly completed in method and system by way of editor/modification Excel test case And implementation, it brings great convenience to the implementation of GUI automatic test, while having saved a large amount of cost.
In view of the above and other objects, the present invention proposes a kind of GUI automated testing method, include the following steps:
Step 1 generates test case;
Step 2 parses the test case of generation, and each test case is parsed from test case table Automatic test relevant information;
Step 3, creation/update primary standard picture library;
Step 4 carries out automatic test according to step 1 and step 2, obtains test picture, and will test picture and mark Quasi- picture library is compared, and obtains test result.
In step 1, EXCEL test case is generated, further comprising:
Step S11 uses Excel template editor's test case;
Step S12 carries out automated setting to determinant attribute content;
Step S13 automatically records the determinant attribute content of automated setting.
Further, step 2 includes:
Step S21 chooses corresponding Excel test case according to testing requirement automatically;
Step S22, the automatic number for reading each test case in Excel table, test case number are automations Unique identification in test process;
Step S23 judges whether test case carries out automatically according to the content of " whether the automating " of test case column Change and survey, if it has not, then reading next test case;If it has, then entering step S24;
Step S24 parses the corresponding automatic test key content of the test case according to test case number.
Further, step 3 includes:
Step S31 selects benchmark version;
Test case range is arranged in step S32;
Step S33 obtains test case number and corresponding testing procedure from step S22 with step S24 respectively;
The movement of step S34, the testing procedure simulation people obtained according to step S33 are held to complete the automatic of test case Row, mouse position indicate the mobile final position of mouse, and event indicates the actual act of mouse or keyboard;
Step S35, it is automatic to intercept current screen picture, it is numbered by test case and saves picture;
Step S36, the test picture for first saving step S35, backups to standard drawing valut, judges whether further according to condition Terminate, if judging result be do not terminate, continue to next test case carry out step S33 to step S35 operation, until time Gone through automatic test in need use-case.
Further, step 4 includes:
Step S41 selects version to be tested.
Step S42, automatic implementation of test cases, will need to carry out the gui interface of result verification in the form of picture as Picture B is tested to save;
Step S43 selects the identical picture of title therewith, as referring to the title of test picture B from standard drawing valut Normal pictures A;
Step S44 obtains origin abscissa, ordinate, length and the height of comparison domain from step S24;
Step S45 chooses from normal pictures A and test picture B compare respectively according to the rectangle size for comparing area's setting The content in region carries out comparison of coherence to the two using image recognition or character recognition technology, if comparison result be it is consistent, Then test passes through, and tests if inconsistent and does not pass through.
Step S46 records test result, while will test unacceptable picture and back up.
In order to achieve the above objectives, the present invention also provides a kind of GUI automatization test systems, comprising:
Test cases technology unit, for generating test case;
Test case resolution unit is parsed from test case table for parsing to the test case of generation The automatic test relevant information of each test case;
Standard drawing valut generation unit, for creating/updating primary standard picture library;
Automatic test unit obtains test picture, and will test picture and normal pictures for carrying out automatic test Library is compared, and obtains test result.
Further, which further comprises:
Test case edit cell, for using Excel template editor test case;
Automated setting unit, for carrying out automated setting to determinant attribute content;
Automated setting data acquisition unit, for automatically recording the determinant attribute content of automated setting.
Further, which further comprises:
Test case selection unit, for choosing corresponding Excel test case automatically according to testing requirement;
Test case number resolution unit, for reading the number of each test case in Excel table, test case Number is the unique identification in automatic test course;
Automatization judgement unit, the content for being arranged according to " whether the automating " of test case are to judge test case It is no to carry out automation survey, if it has not, then reading next test case;If it has, then starting testing procedure resolution unit;
Testing procedure resolution unit, for parsing the corresponding automatic test of the test case according to test case number Key content.
Further, which further comprises:
Benchmark version selecting unit, for selecting benchmark version;
Test case range setting unit, for test case range to be arranged;
Automated information acquiring unit obtains respectively from the test case number resolution unit with testing procedure resolution unit Test case number and corresponding testing procedure;
Automatic execution unit, the testing procedure obtained according to the automated information acquiring unit simulate the movement of people to complete The automatic execution of test case, mouse position indicate the mobile final position of mouse, and event indicates that the reality of mouse or keyboard is dynamic Make;
Picture storage unit is numbered by test case for intercepting current screen picture automatically and saves picture;
Standard drawing valut generation unit, the test picture for first saving the picture storage unit, backups to standard drawing Valut judges whether to terminate further according to condition, if judging result is not terminate, continues to automate next test case The operation of information acquisition unit, automatic execution unit and picture storage unit, the automatic test in need until having traversed Use-case.
Further, which further comprises:
Version selecting unit to be measured, for selecting version to be tested;
Picture generation unit is tested, automatic implementation of test cases is used for, the gui interface for carrying out result verification will be needed to scheme The form of piece is saved as test picture B, the number of the entitled test case of file;
Normal pictures selecting unit selects title phase therewith for the title referring to test picture B from standard drawing valut Same picture, as normal pictures A;
Comparison domain acquiring unit, for obtaining the origin abscissa of comparison domain from the testing procedure resolution unit, indulging Coordinate, length, height;
Photo-consistency comparing unit, the rectangle size for being set according to comparison domain, respectively from normal pictures A and survey Attempt to choose the content compared in area on piece B, comparison of coherence is carried out to the two using image recognition or character recognition technology, such as Fruit comparison result be it is consistent, then test pass through, test if inconsistent and do not pass through.
Test result processing unit for recording test result, while will test unacceptable picture and back up.
Compared with prior art, a kind of GUI automated testing method of the present invention and system are realized based on Excel test case The full automation test of GUI, using the present invention, can help enterprise to fast implement Product-level GUI automatic test, and Implement and maintenance cost is extremely low.Enterprise implements GUI automatic test without starting from scratch, and can survey completely in existing Excel Appropriate extension is done on the basis of example on probation can fast implement automatic test;Implement without the tester for being proficient in programming With maintenance GUI automatic test, tester only need to can reach GUI by way of editor/modification Excel test case Automatic test implements and maintenance.The present invention brings great convenience to the implementation of GUI automatic test, while saving to enterprise About a large amount of cost.
Detailed description of the invention
Fig. 1 is a kind of step flow chart of GUI automated testing method of the present invention;
Fig. 2 is the detailed flowchart of step 101 in the specific embodiment of the invention;
Fig. 3 is the detailed flowchart of step 102 in the specific embodiment of the invention;
Fig. 4 is the detailed flowchart of step 103 in the specific embodiment of the invention;
Fig. 5 is the detailed flowchart of step 104 in the specific embodiment of the invention;
Fig. 6 is a kind of system architecture diagram of GUI automatization test system of the present invention;
Fig. 7 is the detail structure chart of Test cases technology unit in the specific embodiment of the invention;
Fig. 8 is the detail structure chart of test case resolution unit in the specific embodiment of the invention;
Fig. 9 is the detail structure chart of specific embodiment of the invention Plays picture library generation unit;
Figure 10 is the detail structure chart of automatic test unit in the specific embodiment of the invention;
Figure 11 is the operating process schematic diagram of present invention specific implementation example.
Specific embodiment
Below by way of specific specific example and embodiments of the present invention are described with reference to the drawings, those skilled in the art can Understand further advantage and effect of the invention easily by content disclosed in the present specification.The present invention can also pass through other differences Specific example implemented or applied, details in this specification can also be based on different perspectives and applications, without departing substantially from Various modifications and change are carried out under spirit of the invention.
Fig. 1 is a kind of step flow chart of GUI automated testing method of the present invention.As shown in Figure 1, a kind of GUI of the present invention Automated testing method includes the following steps:
Step 101, test case is generated, in the specific embodiment of the invention, generates EXCEL test case.
Specifically, for Excel test case of the invention have relatively-stationary format (it is expansible, can also be existing in enterprise Some Excel test cases are modified on basis), specifically, as shown in Fig. 2, step 101 further comprises:
Step S11 uses Excel template editor's test case.
Here test case and common excel manual test use-case are almost the same, specifically include that test case is compiled Number, test case title, prerequisite, testing procedure, it is contemplated that as a result, actual result, test result etc., wherein " test case Number " and " test result " item are essential.Automatic test of the present invention is all based on the volume of each test case It number carries out, therefore the number of test case must be unique, preferably compile according to the functional structure of test product and test point Write the number of test case;" test result " is used to record the result after the use-case executes.
Step S12 carries out automated setting to determinant attribute content.
Here automated setting content mainly includes whether that automatic test judges, mouse coordinates position, event (key The operation of disk/mouse), comparison domain.Specifically,
Mouse coordinates position: abscissa, the ordinate of the mobile target position of mouse;
Event: the operation of keyboard/mouse, such as the input of single left button mouse click, keypad character;
Comparison domain: a rectangle records the origin abscissa, starting point ordinate, length, height of the rectangle.For marking Note needs to carry out the region of result comparison.
Step S13 automatically records the determinant attribute content of automated setting.Such as mouse moving target position, mouse/keyboard Operation and comparison domain setting (draw rectangle).If input correct test case number before operation, this step can will Collected data fill out the corresponding position of Excel table automatically;
Step 102, test case is parsed, the automation of each test case is parsed from test case table Test relevant information.Specifically, by taking Excel test case as an example, as shown in figure 3, step 102 further comprises:
Step S21 chooses corresponding Excel test case, in the specific embodiment of the invention according to testing requirement automatically In, choose corresponding Excel test case automatically using script.
Step S22, the automatic number for reading each test case in Excel table, test case number are automations Unique identification in test process;In the specific embodiment of the invention, reads each in Excel table automatically using script and survey The number of example on probation
Step S23 judges whether test case carries out automatically according to the content of " whether the automating " of test case column Change and survey, if "No", then reads next test case;If "Yes", then S24 is entered step;
Step S24 parses the corresponding automatic test key content of the test case: " mouse according to test case number Cursor position ", " event ", " comparison domain ".
Step 103, creation/update primary standard picture library.
Standard drawing valut is the foundation for carrying out the judgement of automatic test result.Standard drawing valut is institute's test result in need The intersection of the picture of judgement.Specifically, as shown in figure 4, step 103 further comprises:
Step S31 selects benchmark version.Standard drawing valut is built upon on benchmark version, benchmark version be usually from It is mature that GUI design is chosen in baseline version, the metastable version of function;
Test case range is arranged in step S32.The range setting of test case determines the purposes of final picture library. Under normal conditions, generally test case range is set as all, the picture library ultimately generated can be used as standard drawing valut;Such as Fruit standard drawing valut need to only update part figure piece, then set test case range as the part for needing to update, standard can be completed The update of picture library;
Step S33 obtains test case number and corresponding testing procedure from step S22 with step S24 respectively, and test is used Example number is the unique identification of automatic test.
The movement of step S34, the testing procedure simulation people obtained according to step S33 are held to complete the automatic of test case Row, mouse position indicate the mobile final position of mouse, and event (keyboard/mouse operation) indicates that the reality of mouse or keyboard is dynamic Make.General operation order is first to move mouse to carry out keyboard/mouse operation again.
Step S35, it is automatic to intercept current screen picture (be cut out according to the size of setting), it is numbered by test case Save picture, can also this step screenshotss save picture be referred to as test picture.
Step S36, the test picture for first saving step S35, backups to standard drawing valut, judges whether further according to condition Terminate, if judging result be do not terminate, continue to next test case carry out step S33 to step S35 operation, until time Gone through automatic test in need use-case, so far, primary standard picture library generate complete.
Step 104, automatic test is carried out according to step 101 and step 102, obtains test picture, and picture will be tested It is compared with standard drawing valut, obtains test result.
Specifically, as shown in figure 5, step 104 further comprises:
Step S41 selects version to be tested.
Step S42, automatic implementation of test cases save the gui interface for needing to carry out result verification in the form of picture (test picture B), the number of the entitled test case of file.This step operates in detail can refer to step S33- step S35.
Step S43 selects the identical picture of title therewith, as referring to the title of test picture B from standard drawing valut Normal pictures A;
Step S44 obtains origin abscissa, the ordinate of comparison domain, length, height from step S24;
Step S45 chooses from normal pictures A and test picture B respectively according to the rectangle size that " comparison domain " is set Content in " comparison domain " carries out comparison of coherence to the two using image recognition or character recognition technology, if comparing knot Fruit be it is consistent, then test pass through, test if inconsistent and do not pass through.
Step S46 records test result, while will test unacceptable picture and back up.
Fig. 6 is a kind of system architecture diagram of GUI automatization test system of the present invention.As shown in fig. 6, a kind of GUI of the present invention Automatization test system, comprising: Test cases technology unit 50, test case resolution unit 51, standard drawing valut generation unit 52 and automatic test unit 53.
Wherein, Test cases technology unit 50, for generating test case, in the specific embodiment of the invention, test is used Example generation unit 50 generates Excel test case.
Specifically, for Excel test case of the invention have relatively-stationary format (it is expansible, can also be existing in enterprise Some Excel test cases are modified on basis), specifically, as shown in fig. 7, by taking Excel test case as an example, the test case Generation unit 50 further comprises:
Test case edit cell 501, for using Excel template editor test case.
Here test case and common excel manual test use-case are almost the same, specifically include that test case is compiled Number, test case title, prerequisite, testing procedure, it is contemplated that as a result, actual result, test result etc., wherein " test case Number " and " test result " item are essential.Automatic test of the present invention is all based on the volume of each test case It number carries out, therefore the number of test case must be unique, preferably compile according to the functional structure of test product and test point Write the number of test case;" test result " is used to record the result after the use-case executes.
Automated setting unit 502, for carrying out automated setting to determinant attribute content.
Here automated setting content mainly includes whether that automatic test judges, mouse coordinates position, event (key The operation of disk/mouse), comparison domain.Specifically,
Mouse coordinates position: abscissa, the ordinate of the mobile target position of mouse;
Event: the operation of keyboard/mouse, such as the input of single left button mouse click, keypad character;
Comparison domain: a rectangle records the origin abscissa, starting point ordinate, length, height of the rectangle.For marking Note needs to carry out the region of result comparison.
Automated setting data acquisition unit 503, for automatically recording the determinant attribute content of automated setting.Such as mouse Moving target position, the operation of mouse/keyboard and the setting of comparison domain (drawing rectangle).If input is correct before operation Test case number, it is corresponding that collected data can be filled out automatically Excel table by automated setting data acquisition unit 503 Position;
Test case resolution unit 51 parses each for parsing to test case from test case table The automatic test relevant information of test case.Specifically, by taking Excel test case as an example, as shown in figure 8, test case solution Analysis unit 51 further comprises:
Test case selection unit 511, for choosing corresponding Excel test case automatically according to testing requirement, at this In invention specific embodiment, test case selection unit 511 chooses corresponding Excel test case using script automatically.
Test case number resolution unit 512 is tested for reading the number of each test case in Excel table Use-case number is the unique identification in automatic test course;In the specific embodiment of the invention, test case number parsing is single Member 512 reads the number of each test case in Excel table using script automatically
Automatization judgement unit 513, the content for being arranged according to " whether the automating " of test case are used to judge to test Whether example carries out automation survey, if "No", then reads next test case;If "Yes", then start testing procedure parsing Unit 514;
Testing procedure resolution unit 514, for parsing the corresponding automation of the test case according to test case number Test key content: " mouse position ", " event ", " comparison domain ".
Standard drawing valut generation unit 52, for creating/updating primary standard picture library.
Standard drawing valut is the foundation for carrying out the judgement of automatic test result.Standard drawing valut is institute's test result in need The intersection of the picture of judgement.Specifically, as shown in figure 9, standard drawing valut generation unit 52 further comprises:
Benchmark version selecting unit 521, for selecting benchmark version.Standard drawing valut is built upon on benchmark version, Benchmark version is usually that GUI design maturation, the metastable version of function are chosen from baseline version;
Test case range setting unit 522, for test case range to be arranged.The range setting of test case determines The purposes of final picture library.Under normal conditions, generally test case range is set as all, the picture library ultimately generated is i.e. It can be used as standard drawing valut;If standard drawing valut need to only update part figure piece, test case range is set to need to update Part, the update of standard drawing valut can be completed;
Automated information acquiring unit 523, from test case number resolution unit 512 and testing procedure resolution unit 514 Test case number and corresponding testing procedure are obtained respectively, and test case number is the unique identification of automatic test.
The movement of automatic execution unit 524, the testing procedure simulation people obtained according to automated information acquiring unit 523 comes The automatic execution of test case is completed, mouse position indicates the mobile final position of mouse, and event (keyboard/mouse operation) indicates The actual act of mouse or keyboard.General operation order is first to move mouse to carry out keyboard/mouse operation again.
Picture storage unit 525 is pressed for intercepting current screen picture (can be cut out according to the size of setting) automatically Test case number save picture, can also the screenshotss save picture be referred to as test picture.
Standard drawing valut generation unit 526, the test picture for first saving picture storage unit 525, backups to mark Quasi- picture library judges whether to terminate further according to condition, if judging result is not terminate, continues to carry out certainly next test case The operation of dynamicization information acquisition unit 523, automatic execution unit 524 and picture storage unit 525, until having traversed all need The use-case of automatic test is wanted, so far, primary standard picture library, which generates, to be completed.
Automatic test unit 53 obtains test picture, and will test picture and standard drawing for carrying out automatic test Valut is compared, and obtains test result.
Specifically, as shown in Figure 10, automatic test unit 53 further comprises:
Version selecting unit 531 to be measured, for selecting version to be tested.
Picture generation unit 532 is tested, automatic implementation of test cases is used for, will need to carry out the gui interface of result verification (test picture B), the number of the entitled test case of file are saved in the form of picture.Operation can refer to automated information and obtain in detail Take unit 523, automatic execution unit 524 and picture storage unit 525.
Normal pictures selecting unit 533 selects name therewith for the title referring to test picture B from standard drawing valut Claim identical picture, as normal pictures A;
Comparison domain acquiring unit 534, for obtaining the horizontal seat of origin of comparison domain from testing procedure resolution unit 514 Mark, ordinate, length, height;
Photo-consistency comparing unit 535, the rectangle size for being set according to " comparison domain ", respectively from normal pictures The content in " comparison domain " is chosen on A and test picture B, the two is carried out using image recognition or character recognition technology consistent Property compare, if comparison result be it is consistent, test pass through, test if inconsistent and do not pass through.
Test result processing unit 536 for recording test result, while will test unacceptable picture and back up.
Figure 11 provides the operating process of present invention specific implementation example.It is specific as follows:
Excel test case editor, Excel test case are bases of the invention, can be used in existing manual test Excel test case basis on modify.The Excel test case format that the present invention uses is more than common test case table Content of a part about " automated setting " out, for recording mouse shift position, mouse/keyboard operation, comparison domain etc. Information.
Tested program version is selected, selects the version of tested program according to demand, carries out automatic test using the present invention The test result of generation, reaction is the software quality for selecting beta version.
The parsing of Excel test case, script automatically parse Excel test case, extract key message: the volume of test case Number, mouse position that testing procedure is related to, keyboard/mouse operation, the comparison domain for result verification;
Automatic test is carried out, is parsed from previous step Excel test case and obtains automatic test relevant information, automatically Test is completed in the movement for simulating people, is carried out screenshot to the gui interface for needing to carry out result confirmation and is carried out with normal pictures consistent Property compares, and records test result;
As a result it saves, the test result of previous step automatic test is saved in Excel test case corresponding position, and Unacceptable picture will be tested to back up.
In conclusion a kind of GUI automated testing method of the present invention and system, which are based on Excel test case, realizes GUI Full automation test enterprise can be helped to fast implement Product-level GUI automatic test, and implement using the present invention It is extremely low with maintenance cost.Enterprise implements GUI automatic test without starting from scratch, and can test use in existing Excel completely Appropriate extension is done on the basis of example can fast implement automatic test;Implement without the tester for being proficient in programming and ties up GUI automatic test is protected, it is automatic that tester only need to can reach GUI by way of editor/modification Excel test case Change test implementation and maintenance.The present invention brings great convenience to the implementation of GUI automatic test, while saving to enterprise A large amount of cost.
The above-described embodiments merely illustrate the principles and effects of the present invention, and is not intended to limit the present invention.Any Without departing from the spirit and scope of the present invention, modifications and changes are made to the above embodiments by field technical staff.Therefore, The scope of the present invention, should be as listed in the claims.

Claims (10)

1. a kind of GUI automated testing method, includes the following steps:
Step 1 generates test case;
Step 2 parses the automatic test phase of each test case to the test case of generation from test case table Close information;
Step 3, creation/update primary standard picture library;
Step 4 carries out automatic test according to step 1 and step 2, obtains test picture, and will test picture and standard drawing Valut is compared, and obtains test result.
2. a kind of GUI automated testing method as described in claim 1, which is characterized in that in step 1, generate EXCEL Test case, further comprising:
Step S11 uses Excel template editor's test case;
Step S12 carries out automated setting to determinant attribute content;
Step S13 automatically records the determinant attribute content of automated setting.
3. a kind of GUI automated testing method as claimed in claim 2, which is characterized in that step 2 further comprises:
Step S21 chooses corresponding Excel test case according to testing requirement automatically;
Step S22, the automatic number for reading each test case in Excel table, test case number is automatic test Unique identification in the process;
Step S23 judges whether test case carries out automation survey according to the content of " whether the automating " of test case column, If it has not, then reading next test case;If it has, then entering step S24;
Step S24 parses the corresponding automatic test key content of the test case according to test case number.
4. a kind of GUI automated testing method as claimed in claim 3, which is characterized in that step 3 further comprises:
Step S31 selects benchmark version;
Test case range is arranged in step S32;
Step S33 obtains test case number and corresponding testing procedure from step S22 with step S24 respectively;
Step S34, the testing procedure simulation people's obtained according to step S33 acts to complete the automatic execution of test case, mouse Cursor position indicates the mobile final position of mouse, and event indicates the actual act of mouse or keyboard;
Step S35, it is automatic to intercept current screen picture, it is numbered by test case and saves picture;
Step S36, the test picture for first saving step S35, backups to standard drawing valut, judges whether to tie further according to condition Beam continues the operation that step S33 to step S35 is carried out to next test case, until traversal if judging result is not terminate The use-case of complete automatic test in need.
5. a kind of GUI automated testing method as claimed in claim 4, which is characterized in that step 4 further comprises:
Step S41 selects version to be tested.
Step S42, automatic implementation of test cases will need to carry out the gui interface of result verification in the form of picture as test Picture B is saved;
Step S43 selects the identical picture of title, as standard therewith referring to the title of test picture B from standard drawing valut Picture A;
Step S44 obtains origin abscissa, ordinate, length and the height of comparison domain from step S24;
Step S45 chooses comparison domain from normal pictures A and test picture B respectively according to the rectangle size for comparing area's setting Content, comparison of coherence is carried out to the two using image recognition or character recognition technology, if comparison result be it is consistent, survey It pinged, and tested if inconsistent and do not pass through.
Step S46 records test result, while will test unacceptable picture and back up.
6. a kind of GUI automatization test system, comprising:
Test cases technology unit, for generating test case;
Test case resolution unit parses each for parsing to the test case of generation from test case table The automatic test relevant information of test case;
Standard drawing valut generation unit, for creating/updating primary standard picture library;
Automatic test unit obtains test picture for carrying out automatic test, and will test picture and standard drawing valut into Row compares, and obtains test result.
7. a kind of GUI automatization test system as claimed in claim 6, it is characterised in that: the Test cases technology unit into One step includes:
Test case edit cell, for using Excel template editor test case;
Automated setting unit, for carrying out automated setting to determinant attribute content;
Automated setting data acquisition unit, for automatically recording the determinant attribute content of automated setting.
8. a kind of GUI automatization test system as claimed in claim 7, it is characterised in that: the test case resolution unit into One step includes:
Test case selection unit, for choosing corresponding Excel test case automatically according to testing requirement;
Test case number resolution unit, for reading the number of each test case in Excel table, test case number It is the unique identification in automatic test course;
Automatization judgement unit, content for being arranged according to " whether the automating " of test case judge test case whether into Row automation is surveyed, if it has not, then reading next test case;If it has, then starting testing procedure resolution unit;
Testing procedure resolution unit, it is crucial for parsing the corresponding automatic test of the test case according to test case number Content.
9. a kind of GUI automatization test system as claimed in claim 8, it is characterised in that: the standard drawing valut generation unit Further comprise:
Benchmark version selecting unit, for selecting benchmark version;
Test case range setting unit, for test case range to be arranged;
Automated information acquiring unit obtains test from the test case number resolution unit and testing procedure resolution unit respectively Use-case number and corresponding testing procedure;
Automatic execution unit, the testing procedure obtained according to the automated information acquiring unit simulate the movement of people to complete to test The automatic execution of use-case, mouse position indicate the mobile final position of mouse, and event indicates the actual act of mouse or keyboard;
Picture storage unit is numbered by test case for intercepting current screen picture automatically and saves picture;
Standard drawing valut generation unit, the test picture for first saving the picture storage unit, backups to standard drawing valut, Judge whether to terminate further according to condition, if judging result is not terminate, continues to carry out automated information to next test case The operation of acquiring unit, automatic execution unit and picture storage unit, the use of automatic test in need until having traversed Example.
10. a kind of GUI automatization test system as claimed in claim 9, it is characterised in that: the automatic test unit is into one Step includes:
Version selecting unit to be measured, for selecting version to be tested;
Picture generation unit is tested, automatic implementation of test cases is used for, the gui interface for carrying out result verification will be needed with picture Form is saved as test picture B, the number of the entitled test case of file;
Normal pictures selecting unit, for referring to test picture B title, selected from standard drawing valut therewith title it is identical Picture, as normal pictures A;
Comparison domain acquiring unit, for obtaining origin abscissa, the ordinate of comparison domain from the testing procedure resolution unit, Length, height;
Photo-consistency comparing unit, the rectangle size for being set according to comparison domain, respectively from normal pictures A and test chart The content compared in area is chosen on piece B, and comparison of coherence is carried out to the two using image recognition or character recognition technology, if than Relatively result be it is consistent, then test pass through, test if inconsistent and do not pass through.
Test result processing unit for recording test result, while will test unacceptable picture and back up.
CN201710618522.1A 2017-07-26 2017-07-26 A kind of GUI automated testing method and system Pending CN109308250A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710618522.1A CN109308250A (en) 2017-07-26 2017-07-26 A kind of GUI automated testing method and system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710618522.1A CN109308250A (en) 2017-07-26 2017-07-26 A kind of GUI automated testing method and system

Publications (1)

Publication Number Publication Date
CN109308250A true CN109308250A (en) 2019-02-05

Family

ID=65202832

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710618522.1A Pending CN109308250A (en) 2017-07-26 2017-07-26 A kind of GUI automated testing method and system

Country Status (1)

Country Link
CN (1) CN109308250A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096444A (en) * 2019-05-06 2019-08-06 重庆天蓬网络有限公司 A kind of management system, application method and equipment generating test case based on excel
CN111340038A (en) * 2020-05-20 2020-06-26 四川新网银行股份有限公司 Disposable image data acquisition method for MOCK test
CN112597021A (en) * 2020-12-24 2021-04-02 中国农业银行股份有限公司 Bank counter transaction automatic testing method and device based on linkage printer
CN113032243A (en) * 2021-01-28 2021-06-25 上海计算机软件技术开发中心 Intelligent testing method and system for GUI (graphical user interface) of mobile application program
CN113849399A (en) * 2021-09-13 2021-12-28 北京计算机技术及应用研究所 Automatic testing system and method for multi-machine cooperative software under multi-localization platform

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101996131A (en) * 2009-08-19 2011-03-30 航天信息股份有限公司 Automatic test method and automatic test platform for graphic user interface (GUI) based on x extensive makeup language (XML) packaging key word
CN102156673A (en) * 2011-04-20 2011-08-17 北京航空航天大学 Test case description oriented GUI (Graphical User Interface) automatic test system and test method thereof
CN103268226A (en) * 2013-05-17 2013-08-28 瑞斯康达科技发展股份有限公司 Test script file generation method and device
CN105718353A (en) * 2016-01-18 2016-06-29 深圳市同创国芯电子有限公司 Testing method, apparatus and system for graphic interface application
CN105988924A (en) * 2015-02-10 2016-10-05 中国船舶工业综合技术经济研究院 Automatic testing method for non-intrusive type embedded software graphical user interface
CN106445819A (en) * 2016-09-20 2017-02-22 湖南明康中锦医疗科技发展有限公司 GUI (graphical user interface) intelligent test method and test system for ventilator

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101996131A (en) * 2009-08-19 2011-03-30 航天信息股份有限公司 Automatic test method and automatic test platform for graphic user interface (GUI) based on x extensive makeup language (XML) packaging key word
CN102156673A (en) * 2011-04-20 2011-08-17 北京航空航天大学 Test case description oriented GUI (Graphical User Interface) automatic test system and test method thereof
CN103268226A (en) * 2013-05-17 2013-08-28 瑞斯康达科技发展股份有限公司 Test script file generation method and device
CN105988924A (en) * 2015-02-10 2016-10-05 中国船舶工业综合技术经济研究院 Automatic testing method for non-intrusive type embedded software graphical user interface
CN105718353A (en) * 2016-01-18 2016-06-29 深圳市同创国芯电子有限公司 Testing method, apparatus and system for graphic interface application
CN106445819A (en) * 2016-09-20 2017-02-22 湖南明康中锦医疗科技发展有限公司 GUI (graphical user interface) intelligent test method and test system for ventilator

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110096444A (en) * 2019-05-06 2019-08-06 重庆天蓬网络有限公司 A kind of management system, application method and equipment generating test case based on excel
CN111340038A (en) * 2020-05-20 2020-06-26 四川新网银行股份有限公司 Disposable image data acquisition method for MOCK test
CN111340038B (en) * 2020-05-20 2020-08-21 四川新网银行股份有限公司 Disposable image data acquisition method for MOCK test
CN112597021A (en) * 2020-12-24 2021-04-02 中国农业银行股份有限公司 Bank counter transaction automatic testing method and device based on linkage printer
CN113032243A (en) * 2021-01-28 2021-06-25 上海计算机软件技术开发中心 Intelligent testing method and system for GUI (graphical user interface) of mobile application program
CN113032243B (en) * 2021-01-28 2021-12-17 上海计算机软件技术开发中心 Intelligent testing method and system for GUI (graphical user interface) of mobile application program
CN113849399A (en) * 2021-09-13 2021-12-28 北京计算机技术及应用研究所 Automatic testing system and method for multi-machine cooperative software under multi-localization platform

Similar Documents

Publication Publication Date Title
CN109308250A (en) A kind of GUI automated testing method and system
US9424167B2 (en) Automated testing of an application system
US9459994B2 (en) Mobile application testing systems and methods
WO2019144680A1 (en) Automatic testing method and apparatus, storage medium and electronic device
CN104461894B (en) The operation record device and method of Android software
CN105264474B (en) The NI Vision Builder for Automated Inspection program editing environment with paste feature is replicated including operation context-aware
CN111818123B (en) Network front-end remote playback method, device, equipment and storage medium
US10114733B1 (en) System and method for automated testing of user interface software for visual responsiveness
CN108399130A (en) Method, device and equipment for automatically generating test case and readable storage medium
JPS62212837A (en) Interactive software tester
CN101996131A (en) Automatic test method and automatic test platform for graphic user interface (GUI) based on x extensive makeup language (XML) packaging key word
Moran et al. On-device bug reporting for android applications
Huang et al. Towards a documentation maturity model
Hesenius et al. Automating UI tests for mobile applications with formal gesture descriptions
Stocco et al. PESTO: A tool for migrating DOM-based to visual web tests
CN113448845A (en) UI automation test method and system
CN114896173A (en) Data processing system for target data path display
CN109933770A (en) A kind of test report generation method, system and electronic equipment and storage medium
CN108287786A (en) A kind of automated testing method and device and hybrid navigation system based on map
CN106970870B (en) Webpage test platform, webpage test method and webpage test system
CN114897296A (en) RPA flow labeling method, execution process playback method and storage medium
Ahrens Towards automatic capturing of traceability links by combining eye tracking and interaction data
CN114416516A (en) Test case and test script generation method, system and medium based on screenshot
US11106571B2 (en) Identification of input object in a graphical user interface
Rungta et al. ManyVis: Multiple applications in an integrated visualization environment

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20190205