CN105868104B - A kind of cross-platform graphic user interface automatic test approach - Google Patents
A kind of cross-platform graphic user interface automatic test approach Download PDFInfo
- Publication number
- CN105868104B CN105868104B CN201610173320.6A CN201610173320A CN105868104B CN 105868104 B CN105868104 B CN 105868104B CN 201610173320 A CN201610173320 A CN 201610173320A CN 105868104 B CN105868104 B CN 105868104B
- Authority
- CN
- China
- Prior art keywords
- interface
- test
- program
- rpc
- code
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
Abstract
The present invention relates to a kind of cross-platform graphic user interface automatic test approach, it is realized using cross-platform RPC, without specially developing Test driver for particular platform, save the workload of test driver exploitation, and the test case convenient for writing multiple program joint operations for distributed system.Furthermore, it is possible to all application programs to entire distributed system carry out joint test.Driver obtains the output content of the interface assembly of each application program by RPC interfaces, accurately decision result whether can meet expection.The situation of various interface operations can be simulated due to test driver and accurately judge the executive condition of test case, therefore the automation of unit testing, integration testing or even system testing can be realized, improve testing efficiency and accuracy, labor workload is reduced, greatly improves the reliability of graphical interface program.
Description
Technical field
The present invention relates to a kind of test methods of shape user interface, and in particular to a kind of cross-platform graphic user interface is certainly
Dynamic test method.
Background technology
The exploitation and test of graphic user interface are parts the most complicated in software development process, because being used for figure
The operation at family interface is free, therefore on slightly more complex graphic user interface, and the combination of operation order is just very numerous
It is more.And in testing, graphical interfaces can not often be tested automatically, and it is limited to workload and operating habit, manual testing
When institute covered operation logic it is often considerably less so that by the software of test after distribution, the random operation of user is just
Lead to program crashing, seriously affect user experience.
The scheme that graphical user interface program is tested automatically, realization method can substantially be had by having some at present
It is following two:
1st, the interface function that call operation system provides in external test driver or script obtains interface control position
The mode for putting and simulating mouse-keyboard operation is realized.Although this method can realize the purpose tested automatically, have following
It is insufficient:
1) API of heavy dependence particular platform needs supported for the test that needs cross-platform application program
A set of automatic test machine system is all implemented separately on platform, workload is huge.
2) operating result can not accurately be judged.Sometimes graphic user interface output is more complicated, especially for painting certainly
Control, external program be difficult to accurately obtain output content, influence test accuracy.
2nd, increase test code or script inside application program.Since calling correlation can be passed through inside application program
Interface function easily get the information of software interface element, and can be by directly invoking the side of event handling function
Formula simulates external event, thus can accurately judge whether the content of interface output is correct.Further, since it does not need to pass through behaviour
Make the specific interface of system to obtain interface information, but interface unified in application can be called to realize, be thus convenient for
Realize cross-platform test case.The test code or script that this mode is disadvantageous in that in distinct program are only mutually
Vertical, for distributed system, it is not easy to write the test case of centralized Control test process.
Invention content
In view of the above-mentioned problems, the present invention provides a kind of work that can save test driver exploitation realized using RPC
Work amount can greatly improve the cross-platform graphic user interface automatic test approach of graphical interface program reliability again.
The technological means that the present invention uses is mainly the graphical user using RPC modes to software in test driver
Interface is operated.The full name of RPC is " remote procedure call " (Remote Procedure Call Protocol), is exactly logical
Method of the network call remotely-or locally on computer is crossed, just as calling local method similar, without being concerned about bottom-layer network
The details of communication protocol.
To solve the above problems, the technical solution that the present invention takes is:A kind of cross-platform graphic user interface is surveyed automatically
Method for testing includes the following steps:
Step 1: the interface for operating graphical user-interface element is registered as into RPC service interface in the application;
First, added in each application program one for being operated to the graphical user-interface element of this program and
The interface control module of content obtaining;
Then, the form that RPC service will be passed through for the interface of the operation graphical user-interface element of interface control module
External program is supplied to use;
Step 2: graphic user interface is grasped using the mode of calling RPC service interface in test driver
Make
A RPC client is initialized in test driver, is connected to the RPC clothes that tested application program provides
Business device;The load test use-case code in test driver is given birth in test case code by tested application program
Into RPC client-side interface codes in graphical user-interface element figure circle of application program that is tested of interface operation
Face, the event of analog manual operation and acquisition interface display simultaneously verify whether to meet the requirements, and test result is output to boundary
Face is recorded in test log.
The loading of test case code, the startup of test driver stop being controlled by test process control module.Step
Graphical user-interface element described in one includes window, menu, button, text box, list box, table for example, analog buttons
It presses, the event of menu selection, obtains text box content etc..The interface letter that interface control module passes through the local interface assembly of calling
It is several that interface is operated.
The interface of interface control module operation interface element is supplied to external journey by the form of RPC service in step 1
Sequence uses and (supplies RPC client calls).For different RPC frames, interface is not registered to the mode of RPC service also not
Together.
By taking CORBA agreements as an example, following steps are needed:
1.1 write idl file (Interface Discription Langua ge:Interface description language), it is right wherein
Need disclosed interface that the form for being similar to the statement of C++ class type is used to be described;
1.2 compile the skeleton generation of the corresponding serve end program of idl file generation by the command-line tool of an entitled idl
The code of generation is simultaneously added in application program by code (Skeleton);
1.3 write interface disclosed in code realization, wherein can be with the interface function of calling interface control module;
1.4 call the interface function in CORBA libraries to start service.
By above-mentioned steps 1.1 to step 1.4, tested application program is used by graphical user interface object and to figure
The function of family interface operation is exposed to RPC service.
A RPC client is initialized in step 2 in test driver.Equally, for different RPC frames,
The initialization mode of RPC clients is also different.By taking CORBA agreements as an example, following steps are needed:
2.1 by the idl file of tested application program, and idl command-line tools compiling idl file is used to generate corresponding visitor
Family end program stake code (Stub);
2.2 are added to the stake code of generation in test driver;
If 2.3 tested program more than one, need the mistake to each tested routine executing step 2.1 and 2.1
Journey;
2.4 add in test case code in test driver, can pass through preceding step in test case code
It the interface of interface operation tested program, the event of analog manual operation in the stake code of generation and obtains interface display and tests
Whether card meets the requirements, and test result is output to interface or is recorded in test log.
Graphic user interface is operated by RPC by step 2.1 to step 2.4 test driver, is simulated artificial
Test process, and the content exported on graphical user interface object is obtained and judged, so as to fulfill automatic test.This hair
It is bright by being implanted into an interface control module in tested application program, pass through the interface function of calling interface component internal
Carry out simulated operation and obtain content;Then the interface function that interface control module provides is supplied to external tune by RPC service
With, it can be understood as add a back door, by way of acting from inside in coordination with forces attacking from outside, operated to program to application.
Currently a popular RPC agreements have cross-platform realization of increasing income, therefore can including XML-RPC, RMI, CORBA etc.
Very easily to realize details of the cross-platform autorun without considering specific Cross-border congestion management.In addition, to other
The function that program is controlled can be realized in same test driver, so as to all applications to whole system
The test that program is concentrated.
The present invention is realized using cross-platform RPC, is specially developed Test driver without being directed to particular platform, is saved test and drive
The workload of dynamic program exploitation.Furthermore, it is possible to all application programs to entire distributed system carry out joint test.For example,
When testing JXC System, one new cargo of addition in Inventory Management Software can be simulated, is then followed by marketing system
It retrieves the information of the product and whether consistent compares.Driver obtains the interface assembly of each application program by RPC interfaces
Output content, accurately decision result whether can meet expection.Since test driver can simulate various interfaces
The situation of operation and the executive condition for accurately judging test case, therefore can realize unit testing, integration testing or even system testing
Automation improves testing efficiency and accuracy, reduces labor workload, greatly improves the reliability of graphical interface program.
The present invention realizes that cross-platform graphic user interface is tested, while be not necessarily and the test of multiple platforms is supported to increase automatically
Add additional development amount, and the test case convenient for writing multiple program joint operations for distributed system.
Description of the drawings
Fig. 1 is the principle of the present invention schematic diagram.
Specific embodiment
As shown in Figure 1, include two application programs of A and B, the graphical user of application program A in distributed application system
Window, menu and button interfaces element are included in interface;Window, menu and list box interface element are included in application program B.Two
A application program may be operated on same or different computer.A kind of cross-platform graphic user interface side of test automatically
Method includes the following steps:
Step 1: the interface for operating graphical user-interface element is registered as into RPC service interface in the application;
First, added in each application program one for being operated to the graphical user-interface element of this program and
The interface control module of content obtaining,
Then, the form that RPC service will be passed through for the interface of the operation graphical user-interface element of interface control module
External program is supplied to use and (supply RPC client calls), which is mainly realized by following steps:
1.1 write idl file (Interface Discription Langua ge:Interface description language), it is right wherein
Need disclosed interface that the form for being similar to the statement of C++ class type is used to be described;
1.2 compile the skeleton generation of the corresponding serve end program of idl file generation by the command-line tool of an entitled idl
The code of generation is simultaneously added in application program by code (Skeleton);
1.3 write interface disclosed in code realization, wherein can be with the interface function of calling interface control module;
1.4 call the interface function in CORBA libraries to start service.
Step 2: graphic user interface is grasped using the mode of calling RPC service interface in test driver
Make,
A RPC client is initialized in test driver, is connected to the RPC clothes that tested application program provides
Business device;The load test use-case code in test driver is given birth in test case code by tested application program
Into RPC client-side interface codes in graphical user-interface element figure circle of application program that is tested of interface operation
Face, the event of analog manual operation and acquisition interface display simultaneously verify whether to meet the requirements, and test result is output to boundary
Face is recorded in test log.The loading of test case code, the startup of test driver stop being controlled by testing
Process control module.
By taking CORBA agreements as an example, specific steps:
2.1 by the idl file of tested application program, and idl command-line tools compiling idl file is used to generate corresponding visitor
Family end program stake code (Stub);
2.2 are added to the stake code of generation in test driver;
If 2.3 tested program more than one, need the mistake to each tested routine executing step 2.1 and 2.1
Journey.
2.4 add in test case code in test driver, can pass through preceding step in test case code
It the interface of interface operation tested program, the event of analog manual operation in the stake code of generation and obtains interface display and tests
Whether card meets the requirements, and test result is output to interface or is recorded in test log.
Claims (2)
1. a kind of cross-platform graphic user interface automatic test approach, it is characterised in that include the following steps:
Step 1: the interface for operating graphical user-interface element is registered as into RPC service interface in the application;
First, one is added in each application program for being operated to the graphical user-interface element of this program and content
The interface control module of acquisition;
Then, the interface of the operation graphical user-interface element for interface control module is provided by the form of RPC service
It is used to external program, specific implementation step is as follows:
1.1 write interface description file, and the form of interface description file is different according to used RPC frames, are described in interface
The interface that external program uses is provided to described in file;The function of these interfaces includes the acquisition and control to interface element
System;
1.2 generate the bone of corresponding serve end program using the Code Generator that RPC frames provide according to interface description file
Frame code and stake code, skeletal code is added in tested application program;
1.3 write interface disclosed in code realization, and the function in the interface of realization in calling interface control module is completed to boundary
The acquisition and control of surface element;
The interface of realization is registered in RPC service device and starts to provide service by 1.4;
Step 2: graphic user interface is operated using the mode of calling RPC service interface in test driver;
A RPC client is initialized in test driver, is connected to the RPC service that tested application program provides
Device;The load test use-case code in test driver is generated in test case code by tested application program
RPC client-side interface codes in graphical user-interface element interface operation be tested the graphical interfaces of application program,
The event of analog manual operation and obtain interface display and simultaneously verify whether to meet the requirements, and test result be output to interface or
Person is recorded in test log, and specific implementation step is as follows:
2.1 are added to the stake code that the interface description file of tested program generates in test driver;
2.2 need to call the interface function in stake code according to test in test case code, realize to being tested program circle
The reading and operation of surface element;
2.3 operate interface according to test case and read interface output information, judge whether to meet the pre- of test case
Phase;If meeting expection, the information that the test of this test case passes through is exported on test interface, and be recorded in test log;
Otherwise exported on test interface the test of this test case not by information, and be recorded in test log.
2. cross-platform graphic user interface automatic test approach according to claim 1, it is characterised in that:In step 1
The graphical user-interface element includes window, menu, button, text box, list box, table.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610173320.6A CN105868104B (en) | 2016-03-24 | 2016-03-24 | A kind of cross-platform graphic user interface automatic test approach |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610173320.6A CN105868104B (en) | 2016-03-24 | 2016-03-24 | A kind of cross-platform graphic user interface automatic test approach |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105868104A CN105868104A (en) | 2016-08-17 |
CN105868104B true CN105868104B (en) | 2018-07-10 |
Family
ID=56625751
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610173320.6A Active CN105868104B (en) | 2016-03-24 | 2016-03-24 | A kind of cross-platform graphic user interface automatic test approach |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105868104B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106407121B (en) * | 2016-10-08 | 2018-02-27 | 腾讯科技(深圳)有限公司 | A kind of cross-platform data intercommunication conformance test method and using test server |
CN107733866A (en) * | 2017-09-12 | 2018-02-23 | 阿里巴巴集团控股有限公司 | RPC requests, RPC request processing methods, device and equipment |
CN117331847B (en) * | 2023-12-01 | 2024-01-30 | 成都中科合迅科技有限公司 | Automatic test method and system supporting graphic interface |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7886304B1 (en) * | 2007-05-03 | 2011-02-08 | Oracle America, Inc. | Method and system implementing efficient remote procedure call and emulation system therefor |
CN102253885A (en) * | 2010-05-19 | 2011-11-23 | 微软公司 | User interface snalysis management |
CN104834595A (en) * | 2015-02-15 | 2015-08-12 | 网易(杭州)网络有限公司 | Visual automatic test method and system |
-
2016
- 2016-03-24 CN CN201610173320.6A patent/CN105868104B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7886304B1 (en) * | 2007-05-03 | 2011-02-08 | Oracle America, Inc. | Method and system implementing efficient remote procedure call and emulation system therefor |
CN102253885A (en) * | 2010-05-19 | 2011-11-23 | 微软公司 | User interface snalysis management |
CN104834595A (en) * | 2015-02-15 | 2015-08-12 | 网易(杭州)网络有限公司 | Visual automatic test method and system |
Also Published As
Publication number | Publication date |
---|---|
CN105868104A (en) | 2016-08-17 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107577607B (en) | User interface automatic testing method and device, electronic equipment and storage medium | |
CN112270149B (en) | Verification platform automatic integration method and system, electronic equipment and storage medium | |
US20090125826A1 (en) | Systems and methods providing a declarative screen model for automated testing | |
US20080270841A1 (en) | Test case manager | |
US7926024B2 (en) | Method and apparatus for managing complex processes | |
US9785415B2 (en) | Remote interface to logical instruments | |
CN105868104B (en) | A kind of cross-platform graphic user interface automatic test approach | |
CN112083919B (en) | Target service code generation method and device based on YAML template | |
CN110362490B (en) | Automatic testing method and system for integrating iOS and Android mobile applications | |
CN110399299A (en) | The execution method of automated test frame and test case | |
CN113505082B (en) | Application program testing method and device | |
CN111459801A (en) | RSF remote service interface function test method, module, computer equipment and storage medium | |
CN112231206A (en) | Script editing method for application program test, computer readable storage medium and test platform | |
CN104063231A (en) | Test resource rapid access method based on HIT-TENA | |
Radeke et al. | PIM Tool: Support for pattern-driven and model-based UI development | |
KR20210039714A (en) | Method and apparatus for constructing test environment | |
Martens et al. | Diagnosing sca components using wombat | |
Hill et al. | Model-driven engineering for development-time QoS validation of component-based software systems | |
Pettit et al. | Modeling behavioral patterns of concurrent software architectures using Petri nets | |
US10235868B2 (en) | Embedded shared logical instrument | |
CN108536607B (en) | UI test method, device and readable storage medium | |
Bland et al. | Design and implementation of a menu based oscar command line interface | |
US20090031283A1 (en) | Method, apparatus and storage medium for customizing application | |
Vellis et al. | Towards a new generation of MBUI engineering methods: Supporting polymorphic instantiation in synchronous collaborative and ubiquitous environments | |
Karmore et al. | Development of software interface for testing of embedded system |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |