CN114741319A - Method and device for testing Windows platform program - Google Patents

Method and device for testing Windows platform program Download PDF

Info

Publication number
CN114741319A
CN114741319A CN202210508411.6A CN202210508411A CN114741319A CN 114741319 A CN114741319 A CN 114741319A CN 202210508411 A CN202210508411 A CN 202210508411A CN 114741319 A CN114741319 A CN 114741319A
Authority
CN
China
Prior art keywords
test
program
tested
testing
test case
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
CN202210508411.6A
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.)
Jiangsu Yincheng Network Technology Co Ltd
Original Assignee
Jiangsu Yincheng Network Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Yincheng Network Technology Co Ltd filed Critical Jiangsu Yincheng Network Technology Co Ltd
Priority to CN202210508411.6A priority Critical patent/CN114741319A/en
Publication of CN114741319A publication Critical patent/CN114741319A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Abstract

The invention provides a method for testing a Windows platform program, relates to the field of program automation testing, and solves the technical problem that the testing efficiency of an application program based on a Windows platform is low in the prior art. The method comprises the following steps: responding to the editing operation aiming at the test case, and determining the test case content edited by the editing operation; wherein the test case corresponds to a program to be tested; responding to a trigger event of a specified test condition aiming at the test case, and controlling the test case to run; and testing the program to be tested according to the content of the test case to obtain a test result.

Description

Method and device for testing Windows platform program
Technical Field
The application relates to the field of program automation test, in particular to a method and a device for testing a Windows platform program.
Background
At present, a Windows system is used as a computer operating system with the most extensive application, and provides a service platform for a plurality of application programs. When an application is developed or used, it needs to be tested.
However, the development of an automatic test case for an application program is difficult, and a worker is required to perform repetitive manual tests, which causes the technical problem that the testing efficiency of the application program based on the Windows platform is low in the prior art.
Disclosure of Invention
The application aims to provide a method and a system for testing a Windows platform program, so as to relieve the technical problem that the testing efficiency of the application program based on a Windows platform is low in the prior art.
In a first aspect, an embodiment of the present application provides a method for testing a Windows platform program, where the method includes:
responding to the editing operation aiming at the test case, and determining the test case content edited by the editing operation; the test case corresponds to a program to be tested;
responding to a trigger event of a specified test condition aiming at the test case, and controlling the test case to run;
and testing the program to be tested according to the test case content to obtain a test result.
In one possible implementation, the operation interface of the program to be tested includes a Two Dimensional (2D) operation interface; the step of determining the test case content edited by the editing operation in response to the editing operation on the test case comprises the following steps:
screenshot is conducted on each operable control in the 2D operation interface, and a plurality of control pictures are obtained;
and storing the control pictures to an original resource gallery in the test case.
In a possible implementation, the step of testing the program to be tested according to the test case content to obtain a test result includes:
screenshot is carried out on the test interface of the program to be tested, and a test interface picture is obtained;
comparing the test interface picture with the control pictures to determine the coordinates of each control to be tested in the test interface;
and testing each control to be tested based on the coordinates to obtain a test result.
In a possible implementation, the step of testing each control to be tested based on the coordinates to obtain a test result includes:
testing the mouse operation function of the 2D operation interface based on the coordinates;
testing the keyboard operation function of the 2D operation interface based on the coordinates;
and saving the test result of the 2D operation interface as a first screenshot based on the test.
In a possible implementation, after the step of saving the test result of the 2D operation interface as the first screenshot based on the above test, the method further includes:
and updating the original resource gallery based on the first screenshot.
In one possible implementation, the operation interface of the program to be tested includes a Three Dimensional (3D) operation interface; the step of testing the program to be tested according to the test case content to obtain a test result comprises the following steps:
testing the control function of the 3D operation interface based on the test case content;
and saving the test result of the 3D operation interface as a second screenshot based on the test.
In a possible implementation, the step of testing the program to be tested according to the test case content to obtain a test result includes:
testing the pause and the resume operation functions of the program to be tested based on the test case content;
and saving the test result of the program to be tested as a third screenshot based on the test.
In one possible implementation, the trigger event of the specified test condition of the test case includes any one or more of the following items:
and aiming at the test operation of the program to be tested, the version updating of the program to be tested and the last test, the preset time interval is reached.
In a possible implementation, the step of testing the program to be tested according to the test case content to obtain a test result includes:
acquiring the test duration of the program to be tested, and judging whether the test duration is greater than a preset duration;
and if the test duration is longer than the preset duration, judging that the test result of the program to be tested fails and storing the test result as a fourth screenshot.
In a second aspect, an embodiment of the present application provides a testing apparatus for a Windows platform program, where the apparatus includes:
the editing module is used for responding to the editing operation aiming at the test case and determining the test case content edited by the editing operation; the test case corresponds to a program to be tested;
the control module is used for responding to a trigger event of a specified test condition and controlling the test case to run;
and the test module is used for testing the program to be tested according to the test case content to obtain a test result.
The embodiment of the application brings the following beneficial effects:
the embodiment of the application provides a method and a device for testing a Windows platform program, which can firstly respond to the editing operation aiming at a test case, determine the content of the test case edited by the editing operation, wherein the test case corresponds to a program to be tested, and then respond to a trigger event aiming at the specified test condition of the test case, and control the test case to run. Therefore, the program to be tested can be tested according to the content of the test case, and a test result is obtained. In the scheme, firstly, the system can respond to the editing operation of a worker on the test case, determine the content of the test case edited by the worker, then respond to the trigger event of the specified test condition, namely the specified trigger condition, control the test case to run, and test the program to be tested. And gradually testing the program to be tested according to the content of the test case and the preset sequence to further obtain a test result. The method is based on the core of the automatic application function test applied by the Windows platform, can ensure the quality and efficiency of the test work, and provides data support for the work of product research and development, test, scheme development and the like. The method can reduce the difficulty of test development automation test cases, effectively reduce the time wasted on repetitive manual test, support the method of Direct UI automation test, and is suitable for all Windows operating systems. The technical problem that the testing efficiency of the application program based on the Windows platform is low in the prior art is solved.
Drawings
In order to more clearly illustrate the detailed description of the present application or the technical solutions in the prior art, the drawings needed to be used in the detailed description of the present application or the prior art description will be briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative efforts.
Fig. 1 is a schematic flowchart of a testing method for a Windows platform program according to an embodiment of the present disclosure;
fig. 2 is a schematic flowchart of another testing method for Windows platform programs according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of a graphical user interface provided by an embodiment of the present application;
fig. 4 is a schematic structural diagram of a testing apparatus for a Windows platform program according to an embodiment of the present application;
fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present application will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present application. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
The terms "comprising" and "having," and any variations thereof, as referred to in the embodiments of the present application, are intended to cover non-exclusive inclusions. For example, a process, method, system, article, or apparatus that comprises a list of steps or elements is not limited to only those steps or elements but may alternatively include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
At present, the automatic test case for Windows platform application development has difficulty, and needs a worker to perform repeated manual test, so that the technical problem of low test efficiency for the application program based on the Windows platform exists.
Based on this, the embodiment of the application provides a testing method and a testing system for a Windows platform program, and the embodiment of the application supports a Direct UI automatic testing method and supports all Windows applications. The method comprises the steps of obtaining interface picture information, positioning picture positions, simulating keyboard and mouse events, moving windows, and carrying out text cutting/pasting operations in cooperation with a clipboard. A socket server (socket server) is started up separately in an application to support an interface service for automated testing, and message delivery is performed using sendmessage (a function in Windows). The sendmessage is used when the automated test process needs information or wants to operate an application, and the process to be tested responds to the information respectively. And the windows application information or the operation command is acquired and transmitted through the named pipeline. The technical problem that the testing efficiency of the application program based on the Windows platform is low in the prior art is solved.
The embodiments of the present application will be further described with reference to the accompanying drawings.
Fig. 1 is a schematic flowchart of a testing method for a Windows platform program according to an embodiment of the present application, and as shown in fig. 1, the method includes:
step S110, in response to the editing operation for the test case, determining the test case content edited by the editing operation.
The test case corresponds to a program to be tested.
For example, a worker may edit test case content corresponding to a program to be tested in advance, as shown in fig. 2, a specific process may be that the worker configures an application program launch path (exe path) first, and obtains an application window title using Spy + +. The system can automatically intercept all operable button pictures through tools such as PicPicPicPicPicPicpick and the like, and automatically save the operable button pictures as resource files. And then, under the condition that the original application program is not influenced, a worker develops a socket service plug-in for the application program, compiles a method or calls the existing method of the program, compiles an application execution instruction, compiles automatic program logic according to picture clicking, keyboard input, socket instruction sending and the like, and adds the compiled automatic program logic to a code automatic use case management module.
Spy + + (spyxx. exe) is a Windows-based utility that provides a graphical view of the processes, threads, Windows, and window messages of the system. The PicPicPicPicPicPicpick is software which has the functions of intercepting a full screen, a movable window, a designated area, a fixed area and a hand-drawn area, supports rolling screen interception, color acquisition of the screen, supports double displays, has the functions of displaying and measuring a white board, a screen scale and rectangular coordinates or polar coordinates, and has strong image editing and labeling functions.
It should be noted that the foregoing Spy + +, PicPick, and other tools are only used for illustration, and the embodiments of the present application do not limit this.
And step S120, responding to the trigger event of the specified test condition aiming at the test case, and controlling the test case to run.
For example, the system may initiate execution of the configured automation case for automated test verification in response to a trigger event for a specified test condition of the test case, for example, a timing trigger or an update of a check program.
And step S130, testing the program to be tested according to the content of the test case to obtain a test result.
For example, as shown in fig. 2, the system may control application start according to a configured application path, and when the application starts, the system simultaneously starts a socket service plug-in, so as to perform different automated tests on the program to be tested according to different test case contents, and further obtain a test result.
In the embodiment of the application, firstly, the system can respond to the editing operation of a test case by a worker, determine the content of the test case edited by the worker, then respond to the trigger event of the specified test condition, namely the specified trigger condition, control the test case to run, and test the program to be tested. And according to the content of the test case, gradually testing the program to be tested according to a preset sequence to further obtain a test result. Based on taking the automatic application function test of Windows platform application as a core, the testing method can ensure the quality and efficiency of testing work and provide data support for work such as product research and development, test, scheme development and the like. The method can reduce the difficulty of test development automation test cases, effectively reduce the time wasted on repetitive manual test, support the method of Direct UI automation test, and is suitable for all Windows operating systems. The technical problem that the testing efficiency of the application program based on the Windows platform is low in the prior art is solved.
The above steps are described in detail below.
In some embodiments, the operation interface of the application program includes multiple styles, which can be divided into a 2D interface and a 3D interface, and unique test case contents are edited more flexibly for different operation interfaces, so that the test efficiency of the program can be improved. As an example, the operation interface of the program to be tested includes a 2D operation interface; the step S110 may specifically include the following steps:
and a), screenshot is carried out on each operable control in the 2D operation interface to obtain a plurality of control pictures.
And b), storing the control pictures to an original resource gallery in the test case.
For example, as shown in fig. 3, a worker may automatically intercept all operable button pictures in the operation interface through a tool such as PicPick, for example, an account number input control 301, a password input control 302, a login button control 303, a close button control 304, and the like, to obtain several control pictures. And then, storing the control pictures to an original resource gallery in the test case, namely a preset folder. In practical application, the editor can be set as a hidden image editor before interception, the output mode is to store the hidden image editor as an image file, the interception is set to always copy the screenshot to a clipboard so as to facilitate direct pasting, and then the position of the automatically stored preset folder is set.
The method comprises the steps of automatically carrying out screenshot on each operable control in a 2D operation interface by a system to obtain a plurality of control pictures, and then storing the control pictures to an original resource gallery in a test case. The test case content corresponding to the 2D interface can be edited flexibly to generate a unique test case, and therefore the test efficiency is improved.
Based on the step a) and the step b), in the testing process, the system can compare the picture in the original resource gallery with the screenshot of the testing interface, so that the position of each control can be determined quickly and accurately, further, each control function of the program is tested automatically, and the testing efficiency is improved effectively. As an example, the step S130 may specifically include the following steps:
and c), carrying out screenshot on the test interface of the program to be tested to obtain a test interface picture.
And d), comparing the test interface picture with the control pictures to determine the coordinates of each control to be tested in the test interface.
And e), testing each control to be tested based on the coordinates to obtain a test result.
For example, the system may activate an application window according to a configured application window title, activate the application window when any operation is performed, and display the application window on a top layer, and then perform a 2D interface operation, when the system clicks a certain fixed picture element, capture an application screen as a test interface picture according to a window acquisition program window matrix left, top, right, and bottom, and compare a first control picture in an original resource gallery with the test interface picture using a Python Imaging Library (PIL) function, and acquire a coordinate point of the first control picture in the test interface picture. The system achieves the effect of clicking a button by clicking a coordinate point, when a first control picture does not correspond to a clicked place, a second control picture around the coordinate point of the first control picture can be found, the offset point position is calculated to click (single click, double click, right click and mouse wheel operation are supported), and meanwhile, the system can be driven and executed in a 3D interface operation mode.
In practical applications, as shown in fig. 3, the system may first select an account input control picture 305 in the original resource gallery to compare with a test interface picture, determine a position of the account input control in the test interface, and then test the position, and if the system does not find the account input control in the test interface picture, the system may select a password input control picture 306 in the original resource gallery, and calculate an offset point to test the password input control.
The system captures a test interface of a program to be tested to obtain a test interface picture, then the test interface picture is compared with a plurality of control pictures to determine the coordinate of each control to be tested in the test interface, and therefore each control to be tested is tested based on the coordinate to obtain a test result. The system can quickly and accurately position the specific position of the control in a picture recognition mode, so that each control function of the program is automatically tested, and the testing efficiency is effectively improved.
Based on the step c), the step D) and the step e), the test type aiming at the 2D operation interface can comprise multiple types, the test type can be more abundant to carry out all-round test on the operation interface by making the test type comprise multiple types, the coverage of the test is improved, multiple test functions can be completed through one-time test, and the test result is stored in a screenshot mode, so that the later-stage inspection is convenient, and the test efficiency is effectively improved. As an example, the step e) may specifically include the following steps:
and f), testing the mouse operation function of the 2D operation interface based on the coordinates.
And g), testing the keyboard operation function of the 2D operation interface based on the coordinates.
And h), saving the test result of the 2D operation interface as a first screenshot based on the test.
For example, as shown in fig. 2, the system may test a mouse operation function and a keyboard input function of the 2D operation interface. When the mouse operation function is tested, as shown in fig. 3, the system may compare the first control picture in the original resource gallery with the test interface picture to obtain the coordinate point of the first control picture in the test interface picture. The system achieves the effect of clicking the button by clicking the coordinate point, when the clicking place does not have the corresponding first control picture, the second control picture around the coordinate point of the first control picture can be found out, and the offset point position is calculated to click (single click, double click, right click and mouse wheel operation are supported). When the keyboard input function is tested, the system can acquire the control picture position information in front of the input box, click after the point location is shifted, then perform keyboard input (text copying is supported, keyboard input is supported), and traverse input contents from the preset text. The system can check the test result and judge whether the executed page picture exists or not, thereby judging whether the execution result is correct or not. Specifically, the system can determine through a title or a page element of a page window, and can also determine through positioning in an Xpath mode. And (4) whether the automatic test is successful or failed, the system captures the current interface to check the result. The system can judge whether the operation is correct or not through a pre-designed single-line operation flow script which cannot be mistaken in the middle process, for example, the program can continue to run only if all the steps in the middle are correct, so that the detection is that the script fails in the row after the script is automatically interrupted.
The mouse operation function and the keyboard operation function of the 2D operation interface are tested based on the coordinate by the system, and the test result of the 2D operation interface is saved as a first screenshot based on the test. Through making the test type include the multiple, comparatively abundant carry out the omnidirectional test to operation interface, improve the coverage of test, can accomplish multiple test function through once testing to save the test result screenshot, the later stage inspection of being convenient for, comparatively effectual improvement efficiency of software testing.
Based on the step f), the step g) and the step h), the system can flexibly update the screenshot in the original resource gallery in time according to the test result so as to ensure that the screenshot in the gallery is always the latest version, thereby avoiding influencing the subsequent test and improving the test efficiency. As an example, after the step h), the method may further include the steps of:
and i), updating the original resource gallery based on the first screenshot.
Illustratively, because the application program versions are iterated, the icons of the controls are also changed, and the system can judge whether the picture of the original screenshot is updated according to the test result, so that the screenshot picture is updated, the control screenshot in the gallery is ensured to be the latest version all the time, the control screenshot in the gallery of the old version is prevented from influencing the subsequent test, and the test efficiency is effectively improved.
In some embodiments, the operation interface of the application program includes multiple styles, which can be divided into a 2D interface and a 3D interface, and unique test case contents are edited more flexibly for different operation interfaces, so that the test efficiency of the program can be improved. As an example, the operation interface of the program to be tested includes a 3D operation interface; the step S110 may specifically include the following steps:
and j), testing the control function of the 3D operation interface based on the content of the test case.
And k), saving the test result of the 3D operation interface as a second screenshot based on the test.
For example, as shown in fig. 2, the system may test a 3D interface, connect to a socket service started by an application, send a 3D interface command, drive execution (e.g., control a virtual character to perform actions such as moving, rotating, clicking, jumping, hitting, destroying, etc.), and use the command to query an execution result or compare a known execution result with a picture, thereby determining whether the execution result is correct. And (4) whether the automatic test is successful or failed, the system captures the current interface to check the result.
And testing the control function of the 3D operation interface by the system based on the content of the test case, and saving the test result of the 3D operation interface as a second screenshot based on the test. Can carry out the omnidirectional test to operation interface through comparatively richening test type, improve the coverage of test, can accomplish multiple test function through once testing to save test result screenshot, the later stage inspection of being convenient for, comparatively effectual improvement efficiency of software testing.
In some embodiments, the test types may include multiple types, so that the operation interface can be richly tested, for example, the system can also test the pause and resume functions of the 2D and 3D operation interfaces. As an example, the step S130 may specifically include the following steps:
and step l), testing the pause and the operation resuming functions of the program to be tested based on the content of the test case.
And m), saving the test result of the program to be tested as a third screenshot based on the test.
Illustratively, as shown in fig. 2, for the 2D interface operation pause, before the program window matrix function is acquired, the global pause interface is encapsulated, and the control program runs, pauses and continues to execute. For the pause of the 3D interface operation, before the 3D interface instruction function is sent to be executed, the global pause interface is packaged, and the control program is executed in a pause and continuous mode. And (4) whether the automatic test is successful or failed, the system captures the current interface to check the result.
And testing the pause and the resume operation functions of the program to be tested based on the content of the test case by the system, and saving the test result of the program to be tested as a third screenshot based on the test. Carry out the omnidirectional test to operation interface through comparatively richening the test type, improve the coverage of test, can accomplish multiple test function through once testing to save the test result screenshot, the later stage inspection of being convenient for has comparatively effectually improved efficiency of software testing.
In some embodiments, the triggering conditions of the automated test may include multiple types, and the automated test of the system is triggered in multiple ways, so that the program to be tested can be tested more flexibly, and the stability of the program is ensured. As one example, the trigger event for the specified test condition of the test case includes any one or more of:
and aiming at the test operation of the program to be tested, the version updating of the program to be tested is completed, and a preset time interval is reached with the last test.
Illustratively, a test instruction can be issued manually by a tester, so that the system can automatically test a program to be tested; the system can also detect whether the version of the program to be tested is updated, and when the version of the program is updated, the automatic test is started; it is also possible to pass a preset time interval, for example once every hour, once every two hours, etc.
The trigger events of the specified test conditions of the test cases comprise various types, so that the automatic test of the system can be triggered in various modes, the program to be tested can be tested flexibly, and the stability of the program is ensured.
In some embodiments, the system may further detect a test duration of the automated test, and determine whether the test is successful by determining whether the test duration is greater than a preset duration. As an example, the step S130 may specifically include the following steps:
and n), acquiring the test time length of the program to be tested, and judging whether the test time length is greater than the preset time length.
And step o), if the testing time length is longer than the preset time length, judging that the testing result of the program to be tested fails and storing the result as a fourth screenshot.
For example, when the operation interface is tested, the system may determine whether the test is successful according to a preset test duration. When the 2D interface is tested, the result of the 2D interface is checked, whether the executed page picture exists or not is judged, whether the execution result is correct or not is judged, when the response time is not fixed, the longest overtime duration is set, and when the response time is not exceeded, cyclic check is carried out. When the 3D interface is tested, result checking is carried out on the 3D interface, the execution result is inquired by using an instruction or the picture comparison of the known execution result is carried out, when the response time is not fixed, the longest overtime duration is set, and when the response time is not overtime, cyclic checking is carried out. And when the overtime check fails, judging that the automatic execution fails, and screenshot the current interface when the screenshot fails so as to perform automatic program check and application program check. And when the inspection is successful, judging that the automatic execution is successful, and screenshot the current interface to perform result inspection.
After any one or more of the tests are carried out, the system generates an Html test report by using a report generating tool, feeds back an execution result, judges that the picture of the original screenshot is updated according to the result, and updates the picture in the original resource gallery. The tester can judge whether the problem is the logic problem of the automation program according to the result, thereby modifying the code logic.
In summary, as shown in fig. 2, the general process of the embodiment of the present application is as follows: firstly, controlling the pause and the recovery of the operation of a global 2D interface during operation to be encapsulated in an application automatic screenshot storing module, intercepting each operation button picture from a program and encapsulating the operation button picture in a program original resource picture management module, then encapsulating the application automatic screenshot storing module, the program original resource picture management module and an OpenCV realization picture comparison module together to generate mouse operations (clicking, double clicking, right clicking, mouse wheels and the like) and keyboard operations (keyboard input, copying, pasting and the like), and then executing the drive to the 2D interface operation module; the pause and the resume of the operation of the control global 3D interface are encapsulated to a Socket service connection and instruction sending connection module, and then the drive is executed to a 2D interface operation module and a 3D interface operation module; then generating a writing automation use case (comprising an execution step and a step result check) based on the 2D interface operation module and the 3D interface operation module; storing the data to an automatic case management module; the timing task module executes/manually executes the automated test when the timing task module executes/acquires the program update, pulls the automated case from the automated case management module, and starts the application program test; the system acquires application basic information configuration and starts a tested program; the method comprises the following steps that a tested program application (automatically running Socket service plug-in) executes business logic operation, wherein various execution instructions (such as movement, rotation, clicking, jumping, striking, destroying and the like) are written in the Socket plug-in advance; the system checks the feedback execution result and generates a result report for the examination and analysis of a tester.
Fig. 4 is a schematic structural diagram of a testing apparatus 400 for a Windows platform program according to an embodiment of the present disclosure. As shown in fig. 4, the apparatus includes:
the editing module 401 is configured to determine, in response to an editing operation for a test case, test case content edited by the editing operation; wherein the test case corresponds to a program to be tested;
a control module 402, configured to control a test case to run in response to a trigger event of a specified test condition;
the test module 403 is configured to test the program to be tested according to the content of the test case, so as to obtain a test result.
In some embodiments, the operation interface of the program to be tested includes a 2D operation interface; the editing module 401 is specifically configured to:
screenshot is conducted on each operable control in the 2D operation interface to obtain a plurality of control pictures;
and storing the control pictures to an original resource gallery in the test case.
In some embodiments, the test module 403 is specifically configured to:
screenshot is carried out on a test interface of a program to be tested, and a test interface picture is obtained;
comparing the test interface picture with a plurality of control pictures to determine the coordinate of each control to be tested in the test interface;
and testing each control to be tested based on the coordinates to obtain a test result.
In some embodiments, the test module 403 is specifically configured to:
testing the mouse operation function of the 2D operation interface based on the coordinates;
testing the keyboard operation function of the 2D operation interface based on the coordinates;
and saving the test result of the 2D operation interface as a first screenshot based on the test.
In some embodiments, the apparatus further comprises:
and the updating module is used for updating the original resource gallery based on the first cut chart after the test result of the 2D operation interface is stored as the first cut chart based on the test.
In some embodiments, the operation interface of the program to be tested comprises a 3D operation interface; the editing module 401 is specifically configured to:
testing the control function of the 3D operation interface based on the content of the test case;
and saving the test result of the 3D operation interface as a second screenshot based on the test.
In some embodiments, the test module 403 is specifically configured to:
testing the pause and the resume operation functions of the program to be tested based on the content of the test case;
and saving the test result of the program to be tested as a third screenshot based on the test.
In some embodiments, the trigger event for the specified test condition of the test case includes any one or more of:
and aiming at the test operation of the program to be tested, the version updating of the program to be tested and the last test, the preset time interval is reached.
In some embodiments, the test module 403 is specifically configured to:
the step of testing the program to be tested according to the content of the test case to obtain a test result comprises the following steps:
acquiring the test duration of a program to be tested, and judging whether the test duration is greater than a preset duration;
and if the test duration is longer than the preset duration, judging that the test result of the program to be tested fails and storing the test result as a fourth screenshot.
The device provided by the embodiment of the present invention has the same implementation principle and technical effect as the method embodiments, and for the sake of brief description, no mention is made in the system embodiments, and reference may be made to the corresponding contents in the method embodiments.
The embodiment of the invention provides electronic equipment, which particularly comprises a processor and a storage device; the storage means has stored thereon a computer program which, when executed by the processor, performs the method of any of the above embodiments.
Fig. 5 is a schematic structural diagram of an electronic device according to an embodiment of the present invention, where the electronic device includes: the system comprises a processor 501, a memory 502, a bus 503 and a communication interface 504, wherein the processor 501, the communication interface 504 and the memory 502 are connected through the bus 503; the processor 501 is arranged to execute executable modules, such as computer programs, stored in the memory 502.
The Memory 502 may include a high-speed Random Access Memory (RAM) and may also include a Non-volatile Memory (Non-volatile Memory), such as at least one disk Memory. The communication connection between the network element of the system and at least one other network element is realized through at least one communication interface 504 (which may be wired or wireless), and the internet, a wide area network, a local network, a metropolitan area network, and the like can be used.
Bus 503 may be an ISA bus, PCI bus, EISA bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 5, but this does not indicate only one bus or one type of bus.
The memory 502 is used for storing a program, the processor 501 executes the program after receiving an execution instruction, and the method executed by the apparatus defined by the flow process disclosed in any of the foregoing embodiments of the present invention may be applied to the processor 501, or implemented by the processor 501.
The processor 501 may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware or instructions in the form of software in the processor 501. The Processor 501 may be a general-purpose Processor, and includes a Central Processing Unit (CPU), a Network Processor (NP), and the like; the device can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present invention may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present invention may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in the memory 502, and the processor 501 reads the information in the memory 502 and completes the steps of the method in combination with the hardware.
The computer program product of the readable storage medium provided in the embodiment of the present invention includes a computer readable storage medium storing a program code, and instructions included in the program code may be used to execute the method in the foregoing method embodiment, and specific implementation may refer to the foregoing method embodiment, which is not described herein again.
The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes instructions for causing a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
Finally, it should be noted that: although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art will understand that: any person skilled in the art can modify or easily conceive the technical solutions described in the foregoing embodiments or equivalent substitutes for some technical features within the technical scope of the present disclosure; such modifications, changes or substitutions do not depart from the spirit and scope of the embodiments of the present invention, and they should be construed as being included therein. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.

Claims (10)

1. A method for testing Windows platform programs is characterized by comprising the following steps:
responding to an editing operation aiming at a test case, and determining test case content edited by the editing operation; the test case corresponds to a program to be tested;
responding to a trigger event of a specified test condition aiming at the test case, and controlling the test case to run;
and testing the program to be tested according to the test case content to obtain a test result.
2. The method according to claim 1, wherein the operation interface of the program to be tested comprises a 2D operation interface; the step of determining the test case content edited by the editing operation in response to the editing operation on the test case comprises the following steps:
screenshot is conducted on each operable control in the 2D operation interface to obtain a plurality of control pictures;
and storing the control pictures to an original resource gallery in the test case.
3. The method according to claim 2, wherein the step of testing the program under test according to the test case content to obtain a test result comprises:
screenshot is carried out on the test interface of the program to be tested, and a test interface picture is obtained;
comparing the test interface picture with the control pictures to determine the coordinates of each control to be tested in the test interface;
and testing each control to be tested based on the coordinates to obtain a test result.
4. The method of claim 3, wherein the step of testing each of the controls to be tested based on the coordinates to obtain the test result comprises:
testing the mouse operation function of the 2D operation interface based on the coordinates;
testing the keyboard operation function of the 2D operation interface based on the coordinates;
and saving the test result of the 2D operation interface as a first screenshot based on the test.
5. The method according to claim 4, wherein after the step of saving the test result of the 2D operation interface as the first screenshot based on the test, the method further comprises:
and updating the original resource gallery based on the first screenshot.
6. The method according to claim 1, wherein the operation interface of the program to be tested comprises a 3D operation interface; the step of testing the program to be tested according to the test case content to obtain a test result comprises the following steps:
testing the control function of the 3D operation interface based on the test case content;
and saving the test result of the 3D operation interface as a second screenshot based on the test.
7. The method according to claim 1, wherein the step of testing the program under test according to the test case content to obtain a test result comprises:
based on the content of the test case, testing the pause and the operation resuming functions of the program to be tested;
and saving the test result of the program to be tested as a third screenshot based on the test.
8. The method of claim 1, wherein the trigger event of the specified test condition of the test case comprises any one or more of the following:
and aiming at the test operation of the program to be tested, the version updating of the program to be tested and the last test, the preset time interval is reached.
9. The method according to claim 1, wherein the step of testing the program under test according to the test case content to obtain a test result comprises:
acquiring the test duration of the program to be tested, and judging whether the test duration is greater than a preset duration or not;
and if the test duration is longer than the preset duration, judging that the test result of the program to be tested is failed and storing the test result as a fourth screenshot.
10. A testing apparatus for Windows platform programs, the apparatus comprising:
the editing module is used for responding to the editing operation aiming at the test case and determining the test case content edited by the editing operation; the test case corresponds to a program to be tested;
the control module is used for responding to a trigger event of a specified test condition and controlling the test case to run;
and the test module is used for testing the program to be tested according to the test case content to obtain a test result.
CN202210508411.6A 2022-05-10 2022-05-10 Method and device for testing Windows platform program Pending CN114741319A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210508411.6A CN114741319A (en) 2022-05-10 2022-05-10 Method and device for testing Windows platform program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210508411.6A CN114741319A (en) 2022-05-10 2022-05-10 Method and device for testing Windows platform program

Publications (1)

Publication Number Publication Date
CN114741319A true CN114741319A (en) 2022-07-12

Family

ID=82286312

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210508411.6A Pending CN114741319A (en) 2022-05-10 2022-05-10 Method and device for testing Windows platform program

Country Status (1)

Country Link
CN (1) CN114741319A (en)

Similar Documents

Publication Publication Date Title
CN108595329B (en) Application testing method and device and computer storage medium
CN109871326B (en) Script recording method and device
US9632754B2 (en) Auto generation and linkage of source code to test cases
CN104391797A (en) GUI (graphical user interface) widget identification method and device
US10942837B2 (en) Analyzing time-series data in an automated application testing system
CN112988605B (en) Method and device for realizing WEB application automatic test
US8984487B2 (en) Resource tracker
CN113778898A (en) User interface automatic testing method and device, electronic equipment and storage medium
CN112732587A (en) Method and device for acquiring automatic test log, electronic equipment and storage medium
CN110543429B (en) Test case debugging method, device and storage medium
CN110727575B (en) Information processing method, system, device and storage medium
CN111522749B (en) Page testing method and device, readable storage medium and electronic equipment
CN116719736A (en) Test case generation method and device for testing software interface
CN114741319A (en) Method and device for testing Windows platform program
US6983454B2 (en) Extended “run to” function
US10169216B2 (en) Simulating sensors
CN113590564B (en) Data storage method, device, electronic equipment and storage medium
CN113360379B (en) Program test environment creation method and program test environment creation apparatus
CN106557379B (en) Method and device for generating silent installation package
CN113326193A (en) Applet testing method and device
CN113986263A (en) Code automation test method, device, electronic equipment and storage medium
CN112765041A (en) Game automatic testing method and device and electronic equipment
CN113360366A (en) Web page testing method, testing device, electronic equipment and storage medium
CN110990181A (en) Method and system for automatically reproducing probabilistic setting failure of options in BIOS (basic input/output System)
CN116610557B (en) Action binding information debugging method and device, storage medium and electronic equipment

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