WO2018036528A1 - Automatic testing method - Google Patents

Automatic testing method Download PDF

Info

Publication number
WO2018036528A1
WO2018036528A1 PCT/CN2017/098686 CN2017098686W WO2018036528A1 WO 2018036528 A1 WO2018036528 A1 WO 2018036528A1 CN 2017098686 W CN2017098686 W CN 2017098686W WO 2018036528 A1 WO2018036528 A1 WO 2018036528A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
action
current
control
screen
Prior art date
Application number
PCT/CN2017/098686
Other languages
French (fr)
Chinese (zh)
Inventor
陈立森
Original Assignee
上海合福信息科技有限公司
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 上海合福信息科技有限公司 filed Critical 上海合福信息科技有限公司
Publication of WO2018036528A1 publication Critical patent/WO2018036528A1/en

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

Definitions

  • the present invention relates to the field of software testing technologies, and in particular, to an automatic testing method.
  • the traditional software testing technology has a stage of manual intervention.
  • the tester needs to manually set the test case and various test actions included therein, and manually run the test, manually compare the test results and judge whether the test is successful according to the comparison result.
  • there are too many steps of manual intervention in the existing software testing technology so it takes up a lot of artificial resources, prolongs the time of software testing, and reduces the testing efficiency.
  • test parameter setting is usually implemented by code level settings that only professional testers can master. Therefore, the test setup is complicated, and the tester is required to have matching code knowledge and technology. Software testing for parameter settings.
  • an automatic testing method which aims to realize automatic visualization of testing, making the testing process more intuitive and more efficient, and simplifying the testing operation.
  • An automatic testing method wherein a plurality of test cases are preset in order, each of the test cases corresponding to a plurality of sequentially executed test actions, each of the test actions corresponding to one test control, each of the The test action corresponds to one operation method, each of the test controls corresponds to one test screen, and each of the test actions corresponds to a plurality of expected results;
  • test actions corresponding to all the test cases that need to be executed this time are arranged in the order in which the test cases are executed to form a test action list;
  • the automatic test method includes:
  • Step S1 selecting one of the test actions as the current action in the action list, and The test case corresponding to the current action is tested as a current use case;
  • Step S2 comparing the number of the display screen in the system browser during the test with the number of the test screen corresponding to the current action to locate the display screen;
  • Step S3 grab the test control matching the current action as the current control in the displayed display screen
  • Step S4 according to the action attribute of the current action, operating the captured current control according to the corresponding operation method, and then outputting an operation result corresponding to the current action;
  • step S5 the operation result is compared with the expected result corresponding to the current action to determine whether the current action is successfully executed, and the corresponding comparison result is saved as the test result of the current action.
  • the automatic test method in the step S1, extracting the first test control corresponding to the current use case when performing the first test action associated with the current use case
  • the test screen is used as an open screen, and the open screen is opened by an address associated with the open screen to start testing the current use case.
  • the automatic test method in the step S1, before performing each of the test actions associated with the current use case, determining whether it is necessary to open the test corresponding to the test according to the action attribute of the test action The test screen of the test control of the action, and extracting an address associated with the test screen as needed to open the test screen.
  • the automatic test method in the step S1, extracting initialization data of the current use case after confirming the test case as the current use case, and data in a database associated with the current use case Performing an initialization operation to start testing the current use case;
  • the screen is opened to test the startup screen.
  • the automatic testing method wherein the step S2 specifically includes:
  • the automatic testing method wherein the step S2 specifically includes:
  • the number of the display screen is such that when the number of the display screen matches the number of the test screen, it is confirmed that the display screen is successfully switched to locate the display screen.
  • the automatic test method in the step S3, after capturing one of the test controls in the display screen, the test attribute corresponding to the test action and the test corresponding to the current action
  • the control attributes of the control are matched and a matching result is obtained, and the test control that is captured is positioned as the current control when the matching result indicates that the matching is successful.
  • the automatic test method in the step S4, before the operation of the control, first determining the action attribute of the current action, and determining, according to the action attribute, the current control operating:
  • action attribute of the current action is an execution operation command, performing an operation on the current control to execute the operation command to operate the control;
  • action attribute of the current action is a send text column message, operating the current control to send the corresponding text column message;
  • action attribute of the current action is memory copy, save the value of the current control in a system memory
  • the action attribute of the current action is a memory assignment, changing a value of the current control to a value saved in the system memory;
  • the action attribute of the current action is a logical judgment, determining an expression stored in the system memory for indicating an assignment, and skipping a preset subsequent to the current action according to the determination result Said test action;
  • the current control is operated by transmitting a corresponding function key combination command to an input device of the system.
  • the automatic test method in the step S5, performs a comparison between the operation result and the expected result according to the type of the operation result:
  • the system reads information of the control corresponding to the display screen in the browser, and reads the read information The expected results are compared;
  • the system reads the corresponding column of data in the browser, and performs the read information with the expected result.
  • the system reads the data in the database and compares the read information with the expected result.
  • the automatic test method in the step S5, determining whether the current action is performed successfully:
  • test of the current use case is ended and jumps to the next test case, and then returns to the step S1.
  • the automatic test method in the step S5, after saving the corresponding comparison result as the test result of the current action, jumping to the next test action:
  • step S4 If the next test action jumped to indicates that the global control is operated, the process returns to step S4.
  • the beneficial effects of the above technical solution are: providing an automatic test method, which can realize the automatic visualization of the test, making the test process more intuitive and more efficient, and simplifying the test operation.
  • FIG. 1 is a schematic overall flow chart of an automatic test method in a preferred embodiment of the present invention.
  • 2-3 is a schematic diagram of a preset test case in a preferred embodiment of the present invention.
  • FIG. 4 is a schematic diagram of a preset screen in a preferred embodiment of the present invention.
  • Figure 5 is a schematic illustration of a preset test action in a preferred embodiment of the present invention.
  • Figure 6 is a schematic diagram of a preset control in a preferred embodiment of the present invention.
  • 7-9 are schematic illustrations of different contemplated results in a preferred embodiment of the present invention.
  • an automatic test method is provided based on the above problems existing in the prior art.
  • a plurality of test cases are first preset in sequence, and each test case corresponds to a plurality of test actions executed in sequence, each test action corresponds to only one test control, and each test action corresponds to one test action.
  • the method of operation that is, for one control, there is only one method of operation.
  • Each test control corresponds to a test screen.
  • Each test action corresponds to a plurality of expected results;
  • test actions of all the test cases that need to be executed this time are arranged in the order in which the test cases are executed to form a test action list;
  • the steps of the above automatic testing method specifically include:
  • Step S1 selecting a test action as the current action in the action list, and testing the test case corresponding to the current action as the current use case;
  • Step S2 comparing the number of the display screen in the system browser during the test with the number of the test screen corresponding to the current action to locate the display screen;
  • Step S3 capturing a test control matching the current action as a current control in the displayed display screen
  • Step S4 according to the action attribute of the current action, operating the captured current control according to the corresponding operation method, and then outputting the operation result corresponding to the current action;
  • step S5 the operation result is compared with the expected result of the current action to determine whether the current action is successfully executed, and the corresponding comparison result is saved as the test result of the current action.
  • a plurality of test cases are preset first, and each test case includes a plurality of test actions, and each test action corresponds to one test control.
  • Each test control corresponds to one test screen, so it is decided that each test case corresponds to multiple test pictures.
  • test case is preset in order, that is, a plurality of test cases are preset according to a certain execution order, and after one test case is executed, the next test case is turned to execute.
  • different test actions are also arranged in order, and each test action corresponds to
  • each test control corresponds to a test screen.
  • the above test screen can be divided into an open screen and a subsequent screen. For a test case, there is only one open screen, and there may be multiple subsequent screens.
  • the open screen may be the first screen executed by the test case, and the subsequent screen is the display screen after the above-mentioned open screen and sequentially arranged.
  • Each test screen (including the open screen and subsequent screens) is the screen corresponding to the operation of a test control.
  • a test action of entering a username and password may include a test action of entering a username and password, and a test action of clicking a login control.
  • the test screen corresponding to the login control may be a login screen provided to the user for inputting a user name and a password, and the screen may be used as a startup screen of the test case, and the plurality of subsequent screens of the test case may be a system displayed after successful login. Other screens of the browser, or screens that failed to log in. The above pictures are sorted according to test logic.
  • the setting interface of the test case is as shown in Figure 2-3.
  • the name of the opening screen in the test case is “account information”, and the name of the test case is “Enter the modified account password interface”.
  • the pre-association test case of the test case is “Enter Account Information Interface”, and accordingly, the test
  • the pre-association test cases of the use cases also include "login”, "enter system management” and “enter account information interface”, and the above-mentioned pre-association test cases are arranged in order.
  • the setting interface of the test case shown in FIG. 2 is a visual interface, which is not a code level setting interface in the prior art, so the setting process of the test case can be simplified.
  • a list of the above-described preset test cases is shown in FIG.
  • the setting interface of the test screen (including the open screen and the subsequent screen) associated with the test case is as shown in FIG. 4 .
  • the screen information in FIG. 4 includes a screen number (ID), a screen name, and a screen access address.
  • the so-called access address refers to a URL (Uniform Resoure Locator) address.
  • the above screen setting interface is also a visual interface.
  • the setting interface of the test action is as shown in FIG. 5, and the test action in FIG. 5 can be configured as “embedded search condition”, wherein the name of the plurality of display screens, multiple control names, and multiple action attributes are associated with each other. (method) and assignment of multiple test actions.
  • the setting interface of the above test action is also visually easy to operate.
  • the operation method corresponding to each test action may be obtained by a series of calculations of the action attribute, and the action attribute may be represented by a corresponding expression.
  • test cases A, B, and C are respectively arranged in order, and are measured.
  • test actions A1, A2, and A3 are respectively arranged in order
  • test actions B1 and B2 are respectively arranged in the test case B
  • test actions C1 are respectively arranged in the test case C.
  • the above action list may be A1, A2, A3, B1, B2, C1, C2, C3, and C4 arranged in order.
  • the setting interface of the control associated with each test action is as shown in FIG. 6.
  • the control information of each control includes the control serial number (ID), the control title, the control type, the front-end technology of the control, the attribute name used for the control positioning, the attribute value used for the control positioning, and the maximum/minimum of the control. Value/maximum length/minimum length, default value of the control, list of correct values for the control/list of error values, etc.
  • the setting screen of the above control is also a visual screen.
  • the settings of the test cases, test actions, screens, and controls may be performed in the following two ways: 1) pre-set by the system; 2) pre-set each test element in the system, then use Different test elements can be selected through the corresponding visual interface and combined to form setting information such as test cases, test actions, pictures and controls.
  • test cases included in the test case are placed in an action list according to the order of different test cases.
  • step S1 first select a test action to start the test. Specifically, for the test action, the corresponding test case can be determined, and the determined test case is used as the current use case to start the test.
  • the switching state of the display screen of the browser is monitored, the screen number of the display screen currently loaded by the browser is found, and the number of the test screen of the current action is displayed with the display.
  • the number of the screen is compared, that is, the screen of the current display screen is matched with the test screen corresponding to the current motion, so that the display screen of the current browser is positioned as a test screen corresponding to the current motion in the current use case.
  • the display content in the display screen is analyzed, and real-time information of all the controls in the display screen is captured, according to related information and test actions of the control captured in the display screen.
  • Corresponding control information (such as positioning properties) is matched so that accurate controls can be located and the position information of the positioned controls can be recorded.
  • the matching will be performed.
  • the control is positioned as the current control.
  • the manner of positioning the control may include: firstly, using a test control corresponding to the test action to locate a test screen, where the test screen is the currently displayed display screen. Since the display screen may not only include one control, the test control corresponding to the above test action needs to be located in the display screen to complete the positioning of the test control.
  • the corresponding operation may be performed on the test control according to the action attribute of the current action, and then the current action is executed, and the operation result corresponding to the current action is recorded.
  • the operation result is compared with the expected result corresponding to the current action to determine whether the current action is successful, and the comparison result is recorded.
  • test parameters such as test cases, test actions, test controls, test pictures, and expected results
  • a visual operation method can be conveniently and conveniently
  • test parameters are automatically visualized by software testing to meet people's software testing needs and improve the efficiency of software testing.
  • step S1 before performing each test action associated with the current use case, it is determined according to the action attribute of the test action whether the test screen corresponding to the test action of the test action needs to be opened. And extract the address associated with the test screen as needed to open the test screen. Specifically, in the above embodiment, before performing each test action, it is required to determine whether the test screen of the test control corresponding to the test action needs to be loaded: if necessary, load the corresponding test screen; if not, it is not correct. Make any changes to the picture. In the above embodiment, the extraction and loading of the test screen is implemented by extracting the URL address of the corresponding screen of the corresponding control.
  • the current use case is tested by extracting the URL address associated with the corresponding picture of the corresponding control, using the startup parameter specified by the current use case, and opening the corresponding URL address in the browser. If the currently specified browser has been opened, it is only necessary to update the display screen in the browser by extracting the URL address associated with the screen.
  • the action attribute of the test action may include an association relationship between the test action and the action in the sequence. The system can judge the relationship between the test action and its front and rear actions, and then determine whether it is necessary to extract the corresponding URL address and open the corresponding test screen.
  • step S1 when the first test action associated with the current use case is executed, the test screen corresponding to the first test control of the current use case is extracted as the open screen, and Open the open screen with the address associated with the open screen to begin testing the current use case.
  • the test screen of the test control corresponding to the test action is loaded as the open screen only when the first test action in one test case is executed.
  • the first test action in the above action list can be selected and the test can be started.
  • the test action is taken as the current action, and the corresponding test case is located according to the current action, and the test case is used as the current use case, and then the test picture corresponding to the test control corresponding to the current action is extracted and started. test.
  • the extracted picture should also be the open picture of the corresponding current use case.
  • the method of loading and extracting the open screen is the same as the previous embodiment, that is, by extracting the URL address of the open screen and using the startup parameter specified by the current use case, opening in the specified system browser.
  • the initialization data of the test case is first set, that is, the data of the test case is initialized.
  • the so-called initialization operation of the data which may include: initializing the corresponding data in the database to avoid the previous test data legacy affecting the test, or adding corresponding initialization data in the database to form a test initialization Test the environment to ensure the uniformity of the environment at the beginning of the test.
  • test action when performing a new test action, it is first necessary to determine whether the test action is the first test action of a test case: if yes, the test case is required. The operation of initializing the data is performed first, and then the test action is performed; if not, the test action is directly executed.
  • the open screen of each test case is marked.
  • the corresponding test case is initialized with data, and then the test action corresponding to the open screen is executed.
  • step S1 after the test case is confirmed as the current use case, the initialization data of the current use case is extracted to start testing the current use case;
  • the address of the test screen corresponding to the first test control of the current use case is extracted as the open screen, and then the open screen is opened using the boot parameters specified by the current use case, and the test is performed.
  • the startup parameter refers to a standard network parameter that opens the above test screen as a start screen.
  • the step S2 includes: acquiring the number of the test screen corresponding to the subsequent test action of the current action, and monitoring the number of the display screen, the number of the display screen and the number of the test screen. When they match, confirm that the display screen is successfully switched to locate the display screen. Specifically, in the above step S2, if the number of the current display screen matches the number of the test screen corresponding to the subsequent operation of the current operation, it is considered that the current display screen is successfully switched, and the display screen is positioned as the subsequent action of the current action. Test screen.
  • the step S2 includes: acquiring the number of the subsequent test screen corresponding to the current action, and monitoring the number of the display screen, when the number of the display screen is consistent with the number of the test screen. , confirm that the display screen is successfully switched to locate the display screen. Specifically, in the above step S2, if the current display screen number matches the number of the subsequent screen of the current operation, the current display screen is considered to be successfully switched, and the display screen is positioned as the subsequent screen of the current operation.
  • step S4 before the operation of the control, the action attribute of the current action is first determined, and the current control is determined according to the action attribute:
  • the operation performed on the current control is to assign a value to the control, for example, a preset value is given to the control.
  • the operation performed on the current control is to execute the operation command to operate the control. For example, if the operation command is “click”, the operation of clicking the control may be performed on the current control.
  • the current control is operated by sending a corresponding function key combination command to the input device of the system, for example, the function key is combined into a "Shift” button on the combined input keyboard.
  • the "Alt” button and the “Enter” button the system can send a corresponding function key combination command to the keyboard to notify the keyboard to output the combined key command of the above three buttons.
  • the current control sends a corresponding text column message, and specifically, the corresponding text column message can be sent by the browser.
  • the assignment of the current control is saved in the system memory; specifically, the assignment of the current control or other specific values can be saved to the system memory, that is, the "clipboard" of the system memory is implemented.
  • the action attribute of the current action is a memory assignment
  • the value already saved in the system memory can be assigned to the current control according to the action attribute of the current action.
  • the action attribute of the current action is a logical judgment
  • the value saved in the memory may be judged, and the preset subsequent test action is skipped according to the judgment result.
  • the so-called logical judgment is to judge the expression indicating the value in the system memory, for example, whether the expression is greater than/less than a certain preset value, or whether the value stored in the system memory is true/false.
  • the above skipping scheme indicating the skip action can be preset in the test attribute of different test actions.
  • the specific judging process may be: determining an expression of the value stored in the system memory, and determining whether the preset skipping scheme needs to be executed according to the judging result to skip one or more subsequent testing actions.
  • the skipping scheme may also not include any subsequent actions, that is, no need to skip any subsequent actions regardless of the judgment result.
  • the display content of the browser can be monitored, thereby positioning a new picture number, and locating a new test control.
  • step S5 a comparison between the operation result and the expected result is performed according to the type of the operation result:
  • the system reads the information of the corresponding control included in the display screen in the browser, and compares the read information with the expected result; specifically, the control
  • the information is compared with the expected result
  • a batch of controls is uniformly compared, for example, the information corresponding to all the controls in the current display screen is captured, and compared with the expected result.
  • the system reads the corresponding column of data in the browser, and compares the read information with the expected result;
  • the system reads the data in the database and compares the read information with the expected result.
  • the preset setting interface of the foregoing expected result is as shown in FIG. 7-9:
  • the expected result of the controls in the picture is shown in Figure 7, which may include the ID of the control, the title of the control, the type of the expected result, and the value of the expected result.
  • the expected result of the table class is shown in FIG. 8, which may include attributes such as a control ID, a title of the control, a number of expected pieces, a number of comparison pieces, and table data.
  • the expected result of the database class is shown in FIG. 9, which may include attributes such as search conditions, sorting conditions, number of restrictions, and data.
  • the system reads the information of the corresponding control in the browser, and compares the read information with the expected result;
  • the system If it is a comparison of data in a column, the system reads the corresponding column of data in the browser, and compares the read information with the expected result;
  • the system reads the data in the specified database and compares the read information with the expected result.
  • step S5 it is determined whether the current action is successfully executed:
  • step S5 If yes, save the operation result associated with the current action, and then continue to perform step S5;
  • test of the current use case is ended and jumps to the next test case, and then returns to step S1.
  • step S5 If the current action is successfully executed, it naturally jumps to the next test action of the same current use case and executes (continues to step S5), and saves the result of the successful execution.
  • the display page of the browser ie, the page indicating the operation result
  • the control corresponding to the current action is marked in the screenshot.
  • the location (marked by the previous control positioning).
  • step S5 after saving the corresponding comparison result as the test result of the current action, the process jumps to the next test action:
  • step S5 after the corresponding comparison result is saved as the test result of the current action, the process jumps to the next test action.
  • the above automatic test method can be applied to any mainstream software system, because it is pre-guaranteed in a database that presets the above test cases, test actions, test controls, test screens, and the like.
  • the implementation of the driving method required in the mainstream software system ensures the driving of the action method in the mainstream software system.

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

An automatic testing method, relating to the technical field of software testing. The method comprises: selecting a test action from an action list as a current action and using a test case corresponding to the current action as a current case (S1); comparing a serial number of a display image in a system explorer with a serial number of a test image corresponding to the current action so as to perform positioning (S2); capturing, from the positioned display image, a test control matched with the current action as a current control (S3); operating, according to a corresponding operating method, the captured current control on the basis of an action attribute of the current action, and outputting an operating result corresponding to the current action (S4); and comparing the operating result with an anticipated result corresponding to the current action so as to determine whether the current action is executed successfully, and saving the corresponding comparison result as a test result of the current action (S5). The described technical solution has beneficial effects of achieving visualized automatic testing and rendering the test process more visual and efficient.

Description

一种自动测试方法An automatic test method 技术领域Technical field
本发明涉及软件测试技术领域,尤其涉及一种自动测试方法。The present invention relates to the field of software testing technologies, and in particular, to an automatic testing method.
背景技术Background technique
传统的软件测试技术存在着人工干预的阶段,测试人员需要手动设置测试用例以及其中包括的各种测试动作,并且手动运行测试,手动比对测试结果以及根据比对结果判断测试是否成功。换言之,在现有的软件测试技术中存在过多人工干预的步骤,因此会占用大量的人工资源,延长软件测试的时间,降低测试效率。The traditional software testing technology has a stage of manual intervention. The tester needs to manually set the test case and various test actions included therein, and manually run the test, manually compare the test results and judge whether the test is successful according to the comparison result. In other words, there are too many steps of manual intervention in the existing software testing technology, so it takes up a lot of artificial resources, prolongs the time of software testing, and reduces the testing efficiency.
同时,现有的软件测试技术中,其测试参数设置通常采用一些只有专业测试人员才能掌握的代码级设置来实现,因此导致测试设置比较复杂,要求测试人员具有相匹配的代码知识和技术才能对软件测试进行参数设置。At the same time, in the existing software testing technology, the test parameter setting is usually implemented by code level settings that only professional testers can master. Therefore, the test setup is complicated, and the tester is required to have matching code knowledge and technology. Software testing for parameter settings.
发明内容Summary of the invention
根据现有技术中存在的上述问题,现提供一种自动测试方法的技术方案,旨在实现测试的可视化自动进行,使得测试过程更直观更有效率,简化测试的操作。According to the above problems existing in the prior art, a technical solution of an automatic testing method is provided, which aims to realize automatic visualization of testing, making the testing process more intuitive and more efficient, and simplifying the testing operation.
上述技术方案具体包括:The above technical solutions specifically include:
一种自动测试方法,其中,按序预设多个测试用例,每个所述测试用例对应于多个按序执行的测试动作,每个所述测试动作对应于一个测试控件,每个所述测试动作对应于一个操作方法,每个所述测试控件对应一个测试画面,每个所述测试动作对应多个预想结果;An automatic testing method, wherein a plurality of test cases are preset in order, each of the test cases corresponding to a plurality of sequentially executed test actions, each of the test actions corresponding to one test control, each of the The test action corresponds to one operation method, each of the test controls corresponds to one test screen, and each of the test actions corresponds to a plurality of expected results;
将本次需要执行的所有所述测试用例对应的所有所述测试动作按照所述测试用例被执行的顺序排列形成一测试动作列表;All the test actions corresponding to all the test cases that need to be executed this time are arranged in the order in which the test cases are executed to form a test action list;
所述自动测试方法包括:The automatic test method includes:
步骤S1,于所述动作列表中选择一个所述测试动作作为当前动作,并将 所述当前动作对应的所述测试用例作为当前用例进行测试;Step S1, selecting one of the test actions as the current action in the action list, and The test case corresponding to the current action is tested as a current use case;
步骤S2,将测试过程中系统浏览器中的显示画面的编号,和所述当前动作对应的所述测试画面的编号进行比较,以对所述显示画面进行定位;Step S2, comparing the number of the display screen in the system browser during the test with the number of the test screen corresponding to the current action to locate the display screen;
步骤S3,于被定位的所述显示画面中抓取匹配于所述当前动作的所述测试控件作为当前控件;Step S3: grab the test control matching the current action as the current control in the displayed display screen;
步骤S4,根据所述当前动作的动作属性,依据对应的所述操作方法对被抓取的所述当前控件进行操作,随后输出对应所述当前动作的操作结果;Step S4, according to the action attribute of the current action, operating the captured current control according to the corresponding operation method, and then outputting an operation result corresponding to the current action;
步骤S5,将所述操作结果与对应所述当前动作的所述预想结果进行比较,以判断所述当前动作是否执行成功,将对应的比较结果保存为所述当前动作的测试结果。In step S5, the operation result is compared with the expected result corresponding to the current action to determine whether the current action is successfully executed, and the corresponding comparison result is saved as the test result of the current action.
优选的,该自动测试方法,其中,所述步骤S1中,在执行关联于所述当前用例的第一个所述测试动作时,提取对应于所述当前用例的第一个所述测试控件的所述测试画面作为开启画面,并通过关联于所述开启画面的地址打开所述开启画面,以开始对所述当前用例进行测试。Preferably, the automatic test method, in the step S1, extracting the first test control corresponding to the current use case when performing the first test action associated with the current use case The test screen is used as an open screen, and the open screen is opened by an address associated with the open screen to start testing the current use case.
优选的,该自动测试方法,其中,所述步骤S1中,在执行关联于所述当前用例的每个所述测试动作之前,根据所述测试动作的动作属性判断是否需要打开对应于所述测试动作的所述测试控件的所述测试画面,并在需要时提取关联于所述测试画面的地址以打开所述测试画面。Preferably, the automatic test method, in the step S1, before performing each of the test actions associated with the current use case, determining whether it is necessary to open the test corresponding to the test according to the action attribute of the test action The test screen of the test control of the action, and extracting an address associated with the test screen as needed to open the test screen.
优选的,该自动测试方法,其中,所述步骤S1中,当将所述测试用例确认为所述当前用例后提取所述当前用例的初始化数据,对关联于所述当前用例的数据库中的数据进行初始化操作,以开始对所述当前用例进行测试;Preferably, the automatic test method, in the step S1, extracting initialization data of the current use case after confirming the test case as the current use case, and data in a database associated with the current use case Performing an initialization operation to start testing the current use case;
提取对应于所述当前用例的第一个所述测试控件的所述测试画面的地址作为所述开启画面的开启地址,并基于所述开启地址,使用关联于所述当前用例的启动参数开启所述开启画面,以对所述启动画面进行测试。Extracting an address of the test screen corresponding to the first test control of the current use case as an open address of the open screen, and based on the open address, using a startup parameter associated with the current use case to open the location The screen is opened to test the startup screen.
优选的,该自动测试方法,其中,所述步骤S2具体包括:Preferably, the automatic testing method, wherein the step S2 specifically includes:
获取对应于所述当前动作的后续的所述测试动作的所述测试画面的编号,同时监控所述显示画面的编号,在所述显示画面的编号与所述测试画面的编号一致时,确认所述显示画面切换成功,以对所述显示画面进行定位。Obtaining a number of the test screen corresponding to the subsequent test action of the current action, and monitoring a number of the display screen, and confirming that when the number of the display screen matches the number of the test screen The display screen is successfully switched to locate the display screen.
优选的,该自动测试方法,其中,所述步骤S2具体包括:Preferably, the automatic testing method, wherein the step S2 specifically includes:
获取对应于所述当前动作的后续的所述测试画面的编号,同时监控所述 显示画面的编号,在所述显示画面的编号与所述测试画面的编号一致时,确认所述显示画面切换成功,以对所述显示画面进行定位。Obtaining a number of the subsequent test screen corresponding to the current action while monitoring the The number of the display screen is such that when the number of the display screen matches the number of the test screen, it is confirmed that the display screen is successfully switched to locate the display screen.
优选的,该自动测试方法,其中,所述步骤S3中,抓取到所述显示画面中的一个所述测试控件后,将所述测试控件的控件属性与所述当前动作对应的所述测试控件的控件属性进行匹配并得到匹配结果,并在所述匹配结果表示匹配成功时将被抓取的所述测试控件定位为所述当前控件。Preferably, the automatic test method, in the step S3, after capturing one of the test controls in the display screen, the test attribute corresponding to the test action and the test corresponding to the current action The control attributes of the control are matched and a matching result is obtained, and the test control that is captured is positioned as the current control when the matching result indicates that the matching is successful.
优选的,该自动测试方法,其中,所述步骤S4中,在对所述控件进行操作之前,首先判断所述当前动作的所述动作属性,并根据所述动作属性确定对所述当前控件进行操作:Preferably, the automatic test method, in the step S4, before the operation of the control, first determining the action attribute of the current action, and determining, according to the action attribute, the current control operating:
若所述当前动作的所述动作属性为设值,则对所述当前控件进行的操作为给所述控件赋值;If the action attribute of the current action is a set value, performing an operation on the current control to assign a value to the control;
若所述当前动作的所述动作属性为执行操作命令,则对所述当前控件进行的操作为执行所述操作命令以操作所述控件;If the action attribute of the current action is an execution operation command, performing an operation on the current control to execute the operation command to operate the control;
若所述当前动作的所述动作属性为发送文字列消息,则操作所述当前控件发送对应的所述文字列消息;If the action attribute of the current action is a send text column message, operating the current control to send the corresponding text column message;
若所述当前动作的所述动作属性为内存复制,则将所述当前控件的值保存于系统内存中;If the action attribute of the current action is memory copy, save the value of the current control in a system memory;
若所述当前动作的所述动作属性为内存赋值,则将所述当前控件的值更改为所述系统内存中保存的值;And if the action attribute of the current action is a memory assignment, changing a value of the current control to a value saved in the system memory;
若所述当前动作的所述动作属性为逻辑判断,则对保存于所述系统内存中用于表示赋值的表达式进行判断,并根据判断结果跳过关联于所述当前动作的预设的后续的所述测试动作;If the action attribute of the current action is a logical judgment, determining an expression stored in the system memory for indicating an assignment, and skipping a preset subsequent to the current action according to the determination result Said test action;
若所述当前动作的所述动作属性为采用功能键组合的方式进行操作,则通过向系统的输入装置发送对应的功能键组合命令的方式操作所述当前控件。If the action attribute of the current action is operated in a manner of combining function keys, the current control is operated by transmitting a corresponding function key combination command to an input device of the system.
优选的,该自动测试方法,其中,所述步骤S5中,根据所述操作结果的类型进行所述操作结果与所述预想结果之间的比较:Preferably, the automatic test method, in the step S5, performs a comparison between the operation result and the expected result according to the type of the operation result:
若所述操作结果为操作所述显示画面中包括的所述控件的结果,则系统读取所述浏览器中的所述显示画面对应的所述控件的信息,并将读取到的信息与所述预想结果进行比较; If the result of the operation is a result of operating the control included in the display screen, the system reads information of the control corresponding to the display screen in the browser, and reads the read information The expected results are compared;
若所述操作结果为对应于所述浏览器中的一栏数据的结果,则系统读取所述浏览器中对应的所述一栏数据,并将读取到的信息与所述预想结果进行比较;If the result of the operation is a result corresponding to a column of data in the browser, the system reads the corresponding column of data in the browser, and performs the read information with the expected result. Comparison
若所述操作结果为系统的数据库中的数据,则系统读取所述数据库中的数据,并读取到的信息与所述预想结果进行比较。If the result of the operation is data in a database of the system, the system reads the data in the database and compares the read information with the expected result.
优选的,该自动测试方法,其中,所述步骤S5中,判断所述当前动作是否执行成功:Preferably, the automatic test method, in the step S5, determining whether the current action is performed successfully:
若是,则保存关联于所述当前动作的所述操作结果,随后继续执行所述步骤S5;If yes, save the operation result associated with the current action, and then continue to perform the step S5;
若否,则结束所述当前用例的测试,并跳转至下一个所述测试用例,随后返回所述步骤S1。If not, the test of the current use case is ended and jumps to the next test case, and then returns to the step S1.
优选的,该自动测试方法,其中,所述步骤S5中,将对应的比较结果保存为所述当前动作的测试结果后,跳转至下一个所述测试动作:Preferably, the automatic test method, in the step S5, after saving the corresponding comparison result as the test result of the current action, jumping to the next test action:
若跳转至的下一个所述测试动作表示对全局的控件进行操作,则返回所述步骤S4。If the next test action jumped to indicates that the global control is operated, the process returns to step S4.
上述技术方案的有益效果是:提供一种自动测试方法,能够实现测试的可视化自动进行,使得测试过程更直观更有效率,简化测试的操作。The beneficial effects of the above technical solution are: providing an automatic test method, which can realize the automatic visualization of the test, making the test process more intuitive and more efficient, and simplifying the test operation.
附图说明DRAWINGS
图1是本发明的较佳的实施例中,一种自动测试方法的总体流程示意图;1 is a schematic overall flow chart of an automatic test method in a preferred embodiment of the present invention;
图2-3是本发明的较佳的实施例中,预设测试用例的示意图;2-3 is a schematic diagram of a preset test case in a preferred embodiment of the present invention;
图4是本发明的较佳的实施例中,预设画面的示意图;4 is a schematic diagram of a preset screen in a preferred embodiment of the present invention;
图5是本发明的较佳的实施例中,预设测试动作的示意图;Figure 5 is a schematic illustration of a preset test action in a preferred embodiment of the present invention;
图6是本发明的较佳的实施例中,预设控件的示意图;Figure 6 is a schematic diagram of a preset control in a preferred embodiment of the present invention;
图7-9是本发明的较佳的实施例中,不同的预想结果的示意图。7-9 are schematic illustrations of different contemplated results in a preferred embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作 出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is obvious that the described embodiments are only a part of the embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, those of ordinary skill in the art are not making All other embodiments obtained under the premise of creative labor are within the scope of the present invention.
需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。It should be noted that the embodiments in the present invention and the features in the embodiments may be combined with each other without conflict.
下面结合附图和具体实施例对本发明作进一步说明,但不作为本发明的限定。The invention is further illustrated by the following figures and specific examples, but is not to be construed as limiting.
本发明的较佳的实施例中,基于现有技术中存在的上述问题,现提供一种自动测试方法。该自动测试方法中,首先按序预设多个测试用例,每个测试用例对应于多个按序执行的测试动作,每个测试动作仅对应于一个测试控件,同时每个测试动作对应于一个操作方法,即针对一个控件,仅存在一种操作方法。每个测试控件对应于一个测试画面。每个测试动作对应多个预想结果;In a preferred embodiment of the present invention, an automatic test method is provided based on the above problems existing in the prior art. In the automatic test method, a plurality of test cases are first preset in sequence, and each test case corresponds to a plurality of test actions executed in sequence, each test action corresponds to only one test control, and each test action corresponds to one test action. The method of operation, that is, for one control, there is only one method of operation. Each test control corresponds to a test screen. Each test action corresponds to a plurality of expected results;
将本次需要执行的所有测试用例的所有测试动作按照测试用例被执行的顺序排列形成一测试动作列表;All test actions of all the test cases that need to be executed this time are arranged in the order in which the test cases are executed to form a test action list;
则如图1所示,上述自动测试方法的步骤具体包括:Then, as shown in FIG. 1 , the steps of the above automatic testing method specifically include:
步骤S1,于动作列表中选择一个测试动作作为当前动作,并将当前动作对应的测试用例作为当前用例进行测试;Step S1, selecting a test action as the current action in the action list, and testing the test case corresponding to the current action as the current use case;
步骤S2,将测试过程中系统浏览器中的显示画面的编号,和当前动作对应的测试画面的编号进行比较,以对显示画面进行定位;Step S2, comparing the number of the display screen in the system browser during the test with the number of the test screen corresponding to the current action to locate the display screen;
步骤S3,于被定位的显示画面中抓取匹配于当前动作的测试控件作为当前控件;Step S3, capturing a test control matching the current action as a current control in the displayed display screen;
步骤S4,根据当前动作的动作属性,依据对应的操作方法对被抓取的当前控件进行操作,随后输出对应当前动作的操作结果;Step S4, according to the action attribute of the current action, operating the captured current control according to the corresponding operation method, and then outputting the operation result corresponding to the current action;
步骤S5,将操作结果与对应当前动作的预想结果进行比较,以判断当前动作是否执行成功,将对应的比较结果保存为当前动作的测试结果。In step S5, the operation result is compared with the expected result of the current action to determine whether the current action is successfully executed, and the corresponding comparison result is saved as the test result of the current action.
在一个具体实施例中,首先预设多个测试用例,每个测试用例内包括多个测试动作,每个测试动作对应一个测试控件。每个测试控件对应一个测试画面,因此决定每个测试用例对应于多个测试画面。In a specific embodiment, a plurality of test cases are preset first, and each test case includes a plurality of test actions, and each test action corresponds to one test control. Each test control corresponds to one test screen, so it is decided that each test case corresponds to multiple test pictures.
具体地,上述测试用例是按序预设的,即按照一定的执行顺序预设多个测试用例,一个测试用例执行完毕后就转向执行下一个测试用例。同样地,在同一个测试用例中,不同的测试动作也按序排列,每个测试动作分别对应 于一个测试控件,每个测试控件分别对应于一个测试画面。上述测试画面可以被划分为开启画面以及后续画面。对于一个测试用例来说,开启画面只有一个,后续画面可以存在多个,上述开启画面可以为测试用例执行的第一个画面,后续画面为在上述开启画面之后并且依序排列的显示画面。每个测试画面(包括开启画面和后续画面)均为操作一个测试控件所对应的画面。例如对于用户登录这个测试用例而言,其中可以包括输入用户名和密码的测试动作,以及点击登录控件的测试动作。则对应上述登录控件的测试画面可以为提供给使用者可以输入用户名和密码的登录画面,并且该画面可以作为测试用例的开启画面,上述测试用例的多个后续画面可以为登录成功后显示的系统浏览器的其他画面,或者显示登录失败的画面。上述画面依照测试逻辑排序。Specifically, the test case is preset in order, that is, a plurality of test cases are preset according to a certain execution order, and after one test case is executed, the next test case is turned to execute. Similarly, in the same test case, different test actions are also arranged in order, and each test action corresponds to In a test control, each test control corresponds to a test screen. The above test screen can be divided into an open screen and a subsequent screen. For a test case, there is only one open screen, and there may be multiple subsequent screens. The open screen may be the first screen executed by the test case, and the subsequent screen is the display screen after the above-mentioned open screen and sequentially arranged. Each test screen (including the open screen and subsequent screens) is the screen corresponding to the operation of a test control. For example, for a user to log in to the test case, it may include a test action of entering a username and password, and a test action of clicking a login control. The test screen corresponding to the login control may be a login screen provided to the user for inputting a user name and a password, and the screen may be used as a startup screen of the test case, and the plurality of subsequent screens of the test case may be a system displayed after successful login. Other screens of the browser, or screens that failed to log in. The above pictures are sorted according to test logic.
上述实施例中,测试用例的设置界面如图2-3所示。该测试用例中的开启画面的名称为“账户信息”,该测试用例的名称为“进入修改账户密码界面”,该测试用例的前期关联测试用例为“进入账户信息界面”,相应地,该测试用例的前期关联测试用例还包括“登录”、“进入系统管理”和“进入账户信息界面”,上述前期关联测试用例依序排列。图2中所示的测试用例的设置界面为可视化界面,并非现有技术中代码级的设置界面,因此可以简化测试用例的设置过程。图3中示出了上述预设的测试用例列表。In the above embodiment, the setting interface of the test case is as shown in Figure 2-3. The name of the opening screen in the test case is “account information”, and the name of the test case is “Enter the modified account password interface”. The pre-association test case of the test case is “Enter Account Information Interface”, and accordingly, the test The pre-association test cases of the use cases also include "login", "enter system management" and "enter account information interface", and the above-mentioned pre-association test cases are arranged in order. The setting interface of the test case shown in FIG. 2 is a visual interface, which is not a code level setting interface in the prior art, so the setting process of the test case can be simplified. A list of the above-described preset test cases is shown in FIG.
上述实施例中,关联于测试用例的测试画面(包括开启画面和后续画面)的设置界面如图4所示。图4中的画面信息中包括画面序号(ID)、画面名称以及画面访问地址。所谓的访问地址是指URL(Uniform Resoure Locator,统一资源定位)地址。上述画面设置界面同样为可视化界面。In the above embodiment, the setting interface of the test screen (including the open screen and the subsequent screen) associated with the test case is as shown in FIG. 4 . The screen information in FIG. 4 includes a screen number (ID), a screen name, and a screen access address. The so-called access address refers to a URL (Uniform Resoure Locator) address. The above screen setting interface is also a visual interface.
上述实施例中,测试动作的设置界面如图5所示,图5中的测试动作可以配置为“嵌入检索条件”,其中关联有多个显示画面的名称、多个控件名称、多个动作属性(方法)以及多个测试动作的赋值等。上述测试动作的设置界面同样为可视化易操作的。In the above embodiment, the setting interface of the test action is as shown in FIG. 5, and the test action in FIG. 5 can be configured as “embedded search condition”, wherein the name of the plurality of display screens, multiple control names, and multiple action attributes are associated with each other. (method) and assignment of multiple test actions. The setting interface of the above test action is also visually easy to operate.
上述实施例中,每个测试动作对应的操作方法可以由动作属性经过一系列计算得到,而上述动作属性可以由对应的表达式表示。In the above embodiment, the operation method corresponding to each test action may be obtained by a series of calculations of the action attribute, and the action attribute may be represented by a corresponding expression.
上述实施例中,将设置完成的关联于不同的测试用例的测试动作形成一个动作列表。具体地,例如按序排列分别设置有测试用例A、B和C,在测 试用例A中按序排列分别设置有测试动作A1、A2和A3,在测试用例B中按序排列分别设置有测试动作B1和B2,在测试用例C中按序排列分别设置有测试动作C1、C2、C3和C4,则上述动作列表即可以为按序排列的A1、A2、A3、B1、B2、C1、C2、C3、C4。In the above embodiment, the set of test actions associated with different test cases is completed to form an action list. Specifically, for example, test cases A, B, and C are respectively arranged in order, and are measured. In Test Case A, test actions A1, A2, and A3 are respectively arranged in order, and test actions B1 and B2 are respectively arranged in the test case B, and test actions C1 are respectively arranged in the test case C. For C2, C3, and C4, the above action list may be A1, A2, A3, B1, B2, C1, C2, C3, and C4 arranged in order.
上述实施例中,每个测试动作相关联的控件的设置界面如图6所示。在图6中,每个控件的控件信息中包括控件序号(ID)、控件标题、控件类型、控件的前端技术、控件定位用的属性名称、控件定位用的属性值、控件的最大值/最小值/最大长度/最小长度、控件的默认值、控件的正确值列表/错误值列表等。上述控件的设置画面也是可视化画面。In the above embodiment, the setting interface of the control associated with each test action is as shown in FIG. 6. In Figure 6, the control information of each control includes the control serial number (ID), the control title, the control type, the front-end technology of the control, the attribute name used for the control positioning, the attribute value used for the control positioning, and the maximum/minimum of the control. Value/maximum length/minimum length, default value of the control, list of correct values for the control/list of error values, etc. The setting screen of the above control is also a visual screen.
上述实施例中,上述测试用例、测试动作、画面以及控件等的设置均可以依照以下两种方式进行:1)由系统预先设定;2)在系统中预先设定了各测试元素,则使用者可以通过相应的可视化界面选择不同的测试元素并组合形成测试用例、测试动作、画面以及控件等设置信息。In the above embodiment, the settings of the test cases, test actions, screens, and controls may be performed in the following two ways: 1) pre-set by the system; 2) pre-set each test element in the system, then use Different test elements can be selected through the corresponding visual interface and combined to form setting information such as test cases, test actions, pictures and controls.
上述实施例中所述的预想结果的设置界面在下文中会详述。The setting interface of the expected result described in the above embodiment will be described in detail below.
则上述实施例中,针对本次需要执行的所有测试用例,按照不同测试用例的排序,将其中包括的所有测试动作放置在一个动作列表中。In the above embodiment, all test cases included in the test case are placed in an action list according to the order of different test cases.
则上述步骤S1中,首先选择一个测试动作开始执行测试。具体地,针对该测试动作,可以确定相应的测试用例,并将被确定的测试用例作为当前用例开始测试。Then in the above step S1, first select a test action to start the test. Specifically, for the test action, the corresponding test case can be determined, and the determined test case is used as the current use case to start the test.
上述实施例中,在定位好当前动作和当前用例后,监控浏览器的显示画面的切换状态,找到浏览器当前加载完成的显示画面的画面编号,并将当前动作的测试画面的编号与该显示画面的编号进行对比,即根据当前的显示画面的画面编号去与对应当前动作的测试画面进行匹配,从而将当前浏览器的显示画面定位为当前用例中对应于当前动作的一个测试画面。In the above embodiment, after the current action and the current use case are located, the switching state of the display screen of the browser is monitored, the screen number of the display screen currently loaded by the browser is found, and the number of the test screen of the current action is displayed with the display. The number of the screen is compared, that is, the screen of the current display screen is matched with the test screen corresponding to the current motion, so that the display screen of the current browser is positioned as a test screen corresponding to the current motion in the current use case.
上述实施例中,在定位好显示画面后,对显示画面中的显示内容进行分分析,并抓取显示画面中的所有控件的实时信息,根据显示画面中抓取的控件的相关信息与测试动作对应的控件信息(例如定位用属性)进行匹配,从而可以定位准确的控件,并记录被定位的控件的位置信息。具体地,抓取到显示画面中的一个控件后,将控件的控件属性与当前动作对应的测试控件的控件属性进行匹配并得到匹配结果,并在匹配结果表示匹配成功时将被抓取 的控件定位为当前控件。例如,抓取到一个控件后,将该控件与测试动作所对应的测试控件进行比较:若不同,则表示不是当前动作的控件;若相同,则表示是当前动作的控件。随后将匹配成功的控件确认为当前控件。因此,上述定位控件的方式可以包括:首先采用测试动作所对应的测试控件定位到一个测试画面,该测试画面即为当前显示的显示画面。由于在显示画面中可能不仅仅包括一个控件,因此在该显示画面中还需要通过控件属性对比的方式定位到上述测试动作所对应的测试控件,以完成测试控件的定位。In the above embodiment, after the display screen is positioned, the display content in the display screen is analyzed, and real-time information of all the controls in the display screen is captured, according to related information and test actions of the control captured in the display screen. Corresponding control information (such as positioning properties) is matched so that accurate controls can be located and the position information of the positioned controls can be recorded. Specifically, after grabbing a control in the display screen, matching the control property of the control with the control property of the test control corresponding to the current action, and obtaining a matching result, and when the matching result indicates that the matching is successful, the matching will be performed. The control is positioned as the current control. For example, after grabbing a control, compare the control with the test control corresponding to the test action: if it is different, it means that the control is not the current action; if it is the same, it means the control of the current action. The successfully matched control is then confirmed as the current control. Therefore, the manner of positioning the control may include: firstly, using a test control corresponding to the test action to locate a test screen, where the test screen is the currently displayed display screen. Since the display screen may not only include one control, the test control corresponding to the above test action needs to be located in the display screen to complete the positioning of the test control.
上述实施例中,当定位到测试控件之后,可以根据当前动作的动作属性对该测试控件执行相应的操作,随后当前动作执行完毕,记录对应当前动作的操作结果。In the above embodiment, after the test control is located, the corresponding operation may be performed on the test control according to the action attribute of the current action, and then the current action is executed, and the operation result corresponding to the current action is recorded.
上述实施例中,得到操作结果后,将该操作结果与当前动作对应的预想结果进行比较,以判断当前动作是否操作成功,并记录比较结果。In the above embodiment, after the operation result is obtained, the operation result is compared with the expected result corresponding to the current action to determine whether the current action is successful, and the comparison result is recorded.
在上述过程执行完毕后,判断当前动作执行完毕,随后转向下一个测试动作,并返回上述步骤S1。After the execution of the above process is completed, it is judged that the current action is completed, and then the next test action is turned, and the above step S1 is returned.
综上所述,本发明技术方案中,通过可视化的操作方法,将预先设置测试用例、测试动作、测试控件、测试画面以及预想结果等测试参数的过程变得简单易懂,并且可以便捷地根据这些被设置好的测试参数自动进行可视化的软件测试,能够满足人们的软件测试需求,并且提升了软件测试的效率。In summary, in the technical solution of the present invention, the process of pre-setting test parameters such as test cases, test actions, test controls, test pictures, and expected results is easily understood by a visual operation method, and can be conveniently and conveniently These set of test parameters are automatically visualized by software testing to meet people's software testing needs and improve the efficiency of software testing.
本发明的一个较佳的实施例中,在上述步骤S1中,在执行关联于当前用例的每个测试动作之前,根据测试动作的动作属性判断是否需要打开对应于测试动作的测试控件的测试画面,并在需要时提取关联于测试画面的地址以打开测试画面。具体地,上述实施例中,在执行每个测试动作之前,都需要判断下是否需要加载该测试动作对应的测试控件的测试画面:若需要,则加载相应的测试画面;若不需要,则不对画面做任何变动。上述实施例中,上述测试画面的提取和加载是通过提取对应控件的对应画面的URL地址实现的。具体地,通过提取对应控件的对应画面相关的URL地址,使用当前用例指定的启动参数,并在浏览器中打开对应的URL地址,以对当前用例进行测试。若当前指定的浏览器已被打开,则只需要通过提取画面相关的URL地址来更新浏览器中的显示画面即可。并且,上述实施例中,所谓测试动作的动作属性,其中可以包括测试动作与其前后顺序的动作之间的关联关系。 系统可以通过判断测试动作与其前后动作的关系,然后判断是否需要提取相应的URL地址并打开相应的测试画面。In a preferred embodiment of the present invention, in the above step S1, before performing each test action associated with the current use case, it is determined according to the action attribute of the test action whether the test screen corresponding to the test action of the test action needs to be opened. And extract the address associated with the test screen as needed to open the test screen. Specifically, in the above embodiment, before performing each test action, it is required to determine whether the test screen of the test control corresponding to the test action needs to be loaded: if necessary, load the corresponding test screen; if not, it is not correct. Make any changes to the picture. In the above embodiment, the extraction and loading of the test screen is implemented by extracting the URL address of the corresponding screen of the corresponding control. Specifically, the current use case is tested by extracting the URL address associated with the corresponding picture of the corresponding control, using the startup parameter specified by the current use case, and opening the corresponding URL address in the browser. If the currently specified browser has been opened, it is only necessary to update the display screen in the browser by extracting the URL address associated with the screen. Moreover, in the above embodiment, the action attribute of the test action may include an association relationship between the test action and the action in the sequence. The system can judge the relationship between the test action and its front and rear actions, and then determine whether it is necessary to extract the corresponding URL address and open the corresponding test screen.
本发明的另一个较佳的实施例中,上述步骤S1中,在执行关联于当前用例的第一个测试动作时,提取对应于当前用例的第一个测试控件的测试画面作为开启画面,并通过关联于开启画面的地址打开开启画面,以开始对当前用例进行测试。具体地,上述实施例中,只有在执行一个测试用例中的第一个测试动作时,才加载该测试动作对应的测试控件的测试画面,以作为开启画面。具体地,在首次开始测试时,可以选择上述动作列表中的第一个测试动作并开始测试。则选择好测试动作后,将该测试动作作为当前动作,并根据当前动作定位到对应的测试用例,将该测试用例作为当前用例,随后提取该当前动作对应的测试控件对应的测试画面并开始进行测试。上述实施例中,由于首次开始测试时的测试动作为第一个测试动作,则上述被提取的画面应当也为相应的当前用例的开启画面。同样地,加载和提取开启画面的方法与上一个实施例相同,即通过提取开启画面的URL地址并使用当前用例指定的启动参数,在指定的系统浏览器中打开来实现。In another preferred embodiment of the present invention, in the step S1, when the first test action associated with the current use case is executed, the test screen corresponding to the first test control of the current use case is extracted as the open screen, and Open the open screen with the address associated with the open screen to begin testing the current use case. Specifically, in the above embodiment, the test screen of the test control corresponding to the test action is loaded as the open screen only when the first test action in one test case is executed. Specifically, when the test is started for the first time, the first test action in the above action list can be selected and the test can be started. After the test action is selected, the test action is taken as the current action, and the corresponding test case is located according to the current action, and the test case is used as the current use case, and then the test picture corresponding to the test control corresponding to the current action is extracted and started. test. In the above embodiment, since the test action when the test is started for the first time is the first test action, the extracted picture should also be the open picture of the corresponding current use case. Similarly, the method of loading and extracting the open screen is the same as the previous embodiment, that is, by extracting the URL address of the open screen and using the startup parameter specified by the current use case, opening in the specified system browser.
本发明的较佳的实施例中,在开始执行上述每个测试用例之前,首先设定该测试用例的初始化数据,即对测试用例的数据进行初始化操作。所谓对数据进行初始化操作,其中可以包括:对数据库中相应的数据做初始化处理,以避免之前的测试数据遗留影响本次测试,又或者在数据库中添加相应的初始化数据,以形成一个测试的初始化测试环境,保证测试开始的环境的统一性等。In a preferred embodiment of the present invention, before starting to execute each of the above test cases, the initialization data of the test case is first set, that is, the data of the test case is initialized. The so-called initialization operation of the data, which may include: initializing the corresponding data in the database to avoid the previous test data legacy affecting the test, or adding corresponding initialization data in the database to form a test initialization Test the environment to ensure the uniformity of the environment at the beginning of the test.
因此,在本发明的一个较佳的实施例中,在执行到一个新的测试动作时,首先需要判断该测试动作是否为某个测试用例的第一个测试动作:若是,则需要对测试用例先进行初始化数据的操作,随后再执行测试动作;若否,则直接执行该测试动作。Therefore, in a preferred embodiment of the present invention, when performing a new test action, it is first necessary to determine whether the test action is the first test action of a test case: if yes, the test case is required. The operation of initializing the data is performed first, and then the test action is performed; if not, the test action is directly executed.
又或者,在本发明的另一个较佳的实施例中,对每个测试用例的开启画面进行标记。在测试过程中,当跳转至一个开启画面时,则对相应的测试用例进行初始化数据的操作,随后再执行开启画面对应的测试动作。Still alternatively, in another preferred embodiment of the invention, the open screen of each test case is marked. During the test, when jumping to an open screen, the corresponding test case is initialized with data, and then the test action corresponding to the open screen is executed.
本发明的较佳的实施例中,上述步骤S1中,当将测试用例确认为当前用例后提取当前用例的初始化数据,以开始对当前用例进行测试; In a preferred embodiment of the present invention, in the above step S1, after the test case is confirmed as the current use case, the initialization data of the current use case is extracted to start testing the current use case;
提取对应于当前用例的第一个测试控件的测试画面的地址作为开启画面,随后使用当前用例指定的启动参数打开开启画面,并进行测试。The address of the test screen corresponding to the first test control of the current use case is extracted as the open screen, and then the open screen is opened using the boot parameters specified by the current use case, and the test is performed.
上述实施例中,所谓启动参数,是指打开上述作为开始画面的测试画面的标准网络参数。In the above embodiment, the startup parameter refers to a standard network parameter that opens the above test screen as a start screen.
本发明的一个较佳的实施例中,上述步骤S2具体包括:获取对应于当前动作的后续的测试动作的测试画面的编号,同时监控显示画面的编号,在显示画面的编号与测试画面的编号一致时,确认显示画面切换成功,以对显示画面进行定位。具体地,上述步骤S2中,若当前的显示画面的编号与当前动作的后续动作对应的测试画面的编号一致,则认为当前的显示画面切换成功,从而将该显示画面定位为当前动作的后续动作的测试画面。In a preferred embodiment of the present invention, the step S2 includes: acquiring the number of the test screen corresponding to the subsequent test action of the current action, and monitoring the number of the display screen, the number of the display screen and the number of the test screen. When they match, confirm that the display screen is successfully switched to locate the display screen. Specifically, in the above step S2, if the number of the current display screen matches the number of the test screen corresponding to the subsequent operation of the current operation, it is considered that the current display screen is successfully switched, and the display screen is positioned as the subsequent action of the current action. Test screen.
本发明的另一个较佳的实施例中,上述步骤S2具体包括:获取对应于当前动作的后续的测试画面的编号,同时监控显示画面的编号,在显示画面的编号与测试画面的编号一致时,确认显示画面切换成功,以对显示画面进行定位。具体地,上述步骤S2中,若当前的显示画面的编号与当前动作的后续画面的编号一致,则认为当前的显示画面切换成功,从而将该显示画面定位为当前动作的后续画面。In another preferred embodiment of the present invention, the step S2 includes: acquiring the number of the subsequent test screen corresponding to the current action, and monitoring the number of the display screen, when the number of the display screen is consistent with the number of the test screen. , confirm that the display screen is successfully switched to locate the display screen. Specifically, in the above step S2, if the current display screen number matches the number of the subsequent screen of the current operation, the current display screen is considered to be successfully switched, and the display screen is positioned as the subsequent screen of the current operation.
本发明的较佳的实施例中,上述步骤S4中,在对控件进行操作之前,首先判断当前动作的动作属性,并根据动作属性确定对当前控件进行操作:In a preferred embodiment of the present invention, in the above step S4, before the operation of the control, the action attribute of the current action is first determined, and the current control is determined according to the action attribute:
若当前动作的动作属性为设值,则对当前控件进行的操作为给控件赋值,例如对控件赋予一个预先设定的数值等。If the action attribute of the current action is a set value, the operation performed on the current control is to assign a value to the control, for example, a preset value is given to the control.
若当前动作的动作属性为执行操作命令,则对当前控件进行的操作为执行操作命令以操作控件,例如操作命令为“点击”,则可以对当前控件执行点击控件的操作。If the action attribute of the current action is an execution operation command, the operation performed on the current control is to execute the operation command to operate the control. For example, if the operation command is “click”, the operation of clicking the control may be performed on the current control.
若当前动作的动作属性为采用功能键组合的方式进行操作,则通过向系统的输入装置发送对应的功能键组合命令的方式操作当前控件,例如功能键组合为组合输入键盘上的“Shift”按键、“Alt”按键和“Enter”按键,则系统可以向键盘发送相应的功能键组合命令,以通知键盘输出上述三个按键的组合按键指令。If the action attribute of the current action is operated by a combination of function keys, the current control is operated by sending a corresponding function key combination command to the input device of the system, for example, the function key is combined into a "Shift" button on the combined input keyboard. The "Alt" button and the "Enter" button, the system can send a corresponding function key combination command to the keyboard to notify the keyboard to output the combined key command of the above three buttons.
若当前动作的动作属性为发送文字列消息,则操作当前控件发送对应的文字列消息,具体地可以通过浏览器发送对应的文字列消息。 If the action attribute of the current action is a send text column message, the current control sends a corresponding text column message, and specifically, the corresponding text column message can be sent by the browser.
若当前动作的动作属性为内存复制,则将当前控件的赋值保存于系统内存中;具体地,可以将当前控件的赋值或者其他特定值保存到系统内存中,即实现系统内存的“剪贴板”功能。If the action attribute of the current action is memory copy, the assignment of the current control is saved in the system memory; specifically, the assignment of the current control or other specific values can be saved to the system memory, that is, the "clipboard" of the system memory is implemented. Features.
若当前动作的动作属性为内存赋值,则可以根据当前动作的动作属性,将系统内存中已经保存的值赋到当前控件中。If the action attribute of the current action is a memory assignment, the value already saved in the system memory can be assigned to the current control according to the action attribute of the current action.
若当前动作的动作属性为逻辑判断,则可以对内存中保存的值进行判断,并根据判断结果跳过预设的后续的测试动作。具体地,所谓逻辑判断,其为对系统内存中表示赋值的表达式进行判断,例如判断该表达式是否大于/小于某个预设值,或者判断系统内存中保存的值是否为true/false。而上述表示跳过动作的跳过方案可以预设在不同的测试动作的测试属性中。具体的判断过程可以为:判断上述系统内存中保存的数值的表达式,并根据判断结果确定是否需要执行上述预设的跳过方案,来跳过一个或多个后续的测试动作。上述实施例中,上述跳过方案中同样可以不包括任何一个后续动作,即无论判断结果如何,都不需要跳过任何一个后续动作。If the action attribute of the current action is a logical judgment, the value saved in the memory may be judged, and the preset subsequent test action is skipped according to the judgment result. Specifically, the so-called logical judgment is to judge the expression indicating the value in the system memory, for example, whether the expression is greater than/less than a certain preset value, or whether the value stored in the system memory is true/false. The above skipping scheme indicating the skip action can be preset in the test attribute of different test actions. The specific judging process may be: determining an expression of the value stored in the system memory, and determining whether the preset skipping scheme needs to be executed according to the judging result to skip one or more subsequent testing actions. In the above embodiment, the skipping scheme may also not include any subsequent actions, that is, no need to skip any subsequent actions regardless of the judgment result.
本发明的较佳的实施例中,如上文中所述,若当前的画面发生跳转,则可以监控浏览器的显示内容,进而定位到新的画面编号,以及定位到新的测试控件。In a preferred embodiment of the present invention, as described above, if a jump occurs in the current picture, the display content of the browser can be monitored, thereby positioning a new picture number, and locating a new test control.
本发明的较佳的实施例中,上述步骤S5中,根据操作结果的类型进行操作结果与预想结果之间的比较:In a preferred embodiment of the present invention, in the above step S5, a comparison between the operation result and the expected result is performed according to the type of the operation result:
若操作结果为操作显示画面的控件的结果,则系统读取浏览器中的显示画面中包括的对应的控件的信息,并将读取到的信息与预想结果进行比较;具体地,在对控件的信息和预想结果进行比较时,是对一批控件进行统一比较,例如抓取当前的显示画面中的所有控件对应的信息,并分别与预想结果进行比较。If the result of the operation is the result of the control of the operation display screen, the system reads the information of the corresponding control included in the display screen in the browser, and compares the read information with the expected result; specifically, the control When the information is compared with the expected result, a batch of controls is uniformly compared, for example, the information corresponding to all the controls in the current display screen is captured, and compared with the expected result.
若操作结果为对应于浏览器中的一栏数据的结果,则系统读取浏览器中对应的一栏数据,并将读取到的信息与预想结果进行比较;If the result of the operation is a result corresponding to a column of data in the browser, the system reads the corresponding column of data in the browser, and compares the read information with the expected result;
若操作结果为系统的数据库中的数据,则系统读取数据库中的数据,并读取到的信息与预想结果进行比较。If the result of the operation is data in the database of the system, the system reads the data in the database and compares the read information with the expected result.
具体地,本发明的较佳的实施例中,上述预想结果预先设置的设置界面如图7-9所示: Specifically, in the preferred embodiment of the present invention, the preset setting interface of the foregoing expected result is as shown in FIG. 7-9:
图7中示出画面中控件的预想结果,其中可以包括控件的ID,控件标题,预想结果的类型以及预想结果的值。The expected result of the controls in the picture is shown in Figure 7, which may include the ID of the control, the title of the control, the type of the expected result, and the value of the expected result.
图8中示出表格类的预想结果,其中可以包括控件ID、控件的标题,预想件数、比较件数以及表格数据等属性。The expected result of the table class is shown in FIG. 8, which may include attributes such as a control ID, a title of the control, a number of expected pieces, a number of comparison pieces, and table data.
图9中示出了数据库类的预想结果,其中可以包括检索条件、排序条件、限制条数以及数据等属性。The expected result of the database class is shown in FIG. 9, which may include attributes such as search conditions, sorting conditions, number of restrictions, and data.
则本发明的较佳的实施例中:In a preferred embodiment of the invention:
若为控件比较,则系统读取浏览器中对应控件的信息,并将读取到的信息与预想结果进行比较;If the control is compared, the system reads the information of the corresponding control in the browser, and compares the read information with the expected result;
若为一栏数据的比较,则系统读取浏览器中对应的一栏数据,并将读取到的信息与预想结果进行比较;If it is a comparison of data in a column, the system reads the corresponding column of data in the browser, and compares the read information with the expected result;
若为数据库的比较,则系统读取指定的数据库中的数据,并将读取到的信息与预想结果进行比较。If the database is compared, the system reads the data in the specified database and compares the read information with the expected result.
本发明的较佳的实施例中,上述步骤S5中,判断当前动作是否执行成功:In a preferred embodiment of the present invention, in the above step S5, it is determined whether the current action is successfully executed:
若是,则保存关联于当前动作的操作结果,随后继续执行步骤S5;If yes, save the operation result associated with the current action, and then continue to perform step S5;
若否,则结束当前用例的测试,并跳转至下一个测试用例,随后返回步骤S1。If not, the test of the current use case is ended and jumps to the next test case, and then returns to step S1.
具体地,本发明的较佳的实施例中:Specifically, in a preferred embodiment of the invention:
若当前动作执行成功,则自然跳转到同一个当前用例的下一个测试动作并执行(继续执行步骤S5),同时保存执行成功的操作结果。If the current action is successfully executed, it naturally jumps to the next test action of the same current use case and executes (continues to step S5), and saves the result of the successful execution.
若当前动作执行失败,则结束当前用例的测试,并跳转至下一个测试用例执行(返回步骤S1),在动作列表中即为跳过当前用例对应的后续的测试动作,从下一个测试用例的第一个测试动作重新开始进行测试。If the current action execution fails, the test of the current use case is ended, and the jump to the next test case execution (return to step S1), in the action list, the subsequent test action corresponding to the current use case is skipped, from the next test case. The first test action is restarted.
本发明的较佳的实施例中,在一个当前动作的操作结果完成时,可以对浏览器的显示页面(即表示操作结果的页面)进行截图保存,并且在截图中标注出当前动作对应的控件的位置(通过之前的控件定位进行标注)。In a preferred embodiment of the present invention, when the operation result of a current action is completed, the display page of the browser (ie, the page indicating the operation result) may be saved as a screenshot, and the control corresponding to the current action is marked in the screenshot. The location (marked by the previous control positioning).
本发明的一个较佳的实施例中,上述步骤S5中,将对应的比较结果保存为当前动作的测试结果后,跳转至下一个测试动作:In a preferred embodiment of the present invention, in the above step S5, after saving the corresponding comparison result as the test result of the current action, the process jumps to the next test action:
若跳转至的下一个测试动作表示对全局的控件进行操作,则返回步骤 S4。If the next test action to jump to means to operate on the global control, return to the step S4.
本发明的一个较佳的实施例中,上述步骤S5中,将对应的比较结果保存为当前动作的测试结果后,跳转至下一个测试动作。In a preferred embodiment of the present invention, in the above step S5, after the corresponding comparison result is saved as the test result of the current action, the process jumps to the next test action.
本发明的较佳的实施例中,上述自动测试方法可以适用于任何一个主流的软件系统中,这是因为在预设上述测试用例、测试动作、测试控件、测试画面等的数据库中预先保证了主流软件系统中需要用到的驱动方法的实现方式,从而保证了主流软件系统中的动作方法的驱动。In a preferred embodiment of the present invention, the above automatic test method can be applied to any mainstream software system, because it is pre-guaranteed in a database that presets the above test cases, test actions, test controls, test screens, and the like. The implementation of the driving method required in the mainstream software system ensures the driving of the action method in the mainstream software system.
以上所述仅为本发明较佳的实施例,并非因此限制本发明的实施方式及保护范围,对于本领域技术人员而言,应当能够意识到凡运用本发明说明书及图示内容所作出的等同替换和显而易见的变化所得到的方案,均应当包含在本发明的保护范围内。 The above is only a preferred embodiment of the present invention, and is not intended to limit the scope of the embodiments and the scope of the present invention, and those skilled in the art should be able to Alternatives and obvious variations are intended to be included within the scope of the invention.

Claims (11)

  1. 一种可视化测试报告生成方法,其特征在于,按序预设多个测试用例,每个所述测试用例对应于多个按序执行的测试动作,每个所述测试动作对应于一个测试控件,每个所述测试动作对应于一个操作方法,每个所述测试控件对应一个测试画面,每个所述测试动作对应多个预想结果;A method for generating a visual test report, wherein a plurality of test cases are preset in sequence, each of the test cases corresponding to a plurality of test actions executed in sequence, each of the test actions corresponding to one test control, Each of the test actions corresponds to one operation method, each of the test controls corresponds to one test screen, and each of the test actions corresponds to a plurality of expected results;
    将本次需要执行的所有所述测试用例对应的所有所述测试动作按照所述测试用例被执行的顺序排列形成一测试动作列表;All the test actions corresponding to all the test cases that need to be executed this time are arranged in the order in which the test cases are executed to form a test action list;
    所述可视化测试报告生成方法包括:The method for generating a visual test report includes:
    步骤S1,于所述动作列表中选择一个所述测试动作作为当前动作,并将所述当前动作对应的所述测试用例作为当前用例进行测试;Step S1, selecting one of the test actions as the current action in the action list, and testing the test case corresponding to the current action as a current use case;
    步骤S2,将测试过程中系统浏览器中的显示画面的编号,和所述当前动作对应的所述测试画面的编号进行比较,以对所述显示画面进行定位;Step S2, comparing the number of the display screen in the system browser during the test with the number of the test screen corresponding to the current action to locate the display screen;
    步骤S3,于被定位的所述显示画面中抓取匹配于所述当前动作的所述测试控件作为当前控件;Step S3: grab the test control matching the current action as the current control in the displayed display screen;
    步骤S4,根据所述当前动作的动作属性,依据对应的所述操作方法对被抓取的所述当前控件进行操作,随后输出对应所述当前动作的操作结果;Step S4, according to the action attribute of the current action, operating the captured current control according to the corresponding operation method, and then outputting an operation result corresponding to the current action;
    步骤S5,将所述操作结果与对应所述当前动作的所述预想结果进行比较,以判断所述当前动作是否执行成功,将对应的比较结果保存为所述当前动作的测试结果。In step S5, the operation result is compared with the expected result corresponding to the current action to determine whether the current action is successfully executed, and the corresponding comparison result is saved as the test result of the current action.
  2. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S1中,在执行关联于所述当前用例的第一个所述测试动作时,提取对应于所述当前用例的第一个所述测试控件的所述测试画面作为开启画面,并通过关联于所述开启画面的地址打开所述开启画面,以开始对所述当前用例进行测试。The method for generating a visual test report according to claim 1, wherein in the step S1, when the first test action associated with the current use case is executed, the first corresponding to the current use case is extracted. The test screen of one of the test controls serves as an open screen, and the open screen is opened by an address associated with the open screen to start testing the current use case.
  3. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S1中,在执行关联于所述当前用例的每个所述测试动作之前,根据所述测试动作的动作属性判断是否需要打开对应于所述测试动作的所述测试控件的所述测试画面,并在需要时提取关联于所述测试画面的地址以打开所述测试画面。 The method for generating a visual test report according to claim 1, wherein in step S1, before performing each of the test actions associated with the current use case, determining whether or not based on the action attribute of the test action The test screen corresponding to the test control of the test action needs to be opened, and an address associated with the test screen is extracted as needed to open the test screen.
  4. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S1中,当将所述测试用例确认为所述当前用例后提取所述当前用例的初始化数据,对关联于所述当前用例的数据库中的数据进行初始化操作,以开始对所述当前用例进行测试;The method for generating a visual test report according to claim 1, wherein in the step S1, after the test case is confirmed as the current use case, the initialization data of the current use case is extracted, and the pair is associated with the The data in the database of the current use case is initialized to start testing the current use case;
    提取对应于所述当前用例的第一个所述测试控件的所述测试画面的地址作为所述开启画面的开启地址,并基于所述开启地址,使用关联于所述当前用例的启动参数开启所述开启画面,以对所述启动画面进行测试。Extracting an address of the test screen corresponding to the first test control of the current use case as an open address of the open screen, and based on the open address, using a startup parameter associated with the current use case to open the location The screen is opened to test the startup screen.
  5. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S2具体包括:The method for generating a visual test report according to claim 1, wherein the step S2 specifically includes:
    获取对应于所述当前动作的后续的所述测试动作的所述测试画面的编号,同时监控所述显示画面的编号,在所述显示画面的编号与所述测试画面的编号一致时,确认所述显示画面切换成功,以对所述显示画面进行定位。Obtaining a number of the test screen corresponding to the subsequent test action of the current action, and monitoring a number of the display screen, and confirming that when the number of the display screen matches the number of the test screen The display screen is successfully switched to locate the display screen.
  6. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S2具体包括:The method for generating a visual test report according to claim 1, wherein the step S2 specifically includes:
    获取对应于所述当前动作的后续的所述测试画面的编号,同时监控所述显示画面的编号,在所述显示画面的编号与所述测试画面的编号一致时,确认所述显示画面切换成功,以对所述显示画面进行定位。Obtaining a number of the test screen corresponding to the current action, and monitoring the number of the display screen, and confirming that the display screen is successfully switched when the number of the display screen matches the number of the test screen To locate the display screen.
  7. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S3中,抓取到所述显示画面中的一个所述测试控件后,将所述测试控件的控件属性与所述当前动作对应的所述测试控件的控件属性进行匹配并得到匹配结果,并在所述匹配结果表示匹配成功时将被抓取的所述测试控件定位为所述当前控件。The method for generating a visual test report according to claim 1, wherein in step S3, after capturing one of the test controls in the display screen, the control attribute of the test control is The control attributes of the test control corresponding to the current action are matched and a matching result is obtained, and the test control that is captured is positioned as the current control when the matching result indicates that the matching is successful.
  8. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S4中,在对所述控件进行操作之前,首先判断所述当前动作的所述动作属性,并根据所述动作属性确定对所述当前控件进行操作:The method for generating a visual test report according to claim 1, wherein in the step S4, before the operation of the control, first determining the action attribute of the current action, and according to the action attribute Make sure to operate on the current control:
    若所述当前动作的所述动作属性为设值,则对所述当前控件进行的操作为给所述控件赋值;If the action attribute of the current action is a set value, performing an operation on the current control to assign a value to the control;
    若所述当前动作的所述动作属性为执行操作命令,则对所述当前控件进行的操作为执行所述操作命令以操作所述控件;If the action attribute of the current action is an execution operation command, performing an operation on the current control to execute the operation command to operate the control;
    若所述当前动作的所述动作属性为发送文字列消息,则操作所述当前控 件发送对应的所述文字列消息;If the action attribute of the current action is a send text column message, operating the current control Sending the corresponding text column message;
    若所述当前动作的所述动作属性为内存复制,则将所述当前控件的值保存于系统内存中;If the action attribute of the current action is memory copy, save the value of the current control in a system memory;
    若所述当前动作的所述动作属性为内存赋值,则将所述当前控件的值更改为所述系统内存中保存的值;And if the action attribute of the current action is a memory assignment, changing a value of the current control to a value saved in the system memory;
    若所述当前动作的所述动作属性为逻辑判断,则对保存于所述系统内存中用于表示赋值的表达式进行判断,并根据判断结果跳过关联于所述当前动作的预设的后续的所述测试动作;If the action attribute of the current action is a logical judgment, determining an expression stored in the system memory for indicating an assignment, and skipping a preset subsequent to the current action according to the determination result Said test action;
    若所述当前动作的所述动作属性为采用功能键组合的方式进行操作,则通过向系统的输入装置发送对应的功能键组合命令的方式操作所述当前控件。If the action attribute of the current action is operated in a manner of combining function keys, the current control is operated by transmitting a corresponding function key combination command to an input device of the system.
  9. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S5中,根据所述操作结果的类型进行所述操作结果与所述预想结果之间的比较:The method for generating a visual test report according to claim 1, wherein in the step S5, a comparison between the operation result and the expected result is performed according to the type of the operation result:
    若所述操作结果为操作所述显示画面中包括的所述控件的结果,则系统读取所述浏览器中的所述显示画面对应的所述控件的信息,并将读取到的信息与所述预想结果进行比较;If the result of the operation is a result of operating the control included in the display screen, the system reads information of the control corresponding to the display screen in the browser, and reads the read information The expected results are compared;
    若所述操作结果为对应于所述浏览器中的一栏数据的结果,则系统读取所述浏览器中对应的所述一栏数据,并将读取到的信息与所述预想结果进行比较;If the result of the operation is a result corresponding to a column of data in the browser, the system reads the corresponding column of data in the browser, and performs the read information with the expected result. Comparison
    若所述操作结果为系统的数据库中的数据,则系统读取所述数据库中的数据,并读取到的信息与所述预想结果进行比较。If the result of the operation is data in a database of the system, the system reads the data in the database and compares the read information with the expected result.
  10. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S5中,判断所述当前动作是否执行成功:The method for generating a visual test report according to claim 1, wherein in the step S5, it is determined whether the current action is successfully executed:
    若是,则保存关联于所述当前动作的所述操作结果,随后继续执行所述步骤S5;If yes, save the operation result associated with the current action, and then continue to perform the step S5;
    若否,则结束所述当前用例的测试,并跳转至下一个所述测试用例,随后返回所述步骤S1。If not, the test of the current use case is ended and jumps to the next test case, and then returns to the step S1.
  11. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S5中,将对应的比较结果保存为所述当前动作的测试结果后,跳转至 下一个所述测试动作:The method for generating a visual test report according to claim 1, wherein in the step S5, after the corresponding comparison result is saved as the test result of the current action, the jump to The next test action:
    若跳转至的下一个所述测试动作表示对全局的控件进行操作,则返回所述步骤S4。 If the next test action jumped to indicates that the global control is operated, the process returns to step S4.
PCT/CN2017/098686 2016-08-26 2017-08-23 Automatic testing method WO2018036528A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610735528.2A CN107741900B (en) 2016-08-26 2016-08-26 A kind of automatic test approach
CN201610735528.2 2016-08-26

Publications (1)

Publication Number Publication Date
WO2018036528A1 true WO2018036528A1 (en) 2018-03-01

Family

ID=61234964

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/098686 WO2018036528A1 (en) 2016-08-26 2017-08-23 Automatic testing method

Country Status (2)

Country Link
CN (1) CN107741900B (en)
WO (1) WO2018036528A1 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111605724A (en) * 2020-05-22 2020-09-01 成都飞机工业(集团)有限责任公司 Simulation test method for atmospheric data system

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108763075A (en) * 2018-05-21 2018-11-06 北京五八信息技术有限公司 A kind of test method, device, equipment and computer readable storage medium

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1601483A (en) * 2004-10-22 2005-03-30 中国工商银行 Automation software testing system based on script explanatory tool
CN1851667A (en) * 2006-02-15 2006-10-25 华为技术有限公司 Graphic user interface test method and system
CN101187894A (en) * 2006-11-15 2008-05-28 中兴通讯股份有限公司 Automatic test method based on key word drive and its test system
US20100333073A1 (en) * 2009-06-29 2010-12-30 Honeywell International Inc. Systems and methods for automated generation of software tests based on modeling the software test domain
CN103502952A (en) * 2011-03-08 2014-01-08 惠普发展公司,有限责任合伙企业 Creating a test case
CN104794050A (en) * 2014-01-21 2015-07-22 腾讯科技(深圳)有限公司 Application program test method, device and system

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8984340B2 (en) * 2012-01-31 2015-03-17 Bank Of America Corporation System and method for test case generation using action keywords
CN103617118B (en) * 2013-11-28 2016-06-29 北京奇虎科技有限公司 The method that is uniformly processed of test result, Apparatus and system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1601483A (en) * 2004-10-22 2005-03-30 中国工商银行 Automation software testing system based on script explanatory tool
CN1851667A (en) * 2006-02-15 2006-10-25 华为技术有限公司 Graphic user interface test method and system
CN101187894A (en) * 2006-11-15 2008-05-28 中兴通讯股份有限公司 Automatic test method based on key word drive and its test system
US20100333073A1 (en) * 2009-06-29 2010-12-30 Honeywell International Inc. Systems and methods for automated generation of software tests based on modeling the software test domain
CN103502952A (en) * 2011-03-08 2014-01-08 惠普发展公司,有限责任合伙企业 Creating a test case
CN104794050A (en) * 2014-01-21 2015-07-22 腾讯科技(深圳)有限公司 Application program test method, device and system

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111605724A (en) * 2020-05-22 2020-09-01 成都飞机工业(集团)有限责任公司 Simulation test method for atmospheric data system
CN111605724B (en) * 2020-05-22 2022-08-12 成都飞机工业(集团)有限责任公司 Simulation test method for atmospheric data system

Also Published As

Publication number Publication date
CN107741900A (en) 2018-02-27
CN107741900B (en) 2019-09-17

Similar Documents

Publication Publication Date Title
WO2018036531A1 (en) Test case generation method
WO2018036529A1 (en) Method for generating visual test report
EP2245551B1 (en) Identification of elements of currently-executing component script
CN111026645B (en) User interface automatic test method and device, storage medium and electronic equipment
CN111240973B (en) Equipment testing method and system based on simulation and readable storage medium
CN106126414B (en) Application software testing method and system
JP2011060052A (en) Method for executing software test
EP2842038A1 (en) Software defect verification
JP2006268666A (en) Automatic test system with correction function, automatic test method, and program
WO2018036528A1 (en) Automatic testing method
CN107450953B (en) Method and device for updating BIOS
US9471472B2 (en) Method and system for entering information
WO2018036530A1 (en) Method for generating test design book
JPWO2014049854A1 (en) Computer system and program
JP6434435B2 (en) Information processing apparatus, operation support method, and operation support program
JP4941674B2 (en) Simulation system
JP2009223743A (en) Fault analysis support system and fault analysis support method
CN115576756A (en) Server testing method and device, electronic equipment and medium
TWI650710B (en) Test process detection method
CN109359042B (en) Automatic testing method based on path search algorithm
JP5325931B2 (en) Impact analysis method and impact analysis program
CN113225717B (en) Control method and device of Bluetooth equipment and computer readable storage medium
US20080162063A1 (en) Vehicle Quality Analyzing System and Program File Management Method
JP2011048714A (en) Test support method and test support apparatus
CN111913751B (en) Method for changing setting of basic input output system

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17842950

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17842950

Country of ref document: EP

Kind code of ref document: A1