Automated Testing Method and Device for CAD Software, Storage Medium, and Processor

By using the Delta incremental method to calculate the coordinates of the mouse operating points in the automated test of CAD software, the problem of continuous adjustment of the mouse operating points caused by fine-tuning the test area range is solved, reducing the difficulty of maintaining the automated test script.

CN114116485BActive Publication Date: 2025-07-08CAXA TECH
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202111426165.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-11-26
Publication Date
2025-07-08
Estimated Expiration
2041-11-26

AI Technical Summary

Technical Problem

During the automated testing of CAD software, fine-tuning of the test area range causes the mouse operation points to be continuously adjusted, which increases the difficulty of maintaining the automated test script.

Method used

The Delta increment method is used to calculate the coordinates of the mouse operation point. By obtaining the initial test script and modifying its coordinate acquisition method, the impact of changes in the test area is eliminated, and the modified test script is run for automated testing.

Benefits of technology

It reduces the workload of post-maintenance of automated test scripts and reduces the difficulty of maintaining test scripts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114116485B_ABST
    Figure CN114116485B_ABST
Patent Text Reader

Abstract

The present application discloses an automated testing method and apparatus, a storage medium, and a processor for a CAD software. The method includes: obtaining an initial test script, where the initial test script is used to test the CAD software; modifying the coordinate acquisition method of the mouse operation points in the initial test script to calculate the coordinates NP (NPx, NPy) of the mouse operation points through the Delta incremental method, to obtain a modified test script, where the Delta incremental method is used to eliminate the influence caused by changes in the test area in the CAD software; and running the modified test script to perform automated testing on the CAD software. Through the present application, the problem in the related art that during the automated testing process of the CAD software, there is a fine adjustment of the test area range, and the mouse operation points need to be continuously adjusted, resulting in an increase in the maintenance difficulty of the automated test script, is solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of computer software, and in particular, to an automated testing method and device, a storage medium, and a processor for CAD software. Background Art

[0002] In order to ensure the normal operation of various functions of computer software products and reduce the cost of manual testing, more and more enterprises adopt automated testing methods to ensure the quality of products. Most of the automated testing for CAD software is based on the automated testing of GUI objects, and there are a large number of mouse operations during the operation process. Different operations can be performed at different position points. Once the test area is fine-tuned due to problems such as calculation accuracy, the mouse operation points need to be continuously adjusted to ensure the normal progress of the automated testing. Such continuous adjustment of the mouse operation points increases the maintenance difficulty of the subsequent scripts and the workload of testers.

[0003] Regarding the problem that during the automated testing process of CAD software in the related art, when there is a fine-tuning of the test area range, the mouse operation points need to be continuously adjusted, resulting in an increase in the maintenance difficulty of the automated testing script, no effective solution has been proposed yet. Summary of the Invention

[0004] The main purpose of the present application is to provide an automated testing method and device, a storage medium, and a processor for CAD software, so as to solve the problem that during the automated testing process of CAD software in the related art, when there is a fine-tuning of the test area range, the mouse operation points need to be continuously adjusted, resulting in an increase in the maintenance difficulty of the automated testing script.

[0005] To achieve the above object, according to one aspect of the present application, an automated testing method for CAD software is provided. The method includes: obtaining an initial test script, where the initial test script is used to test the CAD software; modifying the coordinate acquisition method of the mouse operation points in the initial test script to obtain the coordinates NP (NPx, NPy) of the mouse operation points by calculating through the Delta incremental method, so as to obtain a modified test script, where the Delta incremental method is used to eliminate the influence caused by changes in the test area in the CAD software; and running the modified test script to perform automated testing on the CAD software.

[0006] Further, the process of testing the CAD software with the initial test script is used as the baseline test process. In the case of the baseline test, the coordinates of the mouse operation point are OP(OPx, OPy), the length of the test area is OL, the width of the test area is OH, and the coordinates of the left vertex of the test area are O(Ox, Oy); the process of testing the CAD software with the modified test script is used as the automated test process. In the case of the automated test, the coordinates of the mouse operation point are NP(NPx, NPy), the length of the test area is NL, the width of the test area is NH, and the coordinates of the left vertex of the test area are N(Nx, Ny).

[0007] Further, the method further includes: in the case of the baseline test, obtaining the initial value of the length OL of the test area and the initial value of the width OH of the test area through a screenshot of the test area; setting the preset coordinate values of the coordinates O(Ox, Oy) of the left vertex of the test area and the preset coordinate values of the mouse operation point coordinates OP(OPx, OPy); storing the initial value of the length OL of the test area, the initial value of the width OH of the test area, the preset coordinate values of the coordinates O(Ox, Oy) of the left vertex of the test area, and the preset coordinate values of the mouse operation point coordinates OP(OPx, OPy).

[0008] Further, the method of obtaining the coordinates of the mouse operation point in the initial test script is modified to calculate the coordinates NP(NPx, NPy) of the mouse operation point through the Delta increment method. The modified test script obtained includes: setting function one in the initial test script, where function one is used to obtain the coordinates N(Nx, Ny) of the left vertex of the test area, the length NL of the test area, and the width NH of the test area; setting function two in the initial test script, where function two is used to convert the data formats of the coordinates N(Nx, Ny) of the left vertex of the test area, the data format of the length NL of the test area, and the data format of the width NH of the test area; using the initial test script with function one and function two as the modified test script.

[0009] Further, the method includes: in the case of the automated test, obtaining the coordinate values of N(Nx, Ny), the value of NL, and the value of NH through function one; converting the data formats of the coordinate values of N(Nx, Ny), the value of NL, and the value of NH to the target format through function two; storing the coordinate values of N(Nx, Ny), the value of NL, and the value of NH with the converted format.

[0010] Further, when running the modified test script, it includes: using Formula 1 with the point \(O(O_x, O_y)\) and the point \(N(N_x, N_y)\) to obtain the adjustment values \((\Delta x, \Delta y)\) of the left vertex of the test area, where Formula 1 is \(\Delta x = N_x - O_x\); \(\Delta y = N_y - O_y\); using \(O_L\), \(O_H\), \(N_L\) and \(N_H\) with Formula 2 to obtain the adjustment rates \(\Delta L\) and \(\Delta H\) of the length and width of the test area, where Formula 2 is using Formula 3 to calculate the coordinates \(NP(NP_x, NP_y)\) of the mouse operation point, where Formula 3 is \(NP_x = O_x+\Delta x+\Delta L*(O_x - O_x)\), \(NP_y = O_y+\Delta y+\Delta H*(O_y - O_y)\).

[0011] To achieve the above object, according to another aspect of the present application, an automated testing device for CAD software is provided. The device includes: a first acquisition unit for acquiring an initial test script, where the initial test script is used to test the CAD software; an adjustment unit for modifying the coordinate acquisition method of the mouse operation point in the initial test script to calculate the coordinates \(NP(NP_x, NP_y)\) of the mouse operation point by the Delta increment method to obtain a modified test script, where the Delta increment method is used to eliminate the influence caused by changes in the test area in the CAD software; a running unit for running the modified test script to perform automated testing on the CAD software.

[0012] Further, the process of testing the CAD software by the initial test script is used as a baseline test process. In the baseline test case, the coordinates of the mouse operation point are \(OP(OP_x, OP_y)\), the length of the test area is \(O_L\), the width of the test area is \(O_H\), and the left vertex coordinates of the test area are \(O(O_x, O_y)\); the process of testing the CAD software by the modified test script is used as an automated test process. In the automated test case, the coordinates of the mouse operation point are \(NP(NP_x, NP_y)\), the length of the test area is \(N_L\), the width of the test area is \(N_H\), and the coordinates of the left vertex of the test area are \(N(N_x, N_y)\).

[0013] Further, the device further includes a second acquisition unit, configured to, in the case of the baseline test, acquire an initial value of the length OL of the test area and an initial value of the width OH of the test area through a screenshot of the test area; a setting unit, configured to set a preset coordinate value of the left vertex coordinate O (Ox, Oy) of the test area and a preset coordinate value of the mouse operation point coordinate OP (OPx, OPy); and a first storage unit, configured to store the initial value of the length OL of the test area, the initial value of the width OH of the test area, the preset coordinate value of the left vertex coordinate O (Ox, Oy) of the test area, and the preset coordinate value of the mouse operation point coordinate OP (OPx, OPy).

[0014] Further, the adjustment unit includes: a first setting module, configured to set a function one in the initial test script, where the function one is used to acquire the coordinate N (Nx, Ny) of the left vertex of the test area, the length NL of the test area, and the width NH of the test area; a second setting module, configured to set a function two in the initial test script, where the function two is used to convert the data formats of the coordinate N (Nx, Ny) of the left vertex of the test area, the data format of the length NL of the test area, and the data format of the width NH of the test area; and use the initial test script with the function one and the function two as the modified test script.

[0015] Further, the device includes: a third acquisition unit, configured to, in the case of the automated test, acquire the coordinate value of N (Nx, Ny), the numerical value of NL, and the numerical value of NH through the function one; a first conversion unit, configured to convert the formats of the coordinate value of N (Nx, Ny), the numerical value of NL, and the numerical value of NH into a target format through the function two; and a second storage unit, configured to store the coordinate value of N (Nx, Ny), the numerical value of NL, and the numerical value of NH in the converted format.

[0016] Further, the operation unit includes: a first calculation module, configured to use Formula One with O (Ox, Oy) and N (Nx, Ny) to obtain an adjustment value (Deltax, Deltay) of the left vertex of the test area, where the Formula One is Deltax = Nx - Ox; Deltay = Ny - Oy; a second calculation module, configured to use OL, OH, NL, and NH with Formula Two to obtain an adjustment rate DeltaL and DeltaH of the length and width of the test area, where the Formula Two is A third calculation module, which is used to calculate the coordinates NP (NPx, NPy) of the mouse operation point by using Formula 3, where Formula 3 is NPx = OPx + Deltax + DeltaL * (Opx - Ox), and NPy = OPy + Deltay + DeltaH * (OPy - Oy).

[0017] To achieve the above object, according to another aspect of the present application, there is provided a computer-readable storage medium, where the storage medium includes a stored program, and the program executes the automated test method of the CAD software described in any one of the above.

[0018] To achieve the above object, according to another aspect of the present application, there is provided a processor, which is used to run a program, and when the program runs, it executes the automated test method of the CAD software described in any one of the above.

[0019] Through the present application, the following steps are adopted: obtaining an initial test script, where the initial test script is used to test the CAD software; modifying the coordinate acquisition method of the mouse operation point in the initial test script to calculate the coordinates NP (NPx, NPy) of the mouse operation point by using the Delta increment method, and obtaining a modified test script, where the Delta increment method is used to eliminate the influence caused by changes in the test area in the CAD software; running the modified test script to perform an automated test on the CAD software. Through the present application, the problem that in the automated test process of the CAD software in the related art, there is a fine adjustment of the test area range, and the operation point of the mouse needs to be continuously adjusted, resulting in an increase in the maintenance difficulty of the automated test script is solved. By using the Delta increment method to obtain the coordinate value of the mouse operation point in the CAD software automated test script, the influence caused by changes in the test area is eliminated, and thus the effect of reducing the workload of maintaining the automated test script in the later stage is achieved. Description of the Drawings

[0020] The drawings constituting a part of the present application are used to provide a further understanding of the present application. The schematic embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation of the present application. In the drawings:

[0021] Figure 1 is a flowchart of the automated test method of the CAD software provided by the embodiment of the present application;

[0022] Figure 2 is a schematic diagram of an optional automated test area of the CAD software provided by the embodiment of the present application;

[0023] Figure 3It is a schematic diagram of an automated testing device for CAD software provided by an embodiment of the present application. Detailed implementation manners

[0024] It should be noted that, without conflict, the embodiments in the present application and the features in the embodiments may be combined with each other. The present application will be described in detail below with reference to the drawings and in conjunction with the embodiments.

[0025] In order to enable those skilled in the art to better understand the solution of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present application.

[0026] It should be noted that the terms "first", "second", etc. in the specification and claims of the present application and the above drawings are used to distinguish similar objects, and do not necessarily need to be used to describe a specific order or sequence. It should be understood that such data can be interchanged under appropriate circumstances so as to describe the embodiments of the present application here. In addition, the terms "comprising" and "having" and any variations thereof are intended to cover non-exclusive inclusion. For example, a process, method, system, product or device that includes a series of steps or units does not necessarily have to be limited to those steps or units clearly listed, but may include other steps or units not clearly listed or inherent to these processes, methods, products or devices.

[0027] The present invention will be described below in conjunction with the preferred implementation steps. Figure 1 It is a flowchart of an automated testing method for CAD software provided by an embodiment of the present application. As Figure 1 shown, the method includes the following steps:

[0028] Step S101, obtain an initial test script.

[0029] Write an initial test script for the automated testing work of CAD software.

[0030] Step S102, modify the coordinate acquisition method of the mouse operation points in the initial test script to calculate the coordinates NP (NPx, NPy) of the mouse operation points through the Delta incremental method, and obtain the modified test script.

[0031] Rewrite the coordinate values of the mouse operation points in the initial test script to be calculated through the Delta incremental method.

[0032] Step S103: Run the modified test script to perform automated testing on the CAD software.

[0033] Perform automated testing on the CAD software using a test script that calculates the coordinates of the mouse operation point through the Delta incremental method.

[0034] Through the above steps, in the automated test script of the CAD software, the coordinate values of the mouse operation point are obtained using the Delta incremental method, eliminating the influence caused by changes in the test area and reducing the difficulty of maintaining the test script in the later stage.

[0035] Optionally, in the automated test method of the CAD software provided in the embodiments of the present application, the process of testing the CAD software using the initial test script is used as the baseline test process. In the case of the baseline test, the coordinates of the mouse operation point are OP(OPx, OPy), the length of the test area is OL, the width of the test area is OH, and the coordinates of the left vertex of the test area are O(Ox, Oy); the process of testing the CAD software using the modified test script is used as the automated test process. In the case of the automated test, the coordinates of the mouse operation point are NP(NPx, NPy), the length of the test area is NL, the width of the test area is NH, and the coordinates of the left vertex of the test area are N(Nx, Ny).

[0036] First, some variables need to be defined. For example, as Figure 2 shown is a schematic diagram of the test area during the automated test process of the CAD software. The process of testing the CAD software using the initial test script is used as the baseline test process. In the case of the baseline test, the left vertex of the test area is the reference point O(Ox, Oy), the length of the test area is OL, the width of the test area is OH, and the coordinates of the mouse operation point are OP(OPx, OPy). The process of testing the CAD software using the modified test script is used as the automated test process. During the automated test process, the coordinates of the left vertex of the test area are N(Nx, Ny), the length of the test area is NL, the width of the test area is NH, and the coordinates of the mouse operation point are NP(NPx, NPy).

[0037] Defining some variables of the test area is to prepare for calculating the coordinates NP(NPx, NPy) of the mouse operation point through the Delta variable method later.

[0038] Optionally, in the automated testing method for CAD software provided in the embodiments of the present application, the method further includes: in the baseline test scenario, obtaining the initial value of the length OL of the test area and the initial value of the width OH of the test area through a screenshot of the test area; setting the preset coordinate values of the left vertex coordinate O (Ox, Oy) of the test area and the preset coordinate values of the mouse operation point coordinate OP (OPx, OPy); storing the initial value of the length OL of the test area, the initial value of the width OH of the test area, the preset coordinate values of the left vertex coordinate O (Ox, Oy) of the test area, and the preset coordinate values of the mouse operation point coordinate OP (OPx, OPy).

[0039] In the baseline test scenario, the initial values of the length OL and width OH of the test area can be directly obtained from the screenshot of the test area. For example, OL = 800; OH = 600. Set the left vertex coordinate O (Ox, Oy) of the test area and the mouse operation point coordinate OP (OPx, OPy) to the initial values. For example, the left vertex coordinate O (Ox, Oy) of the test area can be set to O (0, 0); the mouse operation point coordinate OP (OPx, OPy) can be set to OP (200, 100). Store the above values for subsequent calls.

[0040] Take the test result obtained from the first run of the automated testing of the CAD software as the baseline. After that, during the automated testing process of the CAD software, compare with the first test to determine whether the test area has changed. In the baseline test scenario, the corresponding data information can be directly obtained through the screenshot of the test area, which is simple and convenient to operate.

[0041] Optionally, in the automated testing method for CAD software provided in the embodiments of the present application, modify the coordinate acquisition method of the mouse operation point in the initial test script to calculate the coordinate NP (NPx, NPy) of the mouse operation point through the Delta increment method. The modified test script obtained includes: setting function one in the initial test script, where function one is used to obtain the coordinate N (Nx, Ny) of the left vertex of the test area, the length NL of the test area, and the width NH of the test area; setting function two in the initial test script, where function two is used to convert the data formats of the coordinate N (Nx, Ny) of the left vertex of the test area, the data format of the length NL of the test area, and the data format of the width NH of the test area; using the initial test script with function one and function two as the modified test script.

[0042] Set Function 1 and Function 2 in the initial test script, and use the initial test script with Function 1 and Function 2 as the modified test script. During the automated testing process, obtain the coordinates N (Nx, Ny) of the left vertex of the test area, the length NL of the test area, and the width NH of the test area in real time through Function 1; convert the obtained data information into the target format through Function 2 for subsequent work calls.

[0043] By setting the corresponding functions, small changes occurring in the test area can be accurately obtained, which helps to accurately adjust the coordinate values of the mouse operation points.

[0044] Optionally, in the automated testing method of the CAD software provided in the embodiments of the present application, the method includes: in the case of automated testing, obtain the coordinate values of N (Nx, Ny), the value of NL, and the value of NH through Function 1; convert the coordinate values of N (Nx, Ny), the value of NL, and the value of NH into the target format through Function 2; store the coordinate values of N (Nx, Ny), the value of NL, and the value of NH in the converted format.

[0045] For example, the coordinate value of the left vertex obtained through Function 1 is N(3, 5); the length NL of the test area = 805; the width NH of the test area = 606. And convert the obtained data into the target format through Function 2, and store the coordinate values of N (Nx, Ny), the value of NL, and the value of NH in the converted format.

[0046] By obtaining the coordinate value of the left vertex of the test area, the length NL of the test area, and the width NH of the test area in real time, the real-time adjustment of the coordinate value of the mouse operation point is realized, and the accuracy of the coordinate value of the mouse operation point is improved.

[0047] Optionally, in the automated testing method of the CAD software provided in the embodiments of the present application, when running the modified test script, it includes: obtaining the adjustment value (Deltax, Deltay) of the left vertex of the test area through O (Ox, Oy) and N (Nx, Ny) using Formula 1, where Formula 1 is Deltax = Nx - Ox; Deltay = Ny - Oy; obtaining the adjustment rates DeltaL and DeltaH of the length and width of the test area through OL, OH, NL, and NH using Formula 2, where Formula 2 is Using Formula 3, calculate the coordinates NP (NPx, NPy) of the mouse operation point, where Formula 3 is NPx = OPx + Deltax - DeltaL * (OPx - Ox), NPy = OPy + Deltay + DeltaH * (OPy - Oy).

[0048] For example, during baseline testing, the length and width of the test area are OL = 800 and OH = 600 respectively, the left vertex coordinate is O(0, 0), and the mouse operation point coordinate is OP(200, 100); during automated testing, the length and width of the test area obtained through Function 1 are NL = 805 and NH = 606 respectively, and the coordinate value of the left vertex is N(3, 5). First, the adjustment values (Deltax, Deltay) of the left vertex of the test area are obtained through Formula 1 (Deltax = Nx - Ox; Deltay = Ny - Oy), that is, Deltax = 3 and Deltay = 5; through Formula 2 the adjustment rates DeltaL and DeltaH of the length and width of the test area are obtained, that is, DeltaL = 0.00625 and DeltaH = 0.01; through Formula 3 (NPx = OPx + Deltax + DeltaL * (OPx - Ox), NPy = OPy + Deltay + DeltaH * (OPy - Oy)), the coordinate NP(NPx, NPy) of the mouse operation point is obtained, that is, NPx = 204.25 and NPy = 106. During actual application, rounding processing is performed on the coordinates of the mouse operation point, that is, the coordinate of the mouse operation point during the automated testing process of the CAD software is NP(204, 106).

[0049] The automated testing method for CAD software provided by the embodiments of the present application obtains an initial test script, where the initial test script is used to test the CAD software; modifies the coordinate acquisition method of the mouse operation point in the initial test script to obtain the coordinate NP(NPx, NPy) of the mouse operation point through the Delta increment method, and obtains the modified test script, where the Delta increment method is used to eliminate the influence brought about by changes in the test area in the CAD software; runs the modified test script to perform automated testing on the CAD software, and solves the problem in the related art that during the automated testing process of the CAD software, fine-tuning of the test area range occurs, and the operation point of the mouse needs to be continuously adjusted, resulting in an increase in the maintenance difficulty of the automated test script. By using the Delta increment method to obtain the coordinate value of the mouse operation point in the CAD software automated test script, the influence brought about by changes in the test area is eliminated, and thus the effect of reducing the workload of maintaining the automated test script in the later stage is achieved.

[0050] It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although the logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in a different order than here.

[0051] The embodiments of the present application also provide an automated test device for CAD software. It should be noted that the automated test device for CAD software in the embodiments of the present application can be used to execute the automated test method for CAD software provided by the embodiments of the present application. The following introduces the automated test device for CAD software provided by the embodiments of the present application.

[0052] Figure 3 It is a schematic diagram of the automated test device for CAD software according to the embodiments of the present application. As Figure 3 shown, the device includes: a first acquisition unit 301, an adjustment unit 302, and an operation unit 303.

[0053] The first acquisition unit 301 is used to acquire an initial test script, where the initial test script is used to test the CAD software.

[0054] The adjustment unit 302 is used to modify the coordinate acquisition method of the mouse operation points in the initial test script to calculate the coordinates NP (NPx, NPy) of the mouse operation points through the Delta incremental method, and obtain the modified test script, where the Delta incremental method is used to eliminate the influence brought by the change of the test area in the CAD software.

[0055] The operation unit 303 is used to run the modified test script to perform an automated test on the CAD software.

[0056] In summary, for the automated test device for CAD software provided by the embodiments of the present application, the first acquisition unit 301 acquires the initial test script; the adjustment unit 302 modifies the coordinate acquisition method of the mouse operation points in the initial test script to calculate the coordinates NP (NPx, NPy) of the mouse operation points through the Delta incremental method, and obtains the modified test script; the operation unit 303 runs the modified test script to perform an automated test on the CAD software, solving the problem in the related art that during the automated test process of the CAD software, due to the fine adjustment of the test area range, the operation points of the mouse need to be continuously adjusted, resulting in an increase in the maintenance difficulty of the automated test script. By using the Delta incremental method to obtain the coordinate values of the mouse operation points in the CAD software automated test script to eliminate the influence brought by the change of the test area, the effect of reducing the workload of maintaining the automated test script in the later stage is achieved.

[0057] Optionally, in the automated test device for CAD software provided in the embodiments of the present application, the process of testing the CAD software with the initial test script is used as the baseline test process. In the baseline test scenario, the coordinates of the mouse operation point are OP(OPx, OPy), the length of the test area is OL, the width of the test area is OH, and the coordinates of the left vertex of the test area are O(Ox, Oy); the process of testing the CAD software with the modified test script is used as the automated test process. In the automated test scenario, the coordinates of the mouse operation point are NP(NPx, NPy), the length of the test area is NL, the width of the test area is NH, and the coordinates of the left vertex of the test area are N(Nx, Ny).

[0058] Optionally, in the automated test device for CAD software provided in the embodiments of the present application, the device further includes: a second acquisition unit, configured to obtain the initial value of the length OL of the test area and the initial value of the width OH of the test area by taking a screenshot of the test area in the baseline test scenario; a setting unit, configured to set the preset coordinate values of the coordinates O(Ox, Oy) of the left vertex of the test area and the preset coordinate values of the coordinates OP(OPx, OPy) of the mouse operation point; a first storage unit, configured to store the initial value of the length OL of the test area, the initial value of the width OH of the test area, the preset coordinate values of the coordinates O(Ox, Oy) of the left vertex of the test area, and the preset coordinate values of the coordinates OP(OPx, OPy) of the mouse operation point.

[0059] Optionally, in the automated test device for CAD software provided in the embodiments of the present application, the adjustment unit includes: a first setting module, configured to set a function one in the initial test script, where the function one is used to obtain the coordinates N(Nx, Ny) of the left vertex of the test area, the length NL of the test area, and the width NH of the test area; a second setting module, configured to set a function two in the initial test script, where the function two is used to convert the data formats of the coordinates N(Nx, Ny) of the left vertex of the test area, the data format of the length NL of the test area, and the data format of the width NH of the test area; and use the initial test script with the function one and the function two as the modified test script.

[0060] Optionally, in the automated test device for CAD software provided in the embodiments of the present application, the device further includes: a third acquisition unit, configured to obtain the coordinate values of N(Nx, Ny), the numerical value of NL, and the numerical value of NH through the function one in the automated test scenario; a first conversion unit, configured to convert the formats of the coordinate values of N(Nx, Ny), the numerical value of NL, and the numerical value of NH into the target format through the function two; and a second storage unit, configured to store the coordinate values of N(Nx, Ny), the numerical value of NL, and the numerical value of NH in the converted format.

[0061] Optionally, in the automated test device for CAD software provided in the embodiments of the present application, the operation unit includes: a first calculation module, configured to obtain the adjustment values (Deltax, Deltay) of the left vertex of the test area by using formula one with O(Ox, Oy) and N(Nx, Ny), where formula one is Deltax = Nx - Ox; Deltay = Ny - Oy; a second calculation module, configured to obtain the adjustment rates DeltaL and DeltaH of the length and width of the test area by using formula two with OL, OH, NL, and NH, where formula two is a third calculation module, configured to calculate the coordinates NP(NPx, NPy) of the mouse operation point by using formula three, where formula three is NPx = OPx + Deltax + DeltaL * (OPx - Ox), NPy = OPy + Deltay + DeltaH * (OPy - Oy).

[0062] The automated test device for the CAD software includes a processor and a memory. The above-mentioned first acquisition unit 301, adjustment unit 302, operation unit 303, etc. are all stored in the memory as program units, and the processor executes the above program units stored in the memory to implement corresponding functions.

[0063] The processor contains a kernel, and the kernel retrieves the corresponding program units from the memory. One or more kernels can be set, and the adjustment of the mouse operation point during the automated test of the CAD software is achieved by adjusting the kernel parameters.

[0064] The memory may include non-permanent memory in a computer-readable medium, random access memory (RAM), and / or non-volatile memory in forms such as read-only memory (ROM) or flash memory (flash RAM), and the memory includes at least one storage chip.

[0065] The embodiments of the present invention provide a storage medium, on which a program is stored, and when the program is executed by a processor, the automated test method for the CAD software is implemented.

[0066] The embodiments of the present invention provide a processor, and the processor is used to run a program, where when the program runs, the automated test method for the CAD software is executed.

[0067] An embodiment of the present invention provides a device, which includes a processor, a memory, and a program stored on the memory and executable on the processor. When the processor executes the program, the following steps are implemented: obtaining an initial test script, where the initial test script is used to test CAD software; modifying the coordinate acquisition method of the mouse operation points in the initial test script to calculate the coordinates NP (NPx, NPy) of the mouse operation points through the Delta incremental method, obtaining a modified test script, where the Delta incremental method is used to eliminate the influence brought by the change of the test area in CAD software; running the modified test script to perform an automated test on the CAD software.

[0068] Optionally, taking the process of testing the CAD software through the initial test script as a baseline test process. In the case of the baseline test, the coordinates of the mouse operation points are OP (OPx, OPy), the length of the test area is OL, the width of the test area is OH, and the coordinates of the left vertex of the test area are O (Ox, Oy); taking the process of testing the CAD software through the modified test script as an automated test process. In the case of the automated test, the coordinates of the mouse operation points are NP (NPx, NPy), the length of the test area is NL, the width of the test area is NH, and the coordinates of the left vertex of the test area are N (Nx, Ny).

[0069] Optionally, the method further includes: in the case of the baseline test, obtaining the initial value of the length OL of the test area and the initial value of the width OH of the test area through a screenshot of the test area; setting the preset coordinate values of the coordinates O (Ox, Oy) of the left vertex of the test area and the preset coordinate values of the coordinates OP (OPx, OPy) of the mouse operation points; storing the initial value of the length OL of the test area, the initial value of the width OH of the test area, the preset coordinate values of the coordinates O (Ox, Oy) of the left vertex of the test area, and the preset coordinate values of the coordinates OP (OPx, OPy) of the mouse operation points.

[0070] Optionally, modifying the coordinate acquisition method of the mouse operation points in the initial test script to calculate the coordinates NP (NPx, NPy) of the mouse operation points through the Delta incremental method and obtaining a modified test script includes: setting a function one in the initial test script, where the function one is used to obtain the coordinates N (Nx, Ny) of the left vertex of the test area, the length NL of the test area, and the width NH of the test area; setting a function two in the initial test script, where the function two is used to convert the data formats of the coordinates N (Nx, Ny) of the left vertex of the test area, the data format of the length NL of the test area, and the data format of the width NH of the test area; taking the initial test script with the function one and the function two as the modified test script.

[0071] Optionally, the method includes: in the case of automated testing, obtaining the coordinate values of N (Nx, Ny), the value of NL, and the value of NH through Function 1; converting the coordinate values of N (Nx, Ny), the value of NL, and the value of NH into a target format through Function 2; and storing the coordinate values of N (Nx, Ny), the value of NL, and the value of NH in the converted format.

[0072] Optionally, when running the modified test script, it includes: obtaining the adjustment values (Deltax, Deltay) of the left vertex of the test area through O (Ox, Oy) and N (Nx, Ny) using Formula 1, where Formula 1 is Deltax = Nx - Ox; Deltay = Ny - Oy; obtaining the adjustment rates DeltaL and DeltaH of the length and width of the test area through OL, OH, NL, and NH using Formula 2, where Formula 2 is Using Formula 3, calculating the coordinates NP (NPx, NPy) of the mouse operation point, where Formula 3 is NPx = OPx + Deltax + DeltaL * (OPx - Ox), NPy = OPy + Deltay + DeltaH * (OPy - Oy). The device in this article can be a server, PC, PAD, mobile phone, etc.

[0073] This application also provides a computer program product, which, when executed on a data processing device, is adapted to execute a program initialized with the following method steps: obtaining an initial test script, where the initial test script is used to test CAD software; modifying the coordinate acquisition method of the mouse operation point in the initial test script to calculate the coordinates NP (NPx, NPy) of the mouse operation point through the Delta increment method, obtaining a modified test script, where the Delta increment method is used to eliminate the influence caused by changes in the test area in CAD software; and running the modified test script to perform automated testing on CAD software.

[0074] Optionally, taking the process of testing CAD software through the initial test script as a baseline test process, in the case of the baseline test, the coordinates of the mouse operation point are OP (OPx, OPy), the length of the test area is OL, the width of the test area is OH, and the left vertex coordinates of the test area are O (Ox, Oy); taking the process of testing CAD software through the modified test script as an automated test process, in the case of automated testing, the coordinates of the mouse operation point are NP (NPx, NPy), the length of the test area is NL, the width of the test area is NH, and the coordinates of the left vertex of the test area are N (Nx, Ny).

[0075] Optionally, the method further includes: in the case of baseline testing, obtaining the initial value of the length OL of the test area and the initial value of the width OH of the test area through a screenshot of the test area; setting the preset coordinate values of the left vertex coordinates O (Ox, Oy) of the test area and the preset coordinate values of the mouse operation point coordinates OP (OPx, OPy); storing the initial value of the length OL of the test area, the initial value of the width OH of the test area, the preset coordinate values of the left vertex coordinates O (Ox, Oy) of the test area, and the preset coordinate values of the mouse operation point coordinates OP (OPx, OPy).

[0076] Optionally, modify the coordinate acquisition method of the mouse operation point in the initial test script to calculate the coordinates NP (NPx, NPy) of the mouse operation point through the Delta increment method. The modified test script obtained includes: setting function one in the initial test script, where function one is used to obtain the coordinates N (Nx, Ny) of the left vertex of the test area, the length NL of the test area, and the width NH of the test area; setting function two in the initial test script, where function two is used to convert the data formats of the coordinates N (Nx, Ny) of the left vertex of the test area, the data format of the length NL of the test area, and the data format of the width NH of the test area; using the initial test script with function one and function two as the modified test script.

[0077] Optionally, the method includes: in the case of automated testing, obtaining the coordinate values of N (Nx, Ny), the numerical value of NL, and the numerical value of NH through function one; converting the data formats of the coordinate values of N (Nx, Ny), the numerical value of NL, and the numerical value of NH to the target format through function two; storing the coordinate values of N (Nx, Ny), the numerical value of NL, and the numerical value of NH after the format conversion.

[0078] Optionally, when running the modified test script, it includes: obtaining the adjustment values (Deltax, Deltay) of the left vertex of the test area through O (Ox, Oy) and N (Nx, Ny) using formula one, where formula one is Deltax = Nx - Ox; Deltay = Ny - Oy; obtaining the adjustment rates DeltaL and DeltaH of the length and width of the test area through OL, OH, NL, and NH using formula two, where formula two is Calculating the coordinates NP (NPx, NPy) of the mouse operation point using formula three, where formula three is NPx = OPx + Deltax + DeltaL * (OPx - Ox), NPy = OPy + Deltay + DeltaH * (OPy - Oy).

[0079] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can take the form of a complete hardware embodiment, a complete software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0080] The present application is described with reference to the flowcharts and / or block diagrams of methods, apparatuses (systems), and computer program products according to the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams, can be realized by computer program instructions. These computer program instructions can be provided to the processors of a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to generate a machine, so that the instructions executed by the processors of the computer or other programmable data processing devices generate a device for realizing the functions specified in Figure 1 one or more flows and / or blocks Figure 1 or more blocks.

[0081] These computer program instructions can also be stored in a computer-readable memory that can direct a computer or other programmable data processing device to work in a specific manner, so that the instructions stored in the computer-readable memory generate a manufactured article including an instruction device, and the instruction device realizes the functions specified in Figure 1 one or more flows and / or blocks Figure 1 or more blocks.

[0082] These computer program instructions can also be loaded onto a computer or other programmable data processing device, so that a series of operation steps are executed on the computer or other programmable device to generate a computer-implemented process. Thus, the instructions executed on the computer or other programmable device provide steps for realizing the functions specified in Figure 1 one or more flows and / or blocks Figure 1 or more blocks.

[0083] In a typical configuration, a computing device includes one or more processors (CPUs), an input / output interface, a network interface, and a memory.

[0084] The memory may include non-permanent memory in a computer-readable medium, in the form of random access memory (RAM) and / or non-volatile memory, such as read-only memory (ROM) or flash memory (flash RAM). The memory is an example of a computer-readable medium.

[0085] A computer-readable medium includes both permanent and non-permanent, removable and non-removable media that can store information by any method or technology. The information can be computer-readable instructions, data structures, program modules, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), static random access memory (SRAM), dynamic random access memory (DRAM), other types of random access memory (RAM), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory or other memory technologies, compact disc read-only memory (CD-ROM), digital versatile discs (DVD) or other optical storage, magnetic cassettes, magnetic tape, magnetic disk storage or other magnetic storage devices, or any other non-transitory medium that can be used to store information that can be accessed by a computing device. As defined herein, a computer-readable medium does not include transitory computer-readable media such as modulated data signals and carrier waves.

[0086] It should also be noted that the term "comprising", "including" or any other variation thereof is intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but also other elements not expressly listed, or elements that are inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising a..." does not exclude the presence of additional identical elements in the process, method, article, or apparatus that comprises the element.

[0087] Those skilled in the art will appreciate that the embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) that contain computer-usable program code.

[0088] The above are only embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included within the scope of the claims of the present application.

Claims

1. An automated testing method for CAD software, characterized in that, Including: Obtain an initial test script, where the initial test script is used to test CAD software; Modify the coordinate acquisition method of the mouse operation points in the initial test script to calculate the coordinates NP (NPx, NPy) of the mouse operation points through the Delta incremental method, and obtain the modified test script, where the Delta incremental method is used to eliminate the influence caused by changes in the test area in the CAD software; Run the modified test script to perform automated testing on the CAD software; Among them, the process of testing the CAD software through the initial test script is used as the baseline test process. In the case of the baseline test, the coordinates of the mouse operation point are OP (OPx, OPy), the length of the test area is OL, the width of the test area is OH, and the coordinates of the left vertex of the test area are O (Ox, Oy); the process of testing the CAD software through the modified test script is used as the automated test process. In the case of the automated test, the coordinates of the mouse operation point are NP (NPx, NPy), the length of the test area is NL, the width of the test area is NH, and the coordinates of the left vertex of the test area are N (Nx, Ny); Modifying the coordinate acquisition method of the mouse operation points in the initial test script to calculate the coordinates NP (NPx, NPy) of the mouse operation points through the Delta incremental method and obtaining the modified test script includes: Set function one in the initial test script, and function one is used to obtain the coordinates N (Nx, Ny) of the left vertex of the test area, the length NL of the test area, and the width NH of the test area; Set function two in the initial test script, and function two is used to convert the data formats of the coordinates N (Nx, Ny) of the left vertex of the test area, the data format of the length NL of the test area, and the data format of the width NH of the test area; Use the initial test script with function one and function two as the modified test script; When running the modified test script, it includes: Use formula one through O (Ox, Oy) and N (Nx, Ny) to obtain the adjustment values (Deltax, Deltay) of the left vertex of the test area, where formula one is Deltax = Nx - Ox; Deltay = Ny - Oy; By using OL, OH, NL, and NH in Formula 2, the adjustment rates DeltaL and DeltaH of the length and width of the test area are obtained, where Formula 2 is Use formula three to calculate the coordinates NP (NPx, NPy) of the mouse operation point, where formula three is NPx = OPx + Deltax + DeltaL * (OPx - Ox), NPy = OPy + Deltay + DeltaH * (OPy - Oy).

2. The method according to claim 1, wherein The method further includes: In the case of the baseline test, obtain the initial value of the length OL of the test area and the initial value of the width OH of the test area through the screenshot of the test area; Set the preset coordinate values of the left vertex coordinate O(Ox, Oy) of the test area and the preset coordinate values of the mouse operation point coordinate OP(OPx, OPy). Store the initial value of the length OL of the test area, the initial value of the width OH of the test area, the preset coordinate values of the left vertex coordinate O(Ox, Oy) of the test area, and the preset coordinate values of the mouse operation point coordinate OP(OPx, OPy).

3. The method according to claim 1, characterized in that The method includes: In the case of the automated test, obtain the coordinate values of N(Nx, Ny), the value of NL, and the value of NH through the first function. Convert the coordinate values of N(Nx, Ny), the value of NL, and the value of NH into the target format through the second function. Store the converted coordinate values of N(Nx, Ny), the value of NL, and the value of NH.

4. An automated testing device for CAD software, characterized in that, It includes: A first acquisition unit for acquiring an initial test script, where the initial test script is used to test CAD software. An adjustment unit for modifying the coordinate acquisition method of the mouse operation point in the initial test script to calculate the coordinate NP(NPx, NPy) of the mouse operation point through the Delta incremental method, and obtaining the modified test script, where the Delta incremental method is used to eliminate the influence caused by changes in the test area in the CAD software. A running unit for running the modified test script to perform an automated test on the CAD software. Among them, the process of testing the CAD software through the initial test script is used as the baseline test process. In the case of the baseline test, the coordinate of the mouse operation point is OP(OPx, OPy), the length of the test area is OL, the width of the test area is OH, and the left vertex coordinate of the test area is O(Ox, Oy); the process of testing the CAD software through the modified test script is used as the automated test process. In the case of the automated test, the coordinate of the mouse operation point is NP(NPx, NPy), the length of the test area is NL, the width of the test area is NH, and the coordinate of the left vertex of the test area is N(Nx, Ny). The adjustment unit includes: A first setting module for setting the first function in the initial test script, where the first function is used to obtain the coordinate N(Nx, Ny) of the left vertex of the test area, the length NL of the test area, and the width NH of the test area. A second setting module for setting the second function in the initial test script, where the second function is used to convert the data format of the coordinate N(Nx, Ny) of the left vertex of the test area, the data format of the length NL of the test area, and the data format of the width NH of the test area; and using the initial test script with the first function and the second function as the modified test script. The running unit includes: The first calculation module is used to obtain the adjustment values (Deltax, Deltay) of the left vertex of the test area by using the formula one with the O(Ox, Oy) and the N(Nx, Ny), where the formula one is Deltax = Nx - Ox; Deltay = Ny - Oy; A second calculation module, configured to obtain adjustment rates ΔL and ΔH of the length and width of the test area by using formula two with OL, OH, NL, and NH, where formula two is The third calculation module is used to calculate the coordinates NP(NPx, NPy) of the mouse operation point by using the formula three, where the formula three is NPx = OPx + Deltax + DeltaL * (OPx - Ox), NPy = OPy + Deltay + DeltaH * (OPy - Oy).

5. A computer-readable storage medium, characterized in that The storage medium includes a stored program, where the program executes the automated test method of the CAD software described in any one of claims 1 to 3.

6. A processor, characterized in that, The processor is used to run a program, where the program executes the automated test method of the CAD software described in any one of claims 1 to 3 when running.

Citation Information

Patent Citations

  • Testing method and device

    CN104679627A

  • Positioning method and apparatus of detection area of display screen

    CN108414193A