WO2018036529A1 - 一种可视化测试报告生成方法 - Google Patents

一种可视化测试报告生成方法 Download PDF

Info

Publication number
WO2018036529A1
WO2018036529A1 PCT/CN2017/098687 CN2017098687W WO2018036529A1 WO 2018036529 A1 WO2018036529 A1 WO 2018036529A1 CN 2017098687 W CN2017098687 W CN 2017098687W WO 2018036529 A1 WO2018036529 A1 WO 2018036529A1
Authority
WO
WIPO (PCT)
Prior art keywords
test
action
current
screen
control
Prior art date
Application number
PCT/CN2017/098687
Other languages
English (en)
French (fr)
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 WO2018036529A1 publication Critical patent/WO2018036529A1/zh

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
    • 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
    • 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

Definitions

  • the present invention relates to the field of software testing technologies, and in particular, to a method for generating a visual test report.
  • 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.
  • test reports that are automatically generated after the test is completed are usually.
  • a technical solution for generating a visual test report which aims to realize automatic visualization of the test, making the test process more intuitive and efficient, and simplifying the test operation.
  • a visual test report generation 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 The test action corresponds to an 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 method for generating a visual test report includes:
  • 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;
  • 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 comparing the operation result with the expected result corresponding to the current action, to determine whether the current action is successfully executed, and saving the corresponding comparison result as the test result of the current action;
  • Step S6 after all the test cases are tested, respectively obtaining the operation result and the expected result of each of the test actions in each of the test cases and filling in a test report;
  • step S7 the test report is displayed on a report screen, and then exits.
  • the visual test report generation method is configured to separately set a first setting content for each of the test cases and a second setting for each of the test actions before performing the test.
  • Content, and all the test cases that need to be executed this time are arranged into a test case list, and each of the test case lists corresponds to one test case;
  • Each of the first setting contents respectively includes a test attribute in the corresponding test case
  • Each of the second setting contents respectively includes a test attribute of the corresponding test action
  • the step S6 specifically includes:
  • Step S61 selecting the first test case in the test case list as a report use case
  • Step S62 filling the first setting content associated with the report use case into the test report
  • Step S63 selecting the first test action in the test action list as a report action
  • Step S64 filling the second setting content, the operation result and the expected result associated with the reporting action into the test report respectively;
  • Step S65 turning to the next test action in the test action list, and determining whether the next test action corresponds to the new test case in the test case list:
  • the visual test report generating method is configured, wherein in the step S64, the initialization data associated with the report use case is filled into the test report while filling the first set content.
  • the visual test report generating method in the step S1, extracting the first test corresponding to the current use case when performing the first test action associated with the current use case
  • the test screen of the control 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.
  • the method for generating a visual test report wherein, 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 corresponding action according to the action attribute of the test action
  • the test screen of the test control of the test action is described, and an address associated with the test screen is extracted as needed to open the test screen.
  • the visual test report generating method in the step S1, extracting initialization data of the current use case after confirming the test case as the current use case, in a database associated with the current use case The data is initialized to begin testing the current use case;
  • the screen is opened to test the startup screen.
  • the method for generating a visual test report wherein the step S2 specifically includes:
  • the method for generating a visual test report 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 visual test report generating method in the step S3, after capturing one of the test controls in the display screen, the control attribute of the test control is corresponding to the current action
  • the control attributes of the test control are matched and the 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 visual test report generating 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
  • the control operates:
  • 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 visual test report generating method in the step S5, performing 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 visual test report generating method in the step S5, determining whether the current action is executed successfully:
  • test of the current use case is ended and jumps to the next test case, and then returns to the step S1.
  • the visual test report generating 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 a visual test report generation 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 a method for generating a visual test report in a preferred embodiment of the present invention
  • FIG. 2 is a schematic diagram of a specific process of a method for generating a visual test report in a preferred embodiment of the present invention
  • 3-4 are schematic diagrams showing preset test cases in a preferred embodiment of the present invention.
  • Figure 5 is a schematic diagram of a preset screen in a preferred embodiment of the present invention.
  • FIG. 6 is a schematic diagram of a preset test action in a preferred embodiment of the present invention.
  • Figure 7 is a schematic diagram of a preset control in a preferred embodiment of the present invention.
  • a method for generating a visual test report is provided.
  • the visual test report generation method first, a plurality of test cases are preset in sequence, and each test case corresponds to a plurality of test actions executed in sequence, and each test action corresponds to only one test control, and each test action corresponds to each test action.
  • one operation method that is, for one control, there is only one operation method.
  • 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 foregoing visual test report generation 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;
  • Step S6 after all the test cases are tested, respectively obtain the operation result and the expected result of each test action in each test case and fill in a test report;
  • step S7 the test report is displayed on a report screen, and then exits.
  • 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 one test control, and each test control corresponds to one test picture.
  • 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 3-4.
  • 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. 5.
  • the screen information in FIG. 5 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. 6, and the test action in FIG. 6 is It is configured as an "embedded search condition" in which a plurality of display screen names, a plurality of control names, a plurality of action attributes (methods), and assignment of a plurality of test actions are associated.
  • 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.
  • the set of test actions associated with different test cases is completed to form an action list.
  • test cases A, B, and C are respectively arranged in order
  • test actions A1, A2, and A3 are respectively arranged in order in test case A
  • test actions are respectively set in order in test case B.
  • B1 and B2 in which test actions C1, C2, C3, and C4 are respectively arranged in the test case C
  • the above action list may be sequentially arranged A1, A2, A3, B1, B2, C1, C2. C3, C4.
  • the setting interface of the control associated with each test action is as shown in FIG. 7.
  • 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, according to the screen number of the current display screen, the test screen corresponding to the current action is matched, thereby the current browser
  • the display screen 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 result is displayed when the matching result indicates that the matching is successful. Position 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.
  • step S6 After the process of step S1 to step S5 is completed, the next test action can be directly turned to, and the process returns to step S1, and the process of generating the test report (step S6) can be performed after the test is completed. That is, after all test cases have been tested.
  • step S6 after all the test cases are tested, the operation result and the expected result of each test action in each test case can be separately obtained and filled in a test report, and The test report is displayed on a report screen.
  • test parameters such as test cases, test actions, test controls, test pictures, and expected results
  • a visual operation method can be conveniently and conveniently
  • These set test parameters are automatically visualized by software testing, which can meet people's software testing requirements and improve the efficiency of software testing.
  • the test results are also visually displayed in the test report.
  • a first setting content is set for each test case, and a second setting content is respectively set for each test action, and this time All test cases that need to be executed are arranged to form a test case list, and each test case list corresponds to one test case;
  • Each first setting content includes a test attribute in a corresponding test case
  • Each of the second setting contents respectively includes a test attribute of the corresponding test action
  • the test attribute of the test case in the first setting content may include information such as a use case attribute, a use case name, and a test purpose of the test case.
  • the test attribute of the test action in the second setting content may include an action description of the test action, a control corresponding to the action, an operation method of the action, an assignment of the action, a waiting time of the operation action, and a post action Information such as pictures.
  • step S6 specifically includes:
  • Step S61 selecting the first test case in the test case list as the report use case
  • Step S62 filling the first setting content associated with the report use case into the test report
  • Step S63 selecting the first test action in the test action list as the report action
  • Step S64 filling the second setting content, the operation result and the expected result associated with the reporting action into the test report respectively;
  • Step S65 turning to the next test action in the test action list, and determining whether the next test action corresponds to a new test case in the test case list:
  • step S62 If yes, the new test case is used as a report use case, and the next test action is taken as a report action, and then returns to step S62;
  • the first test case in the test case list is automatically acquired as a report use case, and the first set content of the report use case is filled into a specified position of the test report.
  • the initialization data of the above report use case can also be filled into the specified position of the test report (the initialization data will be described in detail below).
  • test action list of the report use case and automatically obtaining the first test action in the test action list as a report action, filling the second set content related to the report action into a specified position of the test report, and further acquiring The operation result and the expected knot corresponding to the above report action And populate the specified location of the test report.
  • the new test case is used as a report use case, and the next test action is taken as a report action, and then returns to the above step S64 to fill the test report according to the new report use case and the report action;
  • next test action is taken as a report action, and then returns to the above step S67 to populate the test report according to the new report action based on the original report use case.
  • step S67 after the next test action in the test action list, it is also required to determine:
  • the generation of the test report is fully automatic, and the user only needs to select an appropriate test case according to a case list integrated with a test button including a plurality of test cases, and wait for the automatically generated test.
  • the report is displayed on the report interface.
  • 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 by the address associated with the open screen to start the match
  • the previous use case is tested.
  • 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 foregoing step S2 specifically includes: acquiring corresponding to The number of the test screen of the subsequent test operation of the previous operation is monitored, and the number of the display screen is monitored. 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 position 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 expected result is as shown in FIG. 8-10:
  • the expected result of the controls in the picture is shown in Figure 8, 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. 9, 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. 10, which may include search conditions, sorting conditions, Limit the number of attributes and attributes such as 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-mentioned visual test report generation method can be applied to any mainstream software system, because the above test cases, test actions, and tests are preset.
  • the implementation of the driving method required in the mainstream software system is pre-guaranteed in the database of the control, the test screen, etc., thereby ensuring 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)
  • User Interface Of Digital Computer (AREA)
  • Debugging And Monitoring (AREA)

Abstract

一种可视化测试报告生成方法,属于软件测试技术领域;方法包括:选择一个测试动作作为当前动作,并将对应的测试用例作为当前用例;将显示画面的编号和当前动作的测试画面的编号进行比较;于被定位的显示画面中抓取匹配于当前动作的测试控件作为当前控件并根据其属性依据对应的操作方法对当前控件进行操作,随后输出操作结果;将操作结果与预想结果进行比较,将对应的比较结果保存为当前动作的测试结果;分别获取每个测试用例中的每个测试动作的操作结果和预想结果并填充在测试报告中,并将测试报告陈列于报告画面中。上述技术方案的有益效果是:实现测试的可视化自动进行,使得测试过程更有效率,并且测试报告更直观。

Description

一种可视化测试报告生成方法 技术领域
本发明涉及软件测试技术领域,尤其涉及一种可视化测试报告生成方法。
背景技术
传统的软件测试技术存在着人工干预的阶段,测试人员需要手动设置测试用例以及其中包括的各种测试动作,并且手动运行测试,手动比对测试结果以及根据比对结果判断测试是否成功。换言之,在现有的软件测试技术中存在过多人工干预的步骤,因此会占用大量的人工资源,延长软件测试的时间,降低测试效率。
同时,现有的软件测试技术中,其测试参数设置通常采用一些只有专业测试人员才能掌握的代码级设置来实现,因此导致测试设置比较复杂,要求测试人员具有相匹配的代码知识和技术才能对软件测试进行参数设置;
在传统的软件测试技术中,在测试结束后自动生成的测试报告通常。
发明内容
根据现有技术中存在的上述问题,现提供一种可视化测试报告生成方法的技术方案,旨在实现测试的可视化自动进行,使得测试过程更直观更有效率,简化测试的操作。
上述技术方案具体包括:
一种可视化测试报告生成方法,其中,按序预设多个测试用例,每个所述测试用例对应于多个按序执行的测试动作,每个所述测试动作对应于一个测试控件,每个所述测试动作对应于一个操作方法,每个所述测试控件对应一个测试画面,每个所述测试动作对应多个预想结果;
将本次需要执行的所有所述测试用例对应的所有所述测试动作按照所述测试用例被执行的顺序排列形成一测试动作列表;
所述可视化测试报告生成方法包括:
步骤S1,于所述动作列表中选择一个所述测试动作作为当前动作,并将所述当前动作对应的所述测试用例作为当前用例进行测试;
步骤S2,将测试过程中系统浏览器中的显示画面的编号,和所述当前动作对应的所述测试画面的编号进行比较,以对所述显示画面进行定位;
步骤S3,于被定位的所述显示画面中抓取匹配于所述当前动作的所述测试控件作为当前控件;
步骤S4,根据所述当前动作的动作属性,依据对应的所述操作方法对被抓取的所述当前控件进行操作,随后输出对应所述当前动作的操作结果;
步骤S5,将所述操作结果与对应所述当前动作的所述预想结果进行比较,以判断所述当前动作是否执行成功,将对应的比较结果保存为所述当前动作的测试结果;
步骤S6,在所有所述测试用例均被测试完毕后,分别获取每个所述测试用例中的每个所述测试动作的所述操作结果和所述预想结果并填充在一测试报告中;
步骤S7,将所述测试报告陈列于一报告画面中,随后退出。
优选的,该可视化测试报告生成方法,其中,于进行测试前,针对每个所述测试用例分别设定一个第一设定内容,以及针对每个所述测试动作分别设定一个第二设定内容,并且将本次需要执行的所有所述测试用例排列形成一测试用例列表,每个所述测试用例列表对应一个测试案件;
每个所述第一设定内容分别包括对应的所述测试用例中的测试属性;
每个所述第二设定内容分别包括对应的所述测试动作的测试属性;
则所述步骤S6具体包括:
步骤S61,选择所述测试用例列表中的第一个所述测试用例作为报告用例;
步骤S62,将关联于所述报告用例的所述第一设定内容填充到所述测试报告中;
步骤S63,选择所述测试动作列表中的第一个所述测试动作作为报告动作;
步骤S64,将关联于所述报告动作的所述第二设定内容、所述操作结果和所述预想结果分别填充到所述测试报告中;
步骤S65,转向所述测试动作列表中的下一个所述测试动作,并判断下一个所述测试动作是否对应于所述测试用例列表中的新的所述测试用例:
若是,则将新的所述测试用例作为所述报告用例,并将下一个所述测试动作作为所述报告动作,随后返回所述步骤S62;
若否,则将下一个所述测试动作作为所述报告动作,随后返回所述步骤S64。
优选的,该可视化测试报告生成方法,其中,所述步骤S64中,在填充所述第一设定内容的同时,将关联于所述报告用例的初始化数据填充到所述测试报告中。
优选的,该可视化测试报告生成方法,其中,所述步骤S1中,在执行关联于所述当前用例的第一个所述测试动作时,提取对应于所述当前用例的第一个所述测试控件的所述测试画面作为开启画面,并通过关联于所述开启画面的地址打开所述开启画面,以开始对所述当前用例进行测试。
优选的,该可视化测试报告生成方法,其中,所述步骤S1中,在执行关联于所述当前用例的每个所述测试动作之前,根据所述测试动作的动作属性判断是否需要打开对应于所述测试动作的所述测试控件的所述测试画面,并在需要时提取关联于所述测试画面的地址以打开所述测试画面。
优选的,该可视化测试报告生成方法,其中,所述步骤S1中,当将所述测试用例确认为所述当前用例后提取所述当前用例的初始化数据,对关联于所述当前用例的数据库中的数据进行初始化操作,以开始对所述当前用例进行测试;
提取对应于所述当前用例的第一个所述测试控件的所述测试画面的地址作为所述开启画面的开启地址,并基于所述开启地址,使用关联于所述当前用例的启动参数开启所述开启画面,以对所述启动画面进行测试。
优选的,该可视化测试报告生成方法,其中,所述步骤S2具体包括:
获取对应于所述当前动作的后续的所述测试动作的所述测试画面的编号,同时监控所述显示画面的编号,在所述显示画面的编号与所述测试画面的编号一致时,确认所述显示画面切换成功,以对所述显示画面进行定位。
优选的,该可视化测试报告生成方法,其中,所述步骤S2具体包括:
获取对应于所述当前动作的后续的所述测试画面的编号,同时监控所述 显示画面的编号,在所述显示画面的编号与所述测试画面的编号一致时,确认所述显示画面切换成功,以对所述显示画面进行定位。
优选的,该可视化测试报告生成方法,其中,所述步骤S3中,抓取到所述显示画面中的一个所述测试控件后,将所述测试控件的控件属性与所述当前动作对应的所述测试控件的控件属性进行匹配并得到匹配结果,并在所述匹配结果表示匹配成功时将被抓取的所述测试控件定位为所述当前控件。
优选的,该可视化测试报告生成方法,其中,所述步骤S4中,在对所述控件进行操作之前,首先判断所述当前动作的所述动作属性,并根据所述动作属性确定对所述当前控件进行操作:
若所述当前动作的所述动作属性为设值,则对所述当前控件进行的操作为给所述控件赋值;
若所述当前动作的所述动作属性为执行操作命令,则对所述当前控件进行的操作为执行所述操作命令以操作所述控件;
若所述当前动作的所述动作属性为发送文字列消息,则操作所述当前控件发送对应的所述文字列消息;
若所述当前动作的所述动作属性为内存复制,则将所述当前控件的值保存于系统内存中;
若所述当前动作的所述动作属性为内存赋值,则将所述当前控件的值更改为所述系统内存中保存的值;
若所述当前动作的所述动作属性为逻辑判断,则对保存于所述系统内存中用于表示赋值的表达式进行判断,并根据判断结果跳过关联于所述当前动作的预设的后续的所述测试动作;
若所述当前动作的所述动作属性为采用功能键组合的方式进行操作,则通过向系统的输入装置发送对应的功能键组合命令的方式操作所述当前控件。
优选的,该可视化测试报告生成方法,其中,所述步骤S5中,根据所述操作结果的类型进行所述操作结果与所述预想结果之间的比较:
若所述操作结果为操作所述显示画面中包括的所述控件的结果,则系统读取所述浏览器中的所述显示画面对应的所述控件的信息,并将读取到的信息与所述预想结果进行比较;
若所述操作结果为对应于所述浏览器中的一栏数据的结果,则系统读取所述浏览器中对应的所述一栏数据,并将读取到的信息与所述预想结果进行比较;
若所述操作结果为系统的数据库中的数据,则系统读取所述数据库中的数据,并读取到的信息与所述预想结果进行比较。
优选的,该可视化测试报告生成方法,其中,所述步骤S5中,判断所述当前动作是否执行成功:
若是,则保存关联于所述当前动作的所述操作结果,随后继续执行所述步骤S5;
若否,则结束所述当前用例的测试,并跳转至下一个所述测试用例,随后返回所述步骤S1。
优选的,该可视化测试报告生成方法,其中,所述步骤S5中,将对应的比较结果保存为所述当前动作的测试结果后,跳转至下一个所述测试动作:
若跳转至的下一个所述测试动作表示对全局的控件进行操作,则返回所述步骤S4。
上述技术方案的有益效果是:提供一种可视化测试报告生成方法,能够实现测试的可视化自动进行,使得测试过程更直观更有效率,简化测试的操作。
附图说明
图1是本发明的较佳的实施例中,一种可视化测试报告生成方法的总体流程示意图;
图2是本发明的较佳的实施例中,可视化测试报告生成方法的具体流程示意图;
图3-4是本发明的较佳的实施例中,预设测试用例的示意图;
图5是本发明的较佳的实施例中,预设画面的示意图;
图6是本发明的较佳的实施例中,预设测试动作的示意图;
图7是本发明的较佳的实施例中,预设控件的示意图;
图8-10是本发明的较佳的实施例中,不同的预想结果的示意图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动的前提下所获得的所有其他实施例,都属于本发明保护的范围。
需要说明的是,在不冲突的情况下,本发明中的实施例及实施例中的特征可以相互组合。
下面结合附图和具体实施例对本发明作进一步说明,但不作为本发明的限定。
本发明的较佳的实施例中,基于现有技术中存在的上述问题,现提供一种可视化测试报告生成方法。该可视化测试报告生成方法中,首先按序预设多个测试用例,每个测试用例对应于多个按序执行的测试动作,每个测试动作仅对应于一个测试控件,同时每个测试动作对应于一个操作方法,即针对一个控件,仅存在一种操作方法。每个测试控件对应于一个测试画面。每个测试动作对应多个预想结果;
将本次需要执行的所有测试用例的所有测试动作按照测试用例被执行的顺序排列形成一测试动作列表;
则如图1所示,上述可视化测试报告生成方法的步骤具体包括:
步骤S1,于动作列表中选择一个测试动作作为当前动作,并将当前动作对应的测试用例作为当前用例进行测试;
步骤S2,将测试过程中系统浏览器中的显示画面的编号,和当前动作对应的测试画面的编号进行比较,以对显示画面进行定位;
步骤S3,于被定位的显示画面中抓取匹配于当前动作的测试控件作为当前控件;
步骤S4,根据当前动作的动作属性,依据对应的操作方法对被抓取的当前控件进行操作,随后输出对应当前动作的操作结果;
步骤S5,将操作结果与对应当前动作的预想结果进行比较,以判断当前动作是否执行成功,将对应的比较结果保存为当前动作的测试结果;
步骤S6,在所有测试用例均被测试完毕后,分别获取每个测试用例中的每个测试动作的操作结果和预想结果并填充在一测试报告中;
步骤S7,将测试报告陈列于一报告画面中,随后退出。
在一个具体实施例中,首先预设多个测试用例,每个测试用例内包括多个测试动作,每个测试动作对应一个测试控件。每个测试控件对应一个测试画面,因此决定每个测试用例对应于多个测试画面。
具体地,上述测试用例是按序预设的,即按照一定的执行顺序预设多个测试用例,一个测试用例执行完毕后就转向执行下一个测试用例。同样地,在同一个测试用例中,不同的测试动作也按序排列,每个测试动作分别对应于一个测试控件,每个测试控件分别对应于一个测试画面。上述测试画面可以被划分为开启画面以及后续画面。对于一个测试用例来说,开启画面只有一个,后续画面可以存在多个,上述开启画面可以为测试用例执行的第一个画面,后续画面为在上述开启画面之后并且依序排列的显示画面。每个测试画面(包括开启画面和后续画面)均为操作一个测试控件所对应的画面。例如对于用户登录这个测试用例而言,其中可以包括输入用户名和密码的测试动作,以及点击登录控件的测试动作。则对应上述登录控件的测试画面可以为提供给使用者可以输入用户名和密码的登录画面,并且该画面可以作为测试用例的开启画面,上述测试用例的多个后续画面可以为登录成功后显示的系统浏览器的其他画面,或者显示登录失败的画面。上述画面依照测试逻辑排序。
上述实施例中,测试用例的设置界面如图3-4所示。该测试用例中的开启画面的名称为“账户信息”,该测试用例的名称为“进入修改账户密码界面”,该测试用例的前期关联测试用例为“进入账户信息界面”,相应地,该测试用例的前期关联测试用例还包括“登录”、“进入系统管理”和“进入账户信息界面”,上述前期关联测试用例依序排列。图2中所示的测试用例的设置界面为可视化界面,并非现有技术中代码级的设置界面,因此可以简化测试用例的设置过程。图4中示出了上述预设的测试用例列表。
上述实施例中,关联于测试用例的测试画面(包括开启画面和后续画面)的设置界面如图5所示。图5中的画面信息中包括画面序号(ID)、画面名称以及画面访问地址。所谓的访问地址是指URL(Uniform Resoure Locator,统一资源定位)地址。上述画面设置界面同样为可视化界面。
上述实施例中,测试动作的设置界面如图6所示,图6中的测试动作可 以配置为“嵌入检索条件”,其中关联有多个显示画面的名称、多个控件名称、多个动作属性(方法)以及多个测试动作的赋值等。上述测试动作的设置界面同样为可视化易操作的。
上述实施例中,每个测试动作对应的操作方法可以由动作属性经过一系列计算得到,而上述动作属性可以由对应的表达式表示。
上述实施例中,将设置完成的关联于不同的测试用例的测试动作形成一个动作列表。具体地,例如按序排列分别设置有测试用例A、B和C,在测试用例A中按序排列分别设置有测试动作A1、A2和A3,在测试用例B中按序排列分别设置有测试动作B1和B2,在测试用例C中按序排列分别设置有测试动作C1、C2、C3和C4,则上述动作列表即可以为按序排列的A1、A2、A3、B1、B2、C1、C2、C3、C4。
上述实施例中,每个测试动作相关联的控件的设置界面如图7所示。在图6中,每个控件的控件信息中包括控件序号(ID)、控件标题、控件类型、控件的前端技术、控件定位用的属性名称、控件定位用的属性值、控件的最大值/最小值/最大长度/最小长度、控件的默认值、控件的正确值列表/错误值列表等。上述控件的设置画面也是可视化画面。
上述实施例中,上述测试用例、测试动作、画面以及控件等的设置均可以依照以下两种方式进行:1)由系统预先设定;2)在系统中预先设定了各测试元素,则使用者可以通过相应的可视化界面选择不同的测试元素并组合形成测试用例、测试动作、画面以及控件等设置信息。
上述实施例中所述的预想结果的设置界面在下文中会详述。
则上述实施例中,针对本次需要执行的所有测试用例,按照不同测试用例的排序,将其中包括的所有测试动作放置在一个动作列表中。
则上述步骤S1中,首先选择一个测试动作开始执行测试。具体地,针对该测试动作,可以确定相应的测试用例,并将被确定的测试用例作为当前用例开始测试。
上述实施例中,在定位好当前动作和当前用例后,监控浏览器的显示画面的切换状态,找到浏览器当前加载完成的显示画面的画面编号,并将当前动作的测试画面的编号与该显示画面的编号进行对比,即根据当前的显示画面的画面编号去与对应当前动作的测试画面进行匹配,从而将当前浏览器的 显示画面定位为当前用例中对应于当前动作的一个测试画面。
上述实施例中,在定位好显示画面后,对显示画面中的显示内容进行分分析,并抓取显示画面中的所有控件的实时信息,根据显示画面中抓取的控件的相关信息与测试动作对应的控件信息(例如定位用属性)进行匹配,从而可以定位准确的控件,并记录被定位的控件的位置信息。具体地,抓取到显示画面中的一个控件后,将控件的控件属性与当前动作对应的测试控件的控件属性进行匹配并得到匹配结果,并在匹配结果表示匹配成功时将被抓取的控件定位为当前控件。例如,抓取到一个控件后,将该控件与测试动作所对应的测试控件进行比较:若不同,则表示不是当前动作的控件;若相同,则表示是当前动作的控件。随后将匹配成功的控件确认为当前控件。因此,上述定位控件的方式可以包括:首先采用测试动作所对应的测试控件定位到一个测试画面,该测试画面即为当前显示的显示画面。由于在显示画面中可能不仅仅包括一个控件,因此在该显示画面中还需要通过控件属性对比的方式定位到上述测试动作所对应的测试控件,以完成测试控件的定位。
上述实施例中,当定位到测试控件之后,可以根据当前动作的动作属性对该测试控件执行相应的操作,随后当前动作执行完毕,记录对应当前动作的操作结果。
上述实施例中,得到操作结果后,将该操作结果与当前动作对应的预想结果进行比较,以判断当前动作是否操作成功,并记录比较结果。
上述实施例中,在完成上述步骤S1-步骤S5的过程之后,可以直接转向下一个测试动作,并返回上述步骤S1,则上述测试报告的生成过程(步骤S6)可以在本次测试完成后进行,即在所有测试用例均被测试完毕后进行。
则上述实施例中,上述步骤S6中,在所有测试用例均被测试完毕后,可以分别获取每个测试用例中的每个测试动作的操作结果和预想结果并填充在一测试报告中,并将测试报告陈列于一报告画面中。
综上所述,本发明技术方案中,通过可视化的操作方法,将预先设置测试用例、测试动作、测试控件、测试画面以及预想结果等测试参数的过程变得简单易懂,并且可以便捷地根据这些被设置好的测试参数自动进行可视化的软件测试,能够满足人们的软件测试需求,并且提升了软件测试的效率,随后根据可视化测试过程,将测试结果也通过可视化的方式展现在测试报告 中,便于使用者查看。
本发明的较佳的实施例中,于进行测试前,针对每个测试用例分别设定一个第一设定内容,以及针对每个测试动作分别设定一个第二设定内容,并且将本次需要执行的所有测试用例排列形成一测试用例列表,每个测试用例列表对应一个测试案件;
每个第一设定内容分别包括对应的测试用例中的测试属性;
每个第二设定内容分别包括对应的测试动作的测试属性;
上文中,上述第一设定内容中的测试用例的测试属性,其中可以包括该测试用例的用例属性、用例名称以及测试目的等信息。
相应地,上述第二设定内容中的测试动作的测试属性,其中可以包括该测试动作的动作描述、动作对应的控件、动作的操作方法、动作的赋值、操作动作的等待时间以及动作的后画面等信息。
则如图2所示,上述步骤S6具体包括:
步骤S61,选择测试用例列表中的第一个测试用例作为报告用例;
步骤S62,将关联于报告用例的第一设定内容填充到测试报告中;
步骤S63,选择测试动作列表中的第一个测试动作作为报告动作;
步骤S64,将关联于报告动作的第二设定内容、操作结果和预想结果分别填充到测试报告中;
步骤S65,转向测试动作列表中的下一个测试动作,并判断下一个测试动作是否对应于测试用例列表中的新的测试用例:
若是,则将新的测试用例作为报告用例,并将下一个测试动作作为报告动作,随后返回步骤S62;
若否,则将下一个测试动作作为报告动作,随后返回步骤S64。
具体地,本发明的较佳的实施例中,自动获取测试用例列表中的第一个测试用例作为报告用例,并将该报告用例的第一设定内容填充到测试报告的指定位置。本发明的较佳的实施例中,同时也可以将上述报告用例的初始化数据填充到测试报告的指定位置(关于初始化数据在下文中会详述)。
随后获取该报告用例的测试动作列表,并自动获取测试动作列表中的第一个测试动作作为报告动作,将该报告动作相关的第二设定内容填充到测试报告的指定位置,并且进一步地获取上述报告动作对应的操作结果和预想结 果并填充到测试报告的指定位置。
随后转向下一个测试动作,并判断下一个测试动作是否表示一个新的测试用例:
若是,则将该新的测试用例作为报告用例,并将该下一个测试动作作为报告动作,随后返回上述步骤S64,以根据新的报告用例和报告动作对测试报告进行填充;
若否,则将该下一个测试动作作为报告动作,随后返回上述步骤S67,以在原有的报告用例的基础上根据新的报告动作对测试报告进行填充。
本发明的较佳的实施例中,上述步骤S67中,转向测试动作列表中的下一个测试动作后,还需要判断:
本发明的较佳的实施例中,上述测试报告的生成为全自动的,使用者只需要根据集成有包括多个测试用例的测试按键的案件列表选择合适的测试案件,并等待自动生成的测试报告显示在报告界面即可。
本发明的一个较佳的实施例中,在上述步骤S1中,在执行关联于当前用例的每个测试动作之前,根据测试动作的动作属性判断是否需要打开对应于测试动作的测试控件的测试画面,并在需要时提取关联于测试画面的地址以打开测试画面。具体地,上述实施例中,在执行每个测试动作之前,都需要判断下是否需要加载该测试动作对应的测试控件的测试画面:若需要,则加载相应的测试画面;若不需要,则不对画面做任何变动。上述实施例中,上述测试画面的提取和加载是通过提取对应控件的对应画面的URL地址实现的。具体地,通过提取对应控件的对应画面相关的URL地址,使用当前用例指定的启动参数,并在浏览器中打开对应的URL地址,以对当前用例进行测试。若当前指定的浏览器已被打开,则只需要通过提取画面相关的URL地址来更新浏览器中的显示画面即可。并且,上述实施例中,所谓测试动作的动作属性,其中可以包括测试动作与其前后顺序的动作之间的关联关系。系统可以通过判断测试动作与其前后动作的关系,然后判断是否需要提取相应的URL地址并打开相应的测试画面。
本发明的另一个较佳的实施例中,上述步骤S1中,在执行关联于当前用例的第一个测试动作时,提取对应于当前用例的第一个测试控件的测试画面作为开启画面,并通过关联于开启画面的地址打开开启画面,以开始对当 前用例进行测试。具体地,上述实施例中,只有在执行一个测试用例中的第一个测试动作时,才加载该测试动作对应的测试控件的测试画面,以作为开启画面。具体地,在首次开始测试时,可以选择上述动作列表中的第一个测试动作并开始测试。则选择好测试动作后,将该测试动作作为当前动作,并根据当前动作定位到对应的测试用例,将该测试用例作为当前用例,随后提取该当前动作对应的测试控件对应的测试画面并开始进行测试。上述实施例中,由于首次开始测试时的测试动作为第一个测试动作,则上述被提取的画面应当也为相应的当前用例的开启画面。同样地,加载和提取开启画面的方法与上一个实施例相同,即通过提取开启画面的URL地址并使用当前用例指定的启动参数,在指定的系统浏览器中打开来实现。
本发明的较佳的实施例中,在开始执行上述每个测试用例之前,首先设定该测试用例的初始化数据,即对测试用例的数据进行初始化操作。所谓对数据进行初始化操作,其中可以包括:对数据库中相应的数据做初始化处理,以避免之前的测试数据遗留影响本次测试,又或者在数据库中添加相应的初始化数据,以形成一个测试的初始化测试环境,保证测试开始的环境的统一性等。
因此,在本发明的一个较佳的实施例中,在执行到一个新的测试动作时,首先需要判断该测试动作是否为某个测试用例的第一个测试动作:若是,则需要对测试用例先进行初始化数据的操作,随后再执行测试动作;若否,则直接执行该测试动作。
又或者,在本发明的另一个较佳的实施例中,对每个测试用例的开启画面进行标记。在测试过程中,当跳转至一个开启画面时,则对相应的测试用例进行初始化数据的操作,随后再执行开启画面对应的测试动作。
本发明的较佳的实施例中,上述步骤S1中,当将测试用例确认为当前用例后提取当前用例的初始化数据,以开始对当前用例进行测试;
提取对应于当前用例的第一个测试控件的测试画面的地址作为开启画面,随后使用当前用例指定的启动参数打开开启画面,并进行测试。
上述实施例中,所谓启动参数,是指打开上述作为开始画面的测试画面的标准网络参数。
本发明的一个较佳的实施例中,上述步骤S2具体包括:获取对应于当 前动作的后续的测试动作的测试画面的编号,同时监控显示画面的编号,在显示画面的编号与测试画面的编号一致时,确认显示画面切换成功,以对显示画面进行定位。具体地,上述步骤S2中,若当前的显示画面的编号与当前动作的后续动作对应的测试画面的编号一致,则认为当前的显示画面切换成功,从而将该显示画面定位为当前动作的后续动作的测试画面。
本发明的另一个较佳的实施例中,上述步骤S2具体包括:获取对应于当前动作的后续的测试画面的编号,同时监控显示画面的编号,在显示画面的编号与测试画面的编号一致时,确认显示画面切换成功,以对显示画面进行定位。具体地,上述步骤S2中,若当前的显示画面的编号与当前动作的后续画面的编号一致,则认为当前的显示画面切换成功,从而将该显示画面定位为当前动作的后续画面。
本发明的较佳的实施例中,上述步骤S4中,在对控件进行操作之前,首先判断当前动作的动作属性,并根据动作属性确定对当前控件进行操作:
若当前动作的动作属性为设值,则对当前控件进行的操作为给控件赋值,例如对控件赋予一个预先设定的数值等。
若当前动作的动作属性为执行操作命令,则对当前控件进行的操作为执行操作命令以操作控件,例如操作命令为“点击”,则可以对当前控件执行点击控件的操作。
若当前动作的动作属性为采用功能键组合的方式进行操作,则通过向系统的输入装置发送对应的功能键组合命令的方式操作当前控件,例如功能键组合为组合输入键盘上的“Shift”按键、“Alt”按键和“Enter”按键,则系统可以向键盘发送相应的功能键组合命令,以通知键盘输出上述三个按键的组合按键指令。
若当前动作的动作属性为发送文字列消息,则操作当前控件发送对应的文字列消息,具体地可以通过浏览器发送对应的文字列消息。
若当前动作的动作属性为内存复制,则将当前控件的赋值保存于系统内存中;具体地,可以将当前控件的赋值或者其他特定值保存到系统内存中,即实现系统内存的“剪贴板”功能。
若当前动作的动作属性为内存赋值,则可以根据当前动作的动作属性,将系统内存中已经保存的值赋到当前控件中。
若当前动作的动作属性为逻辑判断,则可以对内存中保存的值进行判断,并根据判断结果跳过预设的后续的测试动作。具体地,所谓逻辑判断,其为对系统内存中表示赋值的表达式进行判断,例如判断该表达式是否大于/小于某个预设值,或者判断系统内存中保存的值是否为true/false。而上述表示跳过动作的跳过方案可以预设在不同的测试动作的测试属性中。具体的判断过程可以为:判断上述系统内存中保存的数值的表达式,并根据判断结果确定是否需要执行上述预设的跳过方案,来跳过一个或多个后续的测试动作。上述实施例中,上述跳过方案中同样可以不包括任何一个后续动作,即无论判断结果如何,都不需要跳过任何一个后续动作。
本发明的较佳的实施例中,如上文中所述,若当前的画面发生跳转,则可以监控浏览器的显示内容,进而定位到新的画面编号,以及定位到新的测试控件。
本发明的较佳的实施例中,上述步骤S5中,根据操作结果的类型进行操作结果与预想结果之间的比较:
若操作结果为操作显示画面的控件的结果,则系统读取浏览器中的显示画面中包括的对应的控件的信息,并将读取到的信息与预想结果进行比较;具体地,在对控件的信息和预想结果进行比较时,是对一批控件进行统一比较,例如抓取当前的显示画面中的所有控件对应的信息,并分别与预想结果进行比较。
若操作结果为对应于浏览器中的一栏数据的结果,则系统读取浏览器中对应的一栏数据,并将读取到的信息与预想结果进行比较;
若操作结果为系统的数据库中的数据,则系统读取数据库中的数据,并读取到的信息与预想结果进行比较。
具体地,本发明的较佳的实施例中,上述预想结果预先设置的设置界面如图8-10所示:
图8中示出画面中控件的预想结果,其中可以包括控件的ID,控件标题,预想结果的类型以及预想结果的值。
图9中示出表格类的预想结果,其中可以包括控件ID、控件的标题,预想件数、比较件数以及表格数据等属性。
图10中示出了数据库类的预想结果,其中可以包括检索条件、排序条件、 限制条数以及数据等属性。
则本发明的较佳的实施例中:
若为控件比较,则系统读取浏览器中对应控件的信息,并将读取到的信息与预想结果进行比较;
若为一栏数据的比较,则系统读取浏览器中对应的一栏数据,并将读取到的信息与预想结果进行比较;
若为数据库的比较,则系统读取指定的数据库中的数据,并将读取到的信息与预想结果进行比较。
本发明的较佳的实施例中,上述步骤S5中,判断当前动作是否执行成功:
若是,则保存关联于当前动作的操作结果,随后继续执行步骤S5;
若否,则结束当前用例的测试,并跳转至下一个测试用例,随后返回步骤S1。
具体地,本发明的较佳的实施例中:
若当前动作执行成功,则自然跳转到同一个当前用例的下一个测试动作并执行(继续执行步骤S5),同时保存执行成功的操作结果。
若当前动作执行失败,则结束当前用例的测试,并跳转至下一个测试用例执行(返回步骤S1),在动作列表中即为跳过当前用例对应的后续的测试动作,从下一个测试用例的第一个测试动作重新开始进行测试。
本发明的较佳的实施例中,在一个当前动作的操作结果完成时,可以对浏览器的显示页面(即表示操作结果的页面)进行截图保存,并且在截图中标注出当前动作对应的控件的位置(通过之前的控件定位进行标注)。
本发明的一个较佳的实施例中,上述步骤S5中,将对应的比较结果保存为当前动作的测试结果后,跳转至下一个测试动作:
若跳转至的下一个测试动作表示对全局的控件进行操作,则返回步骤S4。
本发明的一个较佳的实施例中,上述步骤S5中,将对应的比较结果保存为当前动作的测试结果后,跳转至下一个测试动作。
本发明的较佳的实施例中,上述可视化测试报告生成方法可以适用于任何一个主流的软件系统中,这是因为在预设上述测试用例、测试动作、测试 控件、测试画面等的数据库中预先保证了主流软件系统中需要用到的驱动方法的实现方式,从而保证了主流软件系统中的动作方法的驱动。
以上所述仅为本发明较佳的实施例,并非因此限制本发明的实施方式及保护范围,对于本领域技术人员而言,应当能够意识到凡运用本发明说明书及图示内容所作出的等同替换和显而易见的变化所得到的方案,均应当包含在本发明的保护范围内。

Claims (13)

  1. 一种可视化测试报告生成方法,其特征在于,按序预设多个测试用例,每个所述测试用例对应于多个按序执行的测试动作,每个所述测试动作对应于一个测试控件,每个所述测试动作对应于一个操作方法,每个所述测试控件对应一个测试画面,每个所述测试动作对应多个预想结果;
    将本次需要执行的所有所述测试用例对应的所有所述测试动作按照所述测试用例被执行的顺序排列形成一测试动作列表;
    所述可视化测试报告生成方法包括:
    步骤S1,于所述动作列表中选择一个所述测试动作作为当前动作,并将所述当前动作对应的所述测试用例作为当前用例进行测试;
    步骤S2,将测试过程中系统浏览器中的显示画面的编号,和所述当前动作对应的所述测试画面的编号进行比较,以对所述显示画面进行定位;
    步骤S3,于被定位的所述显示画面中抓取匹配于所述当前动作的所述测试控件作为当前控件;
    步骤S4,根据所述当前动作的动作属性,依据对应的所述操作方法对被抓取的所述当前控件进行操作,随后输出对应所述当前动作的操作结果;
    步骤S5,将所述操作结果与对应所述当前动作的所述预想结果进行比较,以判断所述当前动作是否执行成功,将对应的比较结果保存为所述当前动作的测试结果;
    步骤S6,在所有所述测试用例均被测试完毕后,分别获取每个所述测试用例中的每个所述测试动作的所述操作结果和所述预想结果并填充在一测试报告中;
    步骤S7,将所述测试报告陈列于一报告画面中,随后退出。
  2. 如权利要求1所述的可视化测试报告生成方法,其特征在于,于进行测试前,针对每个所述测试用例分别设定一个第一设定内容,以及针对每个所述测试动作分别设定一个第二设定内容,并且将本次需要执行的所有所述测试用例排列形成一测试用例列表,每个所述测试用例列表对应一个测试案件;
    每个所述第一设定内容分别包括对应的所述测试用例中的测试属性;
    每个所述第二设定内容分别包括对应的所述测试动作的测试属性;
    则所述步骤S6具体包括:
    步骤S61,选择所述测试用例列表中的第一个所述测试用例作为报告用例;
    步骤S62,将关联于所述报告用例的所述第一设定内容填充到所述测试报告中;
    步骤S63,选择所述测试动作列表中的第一个所述测试动作作为报告动作;
    步骤S64,将关联于所述报告动作的所述第二设定内容、所述操作结果和所述预想结果分别填充到所述测试报告中;
    步骤S65,转向所述测试动作列表中的下一个所述测试动作,并判断下一个所述测试动作是否对应于所述测试用例列表中的新的所述测试用例:
    若是,则将新的所述测试用例作为所述报告用例,并将下一个所述测试动作作为所述报告动作,随后返回所述步骤S62;
    若否,则将下一个所述测试动作作为所述报告动作,随后返回所述步骤S64。
  3. 如权利要求2所述的可视化测试报告生成方法,其特征在于,所述步骤S64中,在填充所述第一设定内容的同时,将关联于所述报告用例的初始化数据填充到所述测试报告中。
  4. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S1中,在执行关联于所述当前用例的第一个所述测试动作时,提取对应于所述当前用例的第一个所述测试控件的所述测试画面作为开启画面,并通过关联于所述开启画面的地址打开所述开启画面,以开始对所述当前用例进行测试。
  5. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S1中,在执行关联于所述当前用例的每个所述测试动作之前,根据所述测试动作的动作属性判断是否需要打开对应于所述测试动作的所述测试控件的所述测试画面,并在需要时提取关联于所述测试画面的地址以打开所述测试画面。
  6. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步 骤S1中,当将所述测试用例确认为所述当前用例后提取所述当前用例的初始化数据,对关联于所述当前用例的数据库中的数据进行初始化操作,以开始对所述当前用例进行测试;
    提取对应于所述当前用例的第一个所述测试控件的所述测试画面的地址作为所述开启画面的开启地址,并基于所述开启地址,使用关联于所述当前用例的启动参数开启所述开启画面,以对所述启动画面进行测试。
  7. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S2具体包括:
    获取对应于所述当前动作的后续的所述测试动作的所述测试画面的编号,同时监控所述显示画面的编号,在所述显示画面的编号与所述测试画面的编号一致时,确认所述显示画面切换成功,以对所述显示画面进行定位。
  8. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S2具体包括:
    获取对应于所述当前动作的后续的所述测试画面的编号,同时监控所述显示画面的编号,在所述显示画面的编号与所述测试画面的编号一致时,确认所述显示画面切换成功,以对所述显示画面进行定位。
  9. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S3中,抓取到所述显示画面中的一个所述测试控件后,将所述测试控件的控件属性与所述当前动作对应的所述测试控件的控件属性进行匹配并得到匹配结果,并在所述匹配结果表示匹配成功时将被抓取的所述测试控件定位为所述当前控件。
  10. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S4中,在对所述控件进行操作之前,首先判断所述当前动作的所述动作属性,并根据所述动作属性确定对所述当前控件进行操作:
    若所述当前动作的所述动作属性为设值,则对所述当前控件进行的操作为给所述控件赋值;
    若所述当前动作的所述动作属性为执行操作命令,则对所述当前控件进行的操作为执行所述操作命令以操作所述控件;
    若所述当前动作的所述动作属性为发送文字列消息,则操作所述当前控件发送对应的所述文字列消息;
    若所述当前动作的所述动作属性为内存复制,则将所述当前控件的值保存于系统内存中;
    若所述当前动作的所述动作属性为内存赋值,则将所述当前控件的值更改为所述系统内存中保存的值;
    若所述当前动作的所述动作属性为逻辑判断,则对保存于所述系统内存中用于表示赋值的表达式进行判断,并根据判断结果跳过关联于所述当前动作的预设的后续的所述测试动作;
    若所述当前动作的所述动作属性为采用功能键组合的方式进行操作,则通过向系统的输入装置发送对应的功能键组合命令的方式操作所述当前控件。
  11. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S5中,根据所述操作结果的类型进行所述操作结果与所述预想结果之间的比较:
    若所述操作结果为操作所述显示画面中包括的所述控件的结果,则系统读取所述浏览器中的所述显示画面对应的所述控件的信息,并将读取到的信息与所述预想结果进行比较;
    若所述操作结果为对应于所述浏览器中的一栏数据的结果,则系统读取所述浏览器中对应的所述一栏数据,并将读取到的信息与所述预想结果进行比较;
    若所述操作结果为系统的数据库中的数据,则系统读取所述数据库中的数据,并读取到的信息与所述预想结果进行比较。
  12. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S5中,判断所述当前动作是否执行成功:
    若是,则保存关联于所述当前动作的所述操作结果,随后继续执行所述步骤S5;
    若否,则结束所述当前用例的测试,并跳转至下一个所述测试用例,随后返回所述步骤S1。
  13. 如权利要求1所述的可视化测试报告生成方法,其特征在于,所述步骤S5中,将对应的比较结果保存为所述当前动作的测试结果后,跳转至下一个所述测试动作:
    若跳转至的下一个所述测试动作表示对全局的控件进行操作,则返回所述步骤S4。
PCT/CN2017/098687 2016-08-26 2017-08-23 一种可视化测试报告生成方法 WO2018036529A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610735414.8 2016-08-26
CN201610735414.8A CN106445805B (zh) 2016-08-26 2016-08-26 一种可视化测试报告生成方法

Publications (1)

Publication Number Publication Date
WO2018036529A1 true WO2018036529A1 (zh) 2018-03-01

Family

ID=58181860

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/098687 WO2018036529A1 (zh) 2016-08-26 2017-08-23 一种可视化测试报告生成方法

Country Status (2)

Country Link
CN (1) CN106445805B (zh)
WO (1) WO2018036529A1 (zh)

Families Citing this family (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106445805B (zh) * 2016-08-26 2020-06-12 上海合福信息科技有限公司 一种可视化测试报告生成方法
CN108664382B (zh) * 2017-03-28 2022-02-25 上海合福信息科技有限公司 一种控件验证方法及软件自动测试方法
CN107122298A (zh) * 2017-04-21 2017-09-01 千寻位置网络有限公司 可视化软件开发过程质量的展示方法
CN108804333B (zh) * 2018-06-14 2021-11-02 郑州云海信息技术有限公司 一种测试用例与cq关联方法及系统
CN111427776A (zh) * 2020-03-12 2020-07-17 甄十信息科技(上海)有限公司 一种智能设备自动化测试方法及装置

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1851667A (zh) * 2006-02-15 2006-10-25 华为技术有限公司 一种图形用户界面的测试方法和系统
CN101187894A (zh) * 2006-11-15 2008-05-28 中兴通讯股份有限公司 一种基于关键字驱动的自动测试方法及其测试系统
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 (zh) * 2011-03-08 2014-01-08 惠普发展公司,有限责任合伙企业 创建测试用例
CN104794050A (zh) * 2014-01-21 2015-07-22 腾讯科技(深圳)有限公司 应用程序的测试方法、装置及系统
CN106445805A (zh) * 2016-08-26 2017-02-22 上海合福信息科技有限公司 一种可视化测试报告生成方法

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101102579A (zh) * 2007-06-22 2008-01-09 华为技术有限公司 一种在测试中获知和定位用户界面的方法、及设备
US8984340B2 (en) * 2012-01-31 2015-03-17 Bank Of America Corporation System and method for test case generation using action keywords
CN103617118B (zh) * 2013-11-28 2016-06-29 北京奇虎科技有限公司 测试结果的统一处理方法、装置及系统

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1851667A (zh) * 2006-02-15 2006-10-25 华为技术有限公司 一种图形用户界面的测试方法和系统
CN101187894A (zh) * 2006-11-15 2008-05-28 中兴通讯股份有限公司 一种基于关键字驱动的自动测试方法及其测试系统
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 (zh) * 2011-03-08 2014-01-08 惠普发展公司,有限责任合伙企业 创建测试用例
CN104794050A (zh) * 2014-01-21 2015-07-22 腾讯科技(深圳)有限公司 应用程序的测试方法、装置及系统
CN106445805A (zh) * 2016-08-26 2017-02-22 上海合福信息科技有限公司 一种可视化测试报告生成方法

Also Published As

Publication number Publication date
CN106445805A (zh) 2017-02-22
CN106445805B (zh) 2020-06-12

Similar Documents

Publication Publication Date Title
WO2018036529A1 (zh) 一种可视化测试报告生成方法
WO2018036531A1 (zh) 一种测试用例生成方法
CN111026645B (zh) 用户界面自动化测试方法、装置、存储介质及电子设备
CN111240973B (zh) 基于仿真的设备测试方法、系统及可读存储介质
EP1643369A2 (en) System and method for selecting test case execution behaviors for reproducible test automation
US9501388B2 (en) Method and system for creating reference data
CN108830383B (zh) 用于展示机器学习建模过程的方法及系统
US10877778B2 (en) Sequence detection and automation for complex portal environments
CN104246714A (zh) 软件缺陷验证
TWI476587B (zh) 測試電子裝置之功能的測試方法以及測試裝置
CN108874649B (zh) 自动化测试脚本的生成方法、装置及其计算机设备
US9471472B2 (en) Method and system for entering information
CN107450953B (zh) 一种更新bios的方法及装置
WO2018036528A1 (zh) 一种自动测试方法
CN110543429A (zh) 测试用例调试方法、装置及存储介质
WO2018036530A1 (zh) 一种测试设计书生成方法
JP6434435B2 (ja) 情報処理装置、操作支援方法および操作支援プログラム
WO2020248504A1 (zh) 学生平板的状态指示方法、装置、学生平板及存储介质
JP2011039786A (ja) ソフトウェアテスト支援装置、ソフトウェアテスト支援方法、及びプログラム
JP4941674B2 (ja) シミュレーション・システム
CN113094251A (zh) 嵌入式系统测试方法、装置、计算机设备和存储介质
CN115543835A (zh) 前端页面的测试方法、装置、测试设备及存储介质
CN101727384B (zh) 自动测试一应用软件的控件的方法
TWI650710B (zh) 測試流程的檢測方法
CN113225717B (zh) 蓝牙设备的控制方法、装置及计算机可读存储介质

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: 17842951

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: 17842951

Country of ref document: EP

Kind code of ref document: A1