CN116257452A - Window application testing method and device, electronic equipment and storage medium - Google Patents

Window application testing method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116257452A
CN116257452A CN202310271417.0A CN202310271417A CN116257452A CN 116257452 A CN116257452 A CN 116257452A CN 202310271417 A CN202310271417 A CN 202310271417A CN 116257452 A CN116257452 A CN 116257452A
Authority
CN
China
Prior art keywords
test
window application
image
determining
window
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
CN202310271417.0A
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.)
Agricultural Bank of China
Original Assignee
Agricultural Bank of China
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 Agricultural Bank of China filed Critical Agricultural Bank of China
Priority to CN202310271417.0A priority Critical patent/CN116257452A/en
Publication of CN116257452A publication Critical patent/CN116257452A/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/3688Test management for test execution, e.g. scheduling of test suites
    • 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/3696Methods or tools to render software testable
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

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 method and a device for testing window application, electronic equipment and a storage medium. The method is characterized by comprising the following steps: acquiring a test window application to be tested, and determining a test execution instruction corresponding to the test window application; executing a test on the test window application according to the test execution instruction, and determining a test result image of the test window application; and determining the test result of the test window application based on the test result image and a preset check image. The method has the advantages that the testing time is shortened in window application, the testing accuracy is effectively improved, the testing efficiency is improved when the testing accuracy is ensured, and the testing labor cost is reduced.

Description

Window application testing method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of testing window applications, and in particular, to a method and apparatus for testing window applications, an electronic device, and a storage medium.
Background
The window application is a client program running on a user computer in a Windows system, and a user can communicate and interact through the window application. Before the window application developed by the developer is used from the online to the user, the developed window application needs to be tested, so that the window application can be ensured to run correctly according to a preset running mode, and meanwhile, errors of the window application can be found out rapidly. The existing window application test is generally to debug the tested window application by a tester, set corresponding test parameters, automatically complete the test of the window application by a test program according to the set test parameters, and then provide a corresponding test report by the tester according to the test process. In the test method in the prior art, although the test can be automatically performed, a tester is still required to perform corresponding debugging parameters and determine a test report, the test efficiency is low, and the full-automatic test cannot be performed.
Disclosure of Invention
The invention provides a method, a device, electronic equipment and a storage medium for testing window application, which are used for realizing full-automatic accurate testing of the window application.
According to an aspect of the present invention, there is provided a method for testing a window application, including:
acquiring a test window application to be tested, and determining a test execution instruction corresponding to the test window application;
executing a test on the test window application according to the test execution instruction, and determining a test result image of the test window application;
and determining the test result of the test window application based on the test result image and a preset check image.
According to another aspect of the present invention, there is provided a test apparatus for window application, including:
the test preparation module is used for acquiring a test window application to be tested and determining a test execution instruction corresponding to the test window application;
the test execution module is used for executing a test on the test window application according to the test execution instruction and determining a test result image of the test window application;
and the test verification module is used for determining the test result of the test window application based on the test result image and a preset verification image.
According to another aspect of the present invention, there is provided an electronic apparatus including:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of testing a window application of any of the embodiments of the present invention.
According to another aspect of the present invention, there is provided a computer readable storage medium storing computer instructions for causing a processor to execute a method for testing a window application according to any embodiment of the present invention.
According to the technical scheme, the test window application to be tested is obtained, the test execution instruction corresponding to the test window application is determined, and after the application to be tested is determined, the corresponding test execution instruction is determined, so that parameter setting by a tester is not needed, and the test efficiency can be effectively improved; the test execution instruction is used for executing the test on the test window application, and a test result image of the test window application is determined, so that the application to be tested can be automatically tested, the test result image is generated, the test result is not required to be determined manually, and the test efficiency is further improved; and determining the test result of the test window application based on the test result image and a preset check image, and comparing and checking the test result through the check image and the test result image, so that the accuracy of the test can be rapidly determined. The high-efficiency accurate test of window application is realized, the efficiency of window application test is effectively improved, the technical problem of low automation level of window application test in the prior art is solved, and the test accuracy is ensured when the test efficiency is improved.
It should be understood that the description in this section is not intended to identify key or critical features of the embodiments of the invention or to delineate the scope of the invention. Other features of the present invention will become apparent from the description that follows.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for the description of the embodiments will be briefly described below, and it is apparent that the drawings in the following description are only some embodiments of the present invention, and other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
FIG. 1 is a flowchart of a testing method for a window application according to an embodiment of the present invention;
FIG. 2 is a flowchart of another testing method for window application according to the second embodiment of the present invention;
FIG. 3 is a flowchart of another testing method for window application according to the third embodiment of the present invention;
fig. 4 is a schematic structural diagram of a testing device for window application according to a fourth embodiment of the present invention;
fig. 5 is a schematic structural diagram of an electronic device implementing a method for testing a window application according to an embodiment of the present invention.
Detailed Description
In order that those skilled in the art will better understand the present invention, a technical solution in the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in which it is apparent that the described embodiments are only some embodiments of the present invention, not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the present invention without making any inventive effort, shall fall within the scope of the present invention.
Example 1
Fig. 1 is a flowchart of a method for testing a window application according to an embodiment of the present invention, where the method may be performed by a testing device for a window application, the testing device for a window application may be implemented in hardware and/or software, and the testing device for a window application may be configured in an electronic device. As shown in fig. 1, the method includes:
s110, acquiring a test window application to be tested, and determining a test execution instruction corresponding to the test window application.
The test window application can be a window application which is required to be tested after development and completion. When the test window application needs to be described, the test window application can be a complete window application which has been developed, or a window application which has been developed to complete part of the functions.
The test execution instruction may be an instruction that needs to be executed by the test window application. Optionally, the test execution instruction includes a name of a control of the test window application for testing, an operation, and a value corresponding to the operation.
Optionally, before determining a test execution instruction corresponding to a test window application, a tester is required to determine the corresponding test execution instruction according to the test window application to be tested, and in the embodiment of the invention, the tester improves the packaging layer of the window control to increase event records, so that the operation of the tester in the test window application can be recorded in real time; and by capturing the operation of the tester in the test window application, recording the operation of the tester, and determining the test execution instruction applied to the test window.
Optionally, a tester creates a test item corresponding to the test window application according to the Appium (application Selenium) tool and the WinAppdriver framework, opens the test window application through the Apdium tool, determines a test execution instruction corresponding to the test window application, and tests the test window application.
Specifically, a test window application to be tested is obtained, the test window application to be tested is imported into a test item, a test execution instruction corresponding to the test window application is determined, and the test execution instruction is imported into the test item for testing.
S120, executing a test on the test window application according to the test execution instruction, and determining a test result image of the test window application.
The test result image may be an image taken of the test result after the test is completed. It should be noted that, the test result image may be captured by a camera function in the test item, or may be captured by a capture function in the test item, or may be an image captured by a camera set by the test device.
Specifically, a test window application to be tested and a test execution instruction are imported into a test project, the test window application is operated to execute the test execution instruction, a test result of the test window application is determined, the test result is shot, and a test result image of the test window application is obtained.
S130, determining a test result of the test window application based on the test result image and a preset check image.
The verification image may be an image preset to verify the correctness of the test result image. It should be noted that the verification image may be a test result obtained by manually applying to the test window by a tester, and further an obtained image; before automatic testing, a tester manually tests the test window application to determine a correct test result, and shoots the test result to obtain a verification image corresponding to the current test item.
Specifically, after the test result image is obtained, determining that the test window body application corresponds to a preset check image, and comparing the test result image with the check image, if the test result image is consistent with the check image, the test result of the test is considered to be successful, and if the test result image is inconsistent with the check image, the test result of the test is considered to be failed.
Optionally, in another optional embodiment of the present invention, the determining, based on the test result image and a preset verification image, a test result of the test window application includes:
calculating an image character string of the test result image according to a preset verification algorithm; and if the image character string is the same as the verification character string of the verification image, determining the test result of the test window application as passing the test.
The verification algorithm may be an image character string preset for calculating a test result image, and the verification algorithm may be an algorithm for calculating a generated character string according to an input image. After the test result image is obtained, the test result image is transferred into a verification algorithm, and the verification algorithm processes the test result image in real time to generate an image character string of the test result image. Illustratively, the verification algorithm may be an MD5 hash algorithm.
The image character string can be a character string corresponding to the test result image, and the image character string can be used for checking the test correctness of the test result image.
The verification character string can be a character string generated by the verification image based on a verification algorithm; the check character string is used for checking the correctness of the test result image. It should be noted that the check character string may be a test result obtained by applying a test person to a test window manually, and the obtained check image is processed and generated by a check algorithm, and the check character string is stored in a database corresponding to the test item, so that the test result can be directly invoked during checking. Illustratively, taking the MD5 hashing algorithm as an example, the check string and the image string are both 32-bit hexadecimal strings.
Specifically, after the test result image is obtained, the test result image is transmitted into a preset verification algorithm to obtain an image character string of the test result image, a verification character string is obtained from a database in a test item, the image character string and the verification character string are subjected to verification comparison, if the image character string and the verification character string are subjected to verification comparison to be consistent, the test result applied to the test window is determined to pass the test, and if the image character string and the verification character string are not consistent in verification comparison, the test result applied to the test window is determined to be failed in the test. By the method provided by the embodiment of the invention, the correctness check is carried out by using the image character string and the check character string processed by the check algorithm, and the efficiency and the accuracy of the check can be provided relative to a mode of comparing pictures with texts.
According to the technical scheme, the test window application to be tested is obtained, the test execution instruction corresponding to the test window application is determined, and after the application to be tested is determined, the corresponding test execution instruction is determined, so that parameter setting by a tester is not needed, and the test efficiency can be effectively improved; the test execution instruction is used for executing the test on the test window application, and a test result image of the test window application is determined, so that the application to be tested can be automatically tested, the test result image is generated, the test result is not required to be determined manually, and the test efficiency is further improved; and determining the test result of the test window application based on the test result image and a preset check image, and comparing and checking the test result through the check image and the test result image, so that the accuracy of the test can be rapidly determined. The high-efficiency accurate test of window application is realized, the efficiency of window application test is effectively improved, the technical problem of low automation level of window application test in the prior art is solved, and the test accuracy is ensured when the test efficiency is improved.
Example two
Fig. 2 is a flowchart of another method for testing a window application according to the second embodiment of the present invention, where the relationship between the present embodiment and the above embodiment is a specific method for obtaining a test execution instruction for testing a window application. As shown in fig. 2, the testing method for the window application includes:
S210, acquiring a test window application to be tested, and acquiring a corresponding test operation record according to the test window application.
The test operation record may be operation record information when a tester performs a manual test. The test operation record includes control information, operation information, and operation input values. It should be noted that, the test personnel performs a manual test on the test window application, and the event recording function in the test project can record the test operation record of the test personnel during the test, and store each test operation as the test operation record of the current test window application according to the control information, the operation information and the operation input value. The test operation records can be correspondingly stored in a table form. The control information is the name of the control, the operation information can be the action of the operation, and the operation input value can be the submitted value of the operation action.
Specifically, a test window application to be tested is obtained, the test window application to be tested is imported into a test project, and a corresponding test operation record is obtained according to the test window application.
S220, performing instruction conversion on the test operation record according to a preset instruction conversion method to obtain the test execution instruction.
The instruction conversion method may be preset to convert an operation record recorded in the test operation record into a test execution instruction.
Specifically, a test operation record is imported into the test item, and instruction conversion is performed on the test operation record according to a preset instruction conversion method, so that a test execution instruction is obtained.
Optionally, in another optional embodiment of the present invention, the performing instruction conversion on the test operation record according to a preset instruction conversion method to obtain the test execution instruction includes:
and carrying out instruction assembly on the control information, the operation information and the operation input value according to the instruction conversion method to obtain the test execution instruction.
Specifically, after the test operation record is obtained, the test operation record is imported into a test item, the control information, the operation information and the operation input value corresponding to each test operation in the test operation record are extracted by the instruction conversion method, and instruction assembly is carried out in a mode of binding the control information, the operation information and the operation input value, so that a test execution instruction is obtained.
Illustratively, the test operation of clicking the submit button is recorded as control information: bankid2, the test execution instruction obtained by the instruction conversion method is as follows: session. FindElementByAccessibilitid ("btnSubmit"). Enter ().
S230, executing a test on the test window application according to the test execution instruction, and determining a test result image of the test window application.
S240, determining a test result of the test window application based on the test result image and a preset check image.
According to the technical scheme, the test window application to be tested is obtained, the corresponding test operation record is obtained according to the test window application, the test operation record is recorded in the operation of a tester on the test window application, the test accuracy can be provided by recording the correct test operation record, the test operation record is subjected to instruction conversion according to the preset instruction conversion method, the test execution instruction is obtained, the test execution instruction can be accurately determined by recording one-time correct test operation, further automatic test is realized, and the test efficiency is further provided; executing a test on the test window application according to the test execution instruction, and determining a test result image of the test window application; and determining the test result of the test window application based on the test result image and a preset check image. The high-efficiency accurate test of window application is realized, the efficiency of window application test is effectively improved, the technical problem of low automation level of window application test in the prior art is solved, and the test accuracy is ensured when the test efficiency is improved.
Example III
Fig. 3 is a flowchart of another method for testing a window application according to the third embodiment of the present invention, where the relationship between the present embodiment and the above embodiment is a specific method for testing a window application according to a test execution instruction. As shown in fig. 3, the testing method for the window application includes:
s310, acquiring a test window application to be tested, and determining a test execution instruction corresponding to the test window application.
S320, determining a test operation corresponding to the test execution instruction according to the test execution instruction.
The test operation may be an operation that needs to be performed by the test window application. It should be noted that, in the embodiment of the present invention, the test item can be automatically tested, and when the test item is automatically tested, it is necessary to determine the test operation to be executed by the test window application, so that the test can be performed according to the test operation.
The test operation may be a test execution instruction including a test execution instruction to click on the submit button operation, and the test item may be a test execution instruction to click on the submit button.
Specifically, after the test item assembles the test execution instruction, the test execution instruction is parsed, and the test operation corresponding to the test execution instruction is determined.
S330, calling the test window application to execute the test operation, recording the test operation in a test log file of the test window application, and determining a test result image of the test window application.
The test log file may be a log file that records the application test to the test form.
Optionally, the test item acquires the test operation corresponding to the test window application, calls the test window application to execute the test operation, records the test operation executed by the test window application, and records the test operation in a log file in the test item. The log file records the information such as the operation, time for executing the operation, and process of executing the operation.
Specifically, after the test operation is obtained, the test item calls the test window application to execute the test operation, and the test operation is recorded in a test log file of the test window application.
Optionally, in another optional embodiment of the present invention, the calling the test window application to execute the test operation and recording the test operation in a test log file of the test window application further includes: if the test window application is called to execute the test operation and errors exist, outputting an error report window of the test operation; determining an error reporting interface image corresponding to the test operation according to the preset image acquisition method and the error reporting window; acquiring the error reporting information according to the error reporting window, and recording the error reporting information in a test log file of the test window application
The error reporting window may be a window for prompting a tester to automatically test that an error exists. Optionally, when the test window application is automatically tested, an error reporting window for prompting the testers of testing errors is further arranged in the test items created through the app ium tool and the windp driver framework. The error reporting window can be displayed in a pop-up mode on the test window application, and relevant information of the test error is prompted in the error reporting window.
The error reporting interface image may be an image captured by an interface applied to a test form that generates an error reporting window.
The preset image obtaining method may be a method for obtaining a test image of a test window application by preset setting, and it should be noted that in a test item, a camera function that may be set may take a photograph, or a screenshot function that may be set in the test item may take a screenshot.
The error reporting information can be error information existing when the test window application executes test operation, and the error reporting information can be displayed through the error reporting window.
Specifically, a test operation is executed by calling a test window application, if the test window application cannot execute the test operation or the test window application does not execute the test operation successfully, the test process of the test window application is considered to have errors, a corresponding error reporting window of the test operation is output to prompt error reporting information, further, an image acquisition is carried out on the error reporting window through a root preset image acquisition method to obtain an error reporting interface image corresponding to the test operation, error reporting information prompted in the error reporting window is acquired, and the error reporting information is recorded in a test log file of the test window application.
Optionally, in another optional embodiment of the present invention, the executing a test on the test window application according to the test execution instruction, determining a test result image of the test window application includes:
outputting a test instruction execution result of the test window application if the test operation to be executed corresponding to the test window application does not exist; and determining a test result image of the test window application according to a preset image acquisition method and the test instruction execution result.
The test instruction execution result may be an execution result obtained after the test window application executes the test operation.
Specifically, in the test item, an instruction is converted according to the imported test operation record to obtain a test execution instruction, after the test operation corresponding to the test execution instruction is executed according to the test window application, whether the test operation to be executed exists is judged, if the test operation to be executed exists, the test window application is continuously tested according to the test operation to be executed, if the test operation to be executed does not exist, the test of the test window application is considered to be completed, a test instruction execution result of the test window application is obtained, and an image of the test instruction execution result is shot through a preset image acquisition method to obtain a test result image of the test window application.
S340, determining a test result of the test window application based on the test result image and a preset check image.
According to the technical scheme, the test execution instruction corresponding to the test window application is determined by acquiring the test window application to be tested; and determining the test operation corresponding to the test execution instruction according to the test execution instruction, and determining the test operation corresponding to the test execution instruction, wherein the test can be executed through the test operation, so that the test efficiency is improved. The test operation is executed by calling the test window application, and the test operation is recorded in a test log file of the test window application, so that the application to be tested can be automatically tested, a test result image is generated, the test result is not required to be determined manually, the test efficiency is further improved, the test operation record is recorded in the log file, the test operation can be traced back, and the test accuracy is further ensured; and determining the test result of the test window application based on the test result image and a preset check image, and comparing and checking the test result through the check image and the test result image, so that the accuracy of the test can be rapidly determined. The high-efficiency accurate test of window application is realized, the efficiency of window application test is effectively improved, the technical problem of low automation level of window application test in the prior art is solved, and the test accuracy is ensured when the test efficiency is improved.
Optionally, the embodiment of the invention discloses another testing method for window application, wherein the method comprises the following steps:
s1, converting the test operation record into a test operation data set by using an application self-contained method, and extracting a specific test execution instruction by analyzing the test operation data set.
S2, when a new test window application is executed each time, the interface automation test tool restarts the WinAppdriver drive and calls a test execution instruction required to be tested so as to ensure that an operation session is not polluted by the last test window application.
The interface automation testing tool can be written by an app ium tool and a windp driver framework.
S3, selecting a binding mode from the test operation record extracted in the S1, assembling the test operation record into a test execution instruction, and executing the test operation of the test execution instruction through a session. Illustratively, clicking the submit button in the transaction interface records the next piece of control information as btnSubmit and the operation information as the script of the enter in real time. When assembling instructions, the instructions assembled by the test execution instructions are
session.FindElementByAccessibilityId(“btnSubmit”).Enter()。
S4, screenshot and log are generated. When the test operation in the test execution instruction is assembled and implemented, the automatic test tool records the operation corresponding to the current test operation in the log file. If the automatic test tool reports errors during the automatic test, the information in the error reporting popup window is recorded in the log file, and meanwhile, an application screenshot function is used for screenshot of an error reporting interface, so that an error reporting interface image is determined, and a tester can intuitively analyze the error reporting reason according to the log file and the error reporting interface image.
S5, checking correctness of the result screenshot. After the execution of the S4 is completed, whether the test execution instruction is completed or not is judged, and the execution result of the test instruction is output after the execution is completed. And simultaneously, the execution result of the test instruction of the application screenshot function is used for screenshot, a test result image is determined, and correctness checking is carried out on the test result image and a test file generated in the test process of the tested system. And calling an md5 hash algorithm to process the input test result image in real time, comparing the 32-bit hexadecimal image character string processed and generated by the md5 hash algorithm with a check character string of an expected result pre-led in a database, and outputting a comparison result.
S6, outputting a test result. After the S5 is executed, a test result of the test window application is output, and for example, according to different test systems, a corresponding adaptive result display can be made on the output test result, which mainly includes a function name, a test execution instruction of the function, a responsible person, a success case number, a failure case number, a total operand, a success case number, a failure case log name, and the like, and at the same time, a result of comparing the correctness of the test result image with that of the test file is displayed.
The technical scheme of the embodiment of the invention can quickly determine the accuracy of the test. The high-efficiency accurate test of window application is realized, the efficiency of window application test is effectively improved, the technical problem of low automation level of window application test in the prior art is solved, and the test accuracy is ensured when the test efficiency is improved.
Example IV
Fig. 4 is a schematic structural diagram of a testing device for window application according to a fourth embodiment of the present invention. As shown in fig. 4, the apparatus includes: test preparation module 410, test execution module 420, and test verification module 440, wherein,
a test preparation module 410, configured to obtain a test window application to be tested, and determine a test execution instruction corresponding to the test window application;
the test execution module 420 is configured to execute a test on the test window application according to the test execution instruction, and determine a test result image of the test window application;
and the test verification module 430 is configured to determine a test result of the test window application based on the test result image and a preset verification image.
According to the technical scheme, the test window application to be tested is obtained, the test execution instruction corresponding to the test window application is determined, and after the application to be tested is determined, the corresponding test execution instruction is determined, so that parameter setting by a tester is not needed, and the test efficiency can be effectively improved; the test execution instruction is used for executing the test on the test window application, and a test result image of the test window application is determined, so that the application to be tested can be automatically tested, the test result image is generated, the test result is not required to be determined manually, and the test efficiency is further improved; and determining the test result of the test window application based on the test result image and a preset check image, and comparing and checking the test result through the check image and the test result image, so that the accuracy of the test can be rapidly determined. The high-efficiency accurate test of window application is realized, the efficiency of window application test is effectively improved, the technical problem of low automation level of window application test in the prior art is solved, and the test accuracy is ensured when the test efficiency is improved.
Optionally, the test preparation module is specifically configured to:
acquiring a corresponding test operation record according to the test window application, wherein the test operation record comprises control information, operation information and an operation input value;
and performing instruction conversion on the test operation record according to a preset instruction conversion method to obtain the test execution instruction.
Optionally, the test preparation module is specifically further configured to:
and carrying out instruction assembly on the control information, the operation information and the operation input value according to the instruction conversion method to obtain the test execution instruction.
Optionally, the test verification module is specifically configured to:
calculating an image character string of the test result image according to a preset verification algorithm;
and if the image character string is the same as the check character string of the preset check image, determining the test result of the test window application as passing the test.
Optionally, the test execution module is specifically configured to:
determining a test operation corresponding to the test execution instruction according to the test execution instruction;
and calling the test window application to execute the test operation, and recording the test operation in a test log file of the test window application.
Optionally, the test execution module is specifically further configured to:
outputting a test instruction execution result of the test window application if the test operation to be executed corresponding to the test window application does not exist;
and determining a test result image of the test window application according to a preset image acquisition method and the test instruction execution result.
Optionally, the test execution module is specifically further configured to:
if the test window application is called to execute the test operation and errors exist, outputting an error report window of the test operation;
determining an error reporting interface image corresponding to the test operation according to the preset image acquisition method and the error reporting window;
and acquiring error reporting information according to the error reporting window, and recording the error reporting information in a test log file of the test window application.
The window application testing device provided by the embodiment of the invention can execute the window application testing method provided by any embodiment of the invention, and has the corresponding functional modules and beneficial effects of the execution method.
Example IV
Fig. 5 shows a schematic diagram of the structure of an electronic device 10 that may be used to implement an embodiment of the invention. Electronic devices are intended to represent various forms of digital computers, such as laptops, desktops, workstations, personal digital assistants, servers, blade servers, mainframes, and other appropriate computers. Electronic equipment may also represent various forms of mobile devices, such as personal digital processing, cellular telephones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions, are meant to be exemplary only, and are not meant to limit implementations of the inventions described and/or claimed herein.
As shown in fig. 5, the electronic device 10 includes at least one processor 11, and a memory, such as a Read Only Memory (ROM) 12, a Random Access Memory (RAM) 13, etc., communicatively connected to the at least one processor 11, in which the memory stores a computer program executable by the at least one processor, and the processor 11 may perform various appropriate actions and processes according to the computer program stored in the Read Only Memory (ROM) 12 or the computer program loaded from the storage unit 18 into the Random Access Memory (RAM) 13. In the RAM 13, various programs and data required for the operation of the electronic device 10 may also be stored. The processor 11, the ROM 12 and the RAM 13 are connected to each other via a bus 14. An input/output (I/O) interface 15 is also connected to bus 14.
Various components in the electronic device 10 are connected to the I/O interface 15, including: an input unit 16 such as a keyboard, a mouse, etc.; an output unit 17 such as various types of displays, speakers, and the like; a storage unit 18 such as a magnetic disk, an optical disk, or the like; and a communication unit 19 such as a network card, modem, wireless communication transceiver, etc. The communication unit 19 allows the electronic device 10 to exchange information/data with other devices via a computer network, such as the internet, and/or various telecommunication networks.
The processor 11 may be a variety of general and/or special purpose processing components having processing and computing capabilities. Some examples of processor 11 include, but are not limited to, a Central Processing Unit (CPU), a Graphics Processing Unit (GPU), various specialized Artificial Intelligence (AI) computing chips, various processors running machine learning model algorithms, digital Signal Processors (DSPs), and any suitable processor, controller, microcontroller, etc. The processor 11 performs the various methods and processes described above, such as the test method for the window application.
In some embodiments, the method of testing a window application may be implemented as a computer program tangibly embodied on a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and/or installed onto the electronic device 10 via the ROM 12 and/or the communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the test method for a window application described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the test method of the window application in any other suitable manner (e.g., by means of firmware).
Various implementations of the systems and techniques described here above may be implemented in digital electronic circuitry, integrated circuit systems, field Programmable Gate Arrays (FPGAs), application Specific Integrated Circuits (ASICs), application Specific Standard Products (ASSPs), systems On Chip (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and/or combinations thereof. These various embodiments may include: implemented in one or more computer programs, the one or more computer programs may be executed and/or interpreted on a programmable system including at least one programmable processor, which may be a special purpose or general-purpose programmable processor, that may receive data and instructions from, and transmit data and instructions to, a storage system, at least one input device, and at least one output device.
A computer program for carrying out methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus, such that the computer programs, when executed by the processor, cause the functions/acts specified in the flowchart and/or block diagram block or blocks to be implemented. The computer program may execute entirely on the machine, partly on the machine, as a stand-alone software package, partly on the machine and partly on a remote machine or entirely on the remote machine or server.
In the context of the present invention, a computer-readable storage medium may be a tangible medium that can contain, or store a computer program for use by or in connection with an instruction execution system, apparatus, or device. The computer readable storage medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any suitable combination of the foregoing. Alternatively, the computer readable storage medium may be a machine readable signal medium. More specific examples of a machine-readable storage medium would include an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
To provide for interaction with a user, the systems and techniques described here can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to a user; and a keyboard and a pointing device (e.g., a mouse or a trackball) through which a user can provide input to the electronic device. Other kinds of devices may also be used to provide for interaction with a user; for example, feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form, including acoustic input, speech input, or tactile input.
The systems and techniques described here can be implemented in a computing system that includes a background component (e.g., as a data server), or that includes a middleware component (e.g., an application server), or that includes a front-end component (e.g., a user computer having a graphical user interface or a web browser through which a user can interact with an implementation of the systems and techniques described here), or any combination of such background, middleware, or front-end components. The components of the system can be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: local Area Networks (LANs), wide Area Networks (WANs), blockchain networks, and the internet.
The computing system may include clients and servers. The client and server are typically remote from each other and typically interact through a communication network. The relationship of client and server arises by virtue of computer programs running on the respective computers and having a client-server relationship to each other. The server can be a cloud server, also called a cloud computing server or a cloud host, and is a host product in a cloud computing service system, so that the defects of high management difficulty and weak service expansibility in the traditional physical hosts and VPS service are overcome.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
Example five
The present embodiment provides a computer-readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of a method for testing a window application as provided by any embodiment of the present invention, the method comprising:
acquiring a test window application to be tested, and determining a test execution instruction corresponding to the test window application;
executing a test on the test window application according to the test execution instruction, and determining a test result image of the test window application;
and determining the test result of the test window application based on the test result image and a preset check image.
The computer storage media of embodiments of the invention may take the form of any combination of one or more computer-readable media. The computer readable medium may be a computer readable signal medium or a computer readable storage medium. The computer readable storage medium may be, for example, but not limited to: an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the computer-readable storage medium would include the following: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In this document, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
The computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, either in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination of the foregoing. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
Computer program code for carrying out operations of the present invention may be written in one or more programming languages, including an object oriented programming language such as Java, smalltalk, C ++ and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computer (for example, through the Internet using an Internet service provider).
It will be appreciated by those of ordinary skill in the art that the modules or steps of the invention described above may be implemented in a general purpose computing device, they may be centralized on a single computing device, or distributed over a network of computing devices, or they may alternatively be implemented in program code executable by a computer device, such that they are stored in a memory device and executed by the computing device, or they may be separately fabricated as individual integrated circuit modules, or multiple modules or steps within them may be fabricated as a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
It should be appreciated that various forms of the flows shown above may be used to reorder, add, or delete steps. For example, the steps described in the present invention may be performed in parallel, sequentially, or in a different order, so long as the desired results of the technical solution of the present invention are achieved, and the present invention is not limited herein.
The above embodiments do not limit the scope of the present invention. It will be apparent to those skilled in the art that various modifications, combinations, sub-combinations and alternatives are possible, depending on design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the scope of the present invention.

Claims (10)

1. A method for testing a window application, comprising:
acquiring a test window application to be tested, and determining a test execution instruction corresponding to the test window application;
executing a test on the test window application according to the test execution instruction, and determining a test result image of the test window application;
and determining the test result of the test window application based on the test result image and a preset check image.
2. The method of claim 1, wherein the determining the corresponding test execution instruction according to the test window application comprises:
acquiring a corresponding test operation record according to the test window application, wherein the test operation record comprises control information, operation information and an operation input value;
and performing instruction conversion on the test operation record according to a preset instruction conversion method to obtain the test execution instruction.
3. The method according to claim 2, wherein the performing instruction conversion on the test operation record according to a preset instruction conversion method to obtain the test execution instruction includes:
and carrying out instruction assembly on the control information, the operation information and the operation input value according to the instruction conversion method to obtain the test execution instruction.
4. The method of claim 1, wherein the determining the test result of the test window application based on the test result image and a preset verification image comprises:
calculating an image character string of the test result image according to a preset verification algorithm;
and if the image character string is the same as the check character string of the preset check image, determining the test result of the test window application as passing the test.
5. The method of claim 1, wherein the performing a test on the test window application according to the test execution instruction comprises:
determining a test operation corresponding to the test execution instruction according to the test execution instruction;
and calling the test window application to execute the test operation, and recording the test operation in a test log file of the test window application.
6. The method of claim 5, wherein the performing a test on the test window application according to the test execution instruction, determining a test result image of the test window application, comprises:
outputting a test instruction execution result of the test window application if the test operation to be executed corresponding to the test window application does not exist;
And determining a test result image of the test window application according to a preset image acquisition method and the test instruction execution result.
7. The method of claim 5, wherein the invoking the test window application to perform the test operation and recording the test operation in a test log file of the test window application further comprises:
if the test window application is called to execute the test operation and errors exist, outputting an error report window of the test operation;
determining an error reporting interface image corresponding to the test operation according to the preset image acquisition method and the error reporting window;
and acquiring error reporting information according to the error reporting window, and recording the error reporting information in a test log file of the test window application.
8. A test device for window applications, comprising:
the test preparation module is used for acquiring a test window application to be tested and determining a corresponding test execution instruction according to the test window application;
the test execution module is used for executing a test on the test window application according to the test execution instruction and determining a test result image of the test window application;
And the test verification module is used for considering that the test window application passes the test if the test result image is consistent with the preset verification image.
9. An electronic device, the electronic device comprising:
at least one processor; and
a memory communicatively coupled to the at least one processor; wherein,,
the memory stores a computer program executable by the at least one processor to enable the at least one processor to perform the method of testing a window application of any one of claims 1-7.
10. A computer readable storage medium storing computer instructions for causing a processor to execute the method of testing a window application of any of claims 1-7.
CN202310271417.0A 2023-03-17 2023-03-17 Window application testing method and device, electronic equipment and storage medium Pending CN116257452A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310271417.0A CN116257452A (en) 2023-03-17 2023-03-17 Window application testing method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310271417.0A CN116257452A (en) 2023-03-17 2023-03-17 Window application testing method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116257452A true CN116257452A (en) 2023-06-13

Family

ID=86682537

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310271417.0A Pending CN116257452A (en) 2023-03-17 2023-03-17 Window application testing method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116257452A (en)

Similar Documents

Publication Publication Date Title
EP3511836A1 (en) Generation of automated testing scripts by converting manual test cases
US8276020B2 (en) Systems and methods for automated determination of error handling
WO2018184361A1 (en) Application test method, server, terminal, and storage media
US9946638B1 (en) System and method for end to end performance response time measurement based on graphic recognition
JP7289334B2 (en) Methods and apparatus, electronic devices, storage media and computer programs for testing code
US9329979B2 (en) Derivation of generalized test cases
CN116089258A (en) Data migration test method, device, equipment, storage medium and program product
CN116257452A (en) Window application testing method and device, electronic equipment and storage medium
CN113238940B (en) Interface test result comparison method, device, equipment and storage medium
CN115437961A (en) Data processing method and device, electronic equipment and storage medium
CN114064469A (en) Interface automation test method and storage medium
CN114115628A (en) U shield display information acquisition method, device, equipment, medium and program product applied to U shield test
CN113515462B (en) Method, apparatus, device and storage medium for testing
CN112799956B (en) Asset identification capability test method, device and system device
CN111522737B (en) Automatic test verification method and device for front-end interface and storage medium
CN117056222A (en) Interface test file generation method and device, electronic equipment and storage medium
CN116303019A (en) Test tracing method, device, equipment and medium
CN117609064A (en) Unit test method and device, electronic equipment and storage medium
CN116400669A (en) Automatic test method, device, test equipment and medium for security level instrument control system
CN117493203A (en) Method, device, equipment and storage medium for testing server software
CN118193389A (en) Test case generation method, device, equipment, storage medium and product
CN116991737A (en) Software testing method, system, electronic equipment and storage medium
CN117076311A (en) Automatic test method, device, equipment and medium
CN116302914A (en) Software testing method and device, electronic equipment and storage medium
CN115238212A (en) Page designated element detection and replacement method, device, equipment and storage medium

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