CN114116485A - Automatic test method and device for CAD software, storage medium and processor - Google Patents

Automatic test method and device for CAD software, storage medium and processor Download PDF

Info

Publication number
CN114116485A
CN114116485A CN202111426165.1A CN202111426165A CN114116485A CN 114116485 A CN114116485 A CN 114116485A CN 202111426165 A CN202111426165 A CN 202111426165A CN 114116485 A CN114116485 A CN 114116485A
Authority
CN
China
Prior art keywords
test
test area
cad software
initial
script
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111426165.1A
Other languages
Chinese (zh)
Inventor
鞠珍宏
李龙
靳丽斯
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Caxa Technology Co Ltd
Original Assignee
Caxa Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Caxa Technology Co Ltd filed Critical Caxa Technology Co Ltd
Priority to CN202111426165.1A priority Critical patent/CN114116485A/en
Publication of CN114116485A publication Critical patent/CN114116485A/en
Pending legal-status Critical Current

Links

Images

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)

Abstract

The application discloses an automatic test method and device of CAD software, a storage medium and a processor. The method comprises the following steps: acquiring an initial test script, wherein the initial test script is used for testing the CAD software; modifying the coordinate acquisition mode of the mouse operation point in the initial test script into a mode of calculating the coordinates NP (NPx, NPy) of the mouse operation point by a Delta incremental method to obtain a modified test script, wherein the Delta incremental method is used for eliminating the influence caused by the change of a test area in CAD software; and running the modified test script to automatically test the CAD software. By the method and the device, the problems that the automatic test script maintenance difficulty is increased due to the fact that the fine adjustment of the test area range is generated in the automatic test process of the CAD software in the related technology and the operation point of the mouse needs to be adjusted continuously are solved.

Description

Automatic test method and device for CAD software, storage medium and processor
Technical Field
The application relates to the technical field of computer software, in particular to an automatic test method and device of CAD software, a storage medium and a processor.
Background
In order to ensure that various functions of a computer software product can normally operate and reduce the manual testing cost, more and more enterprises adopt an automatic testing method to ensure the quality of the product. Most of the automatic tests of CAD software are based on the automatic tests of GUI objects, and a large number of mouse operations are carried out in the operation process, and the operations which can be executed at different position points are different. Once the test area is trimmed due to problems such as calculation accuracy, the operation point of the mouse needs to be continuously adjusted to ensure the normal operation of the automatic test, so that the adjustment work of the operation point of the mouse is continuously performed, and the maintenance difficulty of subsequent scripts and the workload of testers are increased.
Aiming at the problems that the automatic test script maintenance difficulty is increased due to the fact that the fine adjustment of the test area range is generated in the automatic test process of CAD software in the related technology and the operation point of a mouse needs to be adjusted continuously, an effective solution is not provided at present.
Disclosure of Invention
The main objective of the present application is to provide an automated testing method and apparatus, a storage medium, and a processor for CAD software, so as to solve the problem in the related art that the difficulty of maintaining an automated testing script is increased due to the fact that the operating point of a mouse needs to be continuously adjusted when the test area range is finely adjusted in the automated testing process of the CAD software.
In order to achieve the above object, according to one aspect of the present application, there is provided an automated test method of CAD software. The method comprises the following steps: acquiring an initial test script, wherein the initial test script is used for testing CAD software; modifying the coordinate acquisition mode of the mouse operation point in the initial test script into a mode of calculating and obtaining coordinates NP (NPx, NPy) of the mouse operation point by a Delta incremental method to obtain a modified test script, wherein the Delta incremental method is used for eliminating the influence caused by the change of a test area in the CAD software; and running the modified test script to automatically test the CAD software.
Further, taking a process of testing the CAD software by the initial test script as a baseline test process, in the baseline test case, coordinates of the mouse operation point are OP (OPx, OPy), a length of the test area is OL, a width of the test area is OH, and left vertex coordinates O (Ox, Oy) of the test area; and taking the process of testing the CAD software by the modified test script as an automatic test process, wherein under the condition of the automatic test, the coordinates of the mouse operating 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).
Further, the method further comprises: under the baseline test condition, acquiring an initial value of the length OL of the test area and an initial value of the width OH of the test area through the screenshot of the test area; setting a preset coordinate value of a left vertex coordinate O (Ox, Oy) of the test area and a preset coordinate value of a mouse operating point coordinate OP (OPx, OPy); storing an initial value of the length OL of the test area, an initial value of the width OH of the test area, a preset coordinate value of a left vertex coordinate O (Ox, Oy) of the test area, and a preset coordinate value of the mouse operation point coordinate OP (OPx, OPy).
Further, modifying the coordinate acquisition mode of the mouse operation point in the initial test script into a coordinate NP (NPx, NPy) of the mouse operation point calculated by a Delta incremental method, wherein obtaining the modified test script comprises: setting a function I in the initial test script, wherein the function I is used for acquiring 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 a second function in the initial test script, wherein the second function is used for converting 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 taking the initial test script with the first function and the second function as a modified test script.
Further, the method comprises: in the case of the automated test, obtaining the coordinate values of N (Nx, Ny), the numerical value of NL and the numerical value of NH through the first function; converting 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 second function; storing the coordinate values of N (Nx, Ny), the numerical value of NL and the numerical value of NH in the converted format.
Go toStep one, when the modified test script is run, the method comprises the following steps: obtaining an adjustment value (Deltax, Deltay) of a left vertex of the test area by using a formula one through the O (Ox, Oy) and the N (Nx, Ny), wherein the formula one is that Deltax is Nx-Ox; deltay is Ny-Oy; obtaining adjustment rates DeltaL and DeltaH of the length and the width of the test area by adopting a formula II through OL, OH, NL and NH, wherein the formula II is
Figure BDA0003378504840000021
And calculating coordinates NP (NPx, NPy) of the mouse operation point by adopting a formula III, wherein the formula III is NPx-OPx + Deltax + DeltaL (OPx-Ox), and NPy-OPy + Deltay + DeltaH (OPy-Oy).
In order to achieve the above object, according to another aspect of the present application, there is provided an automated test apparatus for CAD software. The device includes: the device comprises a first obtaining unit, a second obtaining unit and a third obtaining unit, wherein the first obtaining unit is used for obtaining an initial test script, and the initial test script is used for testing CAD software; the adjusting unit is used for modifying the coordinate acquisition mode of the mouse operation point in the initial test script into a coordinate NP (NPx, NPy) of the mouse operation point calculated by a Delta incremental method to obtain a modified test script, wherein the Delta incremental method is used for eliminating the influence caused by the change of a test area in the CAD software; and the running unit is used for running the modified test script so as to automatically test the CAD software.
Further, taking a process of testing the CAD software by the initial test script as a baseline test process, in the baseline test case, coordinates of the mouse operation point are OP (OPx, OPy), a length of the test area is OL, a width of the test area is OH, and left vertex coordinates O (Ox, Oy) of the test area; and taking the process of testing the CAD software by the modified test script as an automatic test process, wherein under the condition of the automatic test, the coordinates of the mouse operating 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).
Further, the device further comprises a second acquiring unit, configured to acquire, in the baseline test case, an initial value of a length OL of the test area and an initial value of a width OH of the test area through a screenshot of the test area; a setting unit for setting a preset coordinate value of a left vertex coordinate O (Ox, Oy) of the test area and a preset coordinate value of the mouse operation point coordinate OP (OPx, OPy); a first storage unit for storing an initial value of a length OL of the test area, an initial value of a width OH of the test area, a preset coordinate value of a left vertex coordinate O (Ox, Oy) of the test area, and a preset coordinate value of the mouse operation point coordinate OP (OPx, OPy).
Further, the adjusting unit includes: a first setting module, configured to set a first function in the initial test script, where the first function is used to obtain a coordinate N (Nx, Ny) of a left vertex of the test area, a length NL of the test area, and a width NH of the test area; a second setting module, configured to set a second function in the initial test script, where the second function is used to convert a data format of a coordinate N (Nx, Ny) of a left vertex of the test area, a data format of a length NL of the test area, and a data format of a width NH of the test area; and taking the initial test script with the first function and the second function as a modified test script.
Further, the apparatus comprises: a third obtaining unit, configured to obtain, in the case of the automated test, the coordinate value of N (Nx, Ny), the numerical value of NL, and the numerical value of NH through the first function; a first conversion unit, configured to convert the coordinate values of N (Nx, Ny), the formats of the numerical value of NL and the numerical value of NH into a target format through the second function; 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.
Further, the operation unit includes: a first calculating module, configured to obtain a left vertex of the test area by using a formula one through the O (Ox, Oy) and the N (Nx, Ny)The adjustment value (Deltax, Deltay), wherein the first formula is Deltax ═ Nx-Ox; deltay is Ny-Oy; a second calculating module, configured to obtain adjustment rates DeltaL and DeltaH of the length of the test area and the width of the test area by using a second formula through OL, OH, NL, and NH, where the second formula is
Figure BDA0003378504840000031
And the third calculating module is used for calculating the coordinates NP (NPx, NPy) of the mouse operation point by adopting a formula III, wherein the formula III is NPx-OPx + Deltax + DeltaL (Opx-Ox), and NPy-OPy + Deltay + DeltaH (OPy-Oy).
In order to achieve the above object, according to another aspect of the present application, there is provided a computer-readable storage medium including a stored program, wherein the program executes the automated test method for CAD software according to any one of the above.
In order to achieve the above object, according to another aspect of the present application, there is provided a processor for executing a program, wherein the program executes an automated testing method of CAD software according to any one of the above aspects.
Through the application, the following steps are adopted: acquiring an initial test script, wherein the initial test script is used for testing CAD software; modifying the coordinate acquisition mode of the mouse operation point in the initial test script into a mode of calculating and obtaining coordinates NP (NPx, NPy) of the mouse operation point by a Delta incremental method to obtain a modified test script, wherein the Delta incremental method is used for eliminating the influence caused by the change of a test area in the CAD software; and running the modified test script to automatically test the CAD software. By the method and the device, the problems that the automatic test script maintenance difficulty is increased due to the fact that the fine adjustment of the test area range is generated in the automatic test process of the CAD software in the related technology and the operation point of the mouse needs to be adjusted continuously are solved. The coordinate value of the mouse operation point is obtained by utilizing a Delta increment method in the CAD software automatic test script, so that the influence caused by the change of the test area is eliminated, and the effect of reducing the workload of the later maintenance automatic test script is further achieved.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this application, illustrate embodiments of the application and, together with the description, serve to explain the application and are not intended to limit the application. In the drawings:
FIG. 1 is a flow chart of a method for automated testing of CAD software according to an embodiment of the present application;
FIG. 2 is a schematic diagram of an alternative automated test area of CAD software provided in accordance with an embodiment of the present application;
fig. 3 is a schematic diagram of an automated testing apparatus for CAD software according to an embodiment of the present application.
Detailed Description
It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict. The present application will be described in detail below with reference to the embodiments with reference to the attached drawings.
In order to make the technical solutions better understood by those skilled in the art, 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, and it is obvious that the described embodiments are only partial embodiments of the present application, but not all embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
It should be noted that the terms "first," "second," and the like in the description and claims of this application and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It should be understood that the data so used may be interchanged under appropriate circumstances such that embodiments of the application described herein may be used. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
The present invention is described below with reference to preferred implementation steps, and fig. 1 is a flowchart of an automated CAD software testing method according to an embodiment of the present application, as shown in fig. 1, the method includes the following steps:
step S101, obtaining an initial test script.
And writing an initial test script aiming at the automatic test work of the CAD software.
Step S102, the coordinate obtaining mode of the mouse operation point in the initial test script is modified to obtain the coordinates NP (NPx, NPy) of the mouse operation point through the calculation of a Delta incremental method, and the modified test script is obtained.
And rewriting the coordinate values of the mouse operation points in the initial test script into the coordinate values calculated by a Delta incremental method.
And step S103, running the modified test script to automatically test the CAD software.
And automatically testing the CAD software by using a test script which is calculated by a Delta incremental method to obtain the coordinates of the mouse operating point.
Through the steps, in the CAD software automatic test script, the coordinate value of the mouse operation point is obtained by using the Delta incremental method, the influence caused by the change of the test area is eliminated, and the difficulty of the maintenance work of the test script in the later period is reduced.
Optionally, in the automated testing method for CAD software provided in this embodiment of the present application, a process of testing the CAD software through an initial test script is taken as a baseline testing process, under a baseline testing condition, coordinates of a mouse operating point are OP (OPx, OPy), a length of a test area is OL, a width of the test area is OH, and left vertex coordinates O (Ox, Oy) of the test area; and taking the process of testing the CAD software by the modified test script as an automatic test process, wherein under the condition of automatic test, the coordinates of the mouse operating point are NP (NPx, NPy), the length of the test area is NL, the width of the test area is NH, and the coordinates N (Nx, Ny) of the left vertex of the test area.
Some variables are defined first, for example, as shown in fig. 2, a schematic diagram of a test area in the CAD software automation test process is shown. And taking the process of testing the CAD software through the initial test script as a baseline test process. In the baseline test case, 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). And taking the process of testing the CAD software through the modified test script as an automatic test process. In 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).
Some of the variables of the test area are defined to provide for the subsequent calculation of the coordinates NP (NPx, NPy) of the mouse operating point by the Delta-variational method.
Optionally, in the method for automatically testing CAD software provided in the embodiment of the present application, the method further includes: under the condition of baseline test, acquiring an initial value of the length OL of the test area and an initial value of the width OH of the test area through the screenshot of the test area; setting a preset coordinate value of a left vertex coordinate O (Ox, Oy) of the test area and a preset coordinate value of a mouse operating point coordinate OP (OPx, OPy); an initial value of the length OL of the test area, an initial value of the width OH of the test area, 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) are stored.
In the baseline test case, the length OL and width OH of the test area can be directly obtained from the test area screenshot to obtain initial values, for example OL 800; OH 600. Setting left vertex coordinates O (Ox, Oy) and mouse operation point coordinates OP (OPx, OPy) of the test area to initial values, for example, the left vertex coordinates O (Ox, Oy) of the test area may be set to O (0, 0); the mouse operation point coordinates OP (OPx, OPy) may be set to OP (200, 100). And storing the numerical values for later calling.
And taking a test result obtained by the automatic test of the CAD software running for the first time as a baseline, and then comparing the test result with the first test in the automatic test process of the CAD software to determine whether the test area changes. Under the condition of baseline test, corresponding data information can be obtained directly through the screenshot of the test area, and the operation is simple and convenient.
Optionally, in the automatic test method for CAD software provided in this embodiment of the present application, the obtaining method of the coordinates of the mouse operation point in the initial test script is modified to obtain the coordinates NP (NPx, NPy) of the mouse operation point through Delta incremental calculation, and the obtaining of the modified test script includes: setting a function I in the initial test script, wherein the function I is used for acquiring 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 second function in the initial test script, wherein the second function is used for converting 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 taking the initial test script with the function one and the function two as a modified test script.
And setting a function I and a function II in the initial test script, and taking the initial test script with the function I and the function II as a modified test script. In the process of automatic testing, obtaining the coordinates N (Nx, Ny) of the left vertex of the testing area, the length NL of the testing area and the width NH of the testing area in real time through a function I; and converting the data information obtained by the function pair into a target format for subsequent work calling.
The small change of the test area can be accurately obtained by setting the corresponding function, and the coordinate value of the mouse operation point can be accurately adjusted.
Optionally, in the method for automatically testing CAD software provided in the embodiment of the present application, the method includes: in the case of an automatic test, obtaining coordinate values of N (Nx, Ny), numerical values of NL and numerical values of NH through a first function; converting the coordinate values of N (Nx, Ny), the numerical values of NL and the numerical values of NH into target formats by a function II; the coordinate values of N (Nx, Ny), the numerical values of NL and the numerical values of NH of the converted format are stored.
For example, the coordinate value of the left vertex acquired by the function one is N (3, 5); the length NL of the test area is 805; the width NH of the test area is 606. And converting the acquired data into a target format through a second function, and storing coordinate values of N (Nx, Ny), numerical values of NL and numerical values of NH in the converted format.
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 are obtained in real time, so that the coordinate value of the mouse operation point is adjusted in real time, and the accuracy of the coordinate value of the mouse operation point is improved.
Optionally, in the automated testing method for CAD software provided in the embodiment of the present application, when running the modified test script, the method includes: obtaining an adjustment value (Deltax, Deltay) of a left vertex of the test area by adopting a formula I through O (Ox, Oy) and N (Nx, Ny), wherein the formula I is that Deltax is Nx-Ox; deltay is Ny-Oy; obtaining adjustment rates DeltaL and DeltaH of the length and the width of the test area by OL, OH, NL and NH by adopting a formula II, wherein the formula II is
Figure BDA0003378504840000071
And calculating coordinates NP (NPx, NPy) of the mouse operation point by adopting a formula III, wherein the formula III is NPx-OPx + Deltax-DeltaL (OPx-Ox), and NPy-OPy + Deltay + DeltaH (OPy-Oy).
For example, in the baseline test, the length and width of the test area are OL 800, OH 600, left vertex coordinate O (0, 0), and mouse operation point coordinate OP (200, 100); in the automatic test, the length and width of the test area obtained by the first function are NL or 805, NH or 606, and the coordinate value of the left vertex is N (3 or 5). Firstly, obtaining an adjustment value (Deltax, Deltay) of a left vertex of the test area through a formula I (Deltax ═ Nx-Ox; Deltay ═ Ny-Oy), namely Deltax ═ 3 and Deltay ═ 5; by the formula two
Figure BDA0003378504840000072
Figure BDA0003378504840000073
Obtaining adjustment rates DeltaL and DeltaH of the length and the width of the test area, namely DeltaL is 0.00625 and DeltaH is 0.01; obtaining coordinates NP (NPx, NPy) of the mouse operation point through a formula III (NPx-OPx + Deltax + DeltaL (OPx-Ox), NPy-OPy + Deltay + DeltaH (OPy-Oy)), namely NPx-204.25 and NPy-106, and performing rounding processing on the coordinates of the mouse operation point in the actual application process, namely the coordinates of the mouse operation point in the CAD software automatic test process are NP (204, 106).
According to the automatic test method of the CAD software, the initial test script is obtained, wherein the initial test script is used for testing the CAD software; modifying the coordinate acquisition mode of the mouse operation point in the initial test script into a mode of calculating the coordinates NP (NPx, NPy) of the mouse operation point by a Delta incremental method to obtain a modified test script, wherein the Delta incremental method is used for eliminating the influence caused by the change of a test area in CAD software; the modified test script is operated to automatically test the CAD software, and the problems that the automatic test script is difficult to maintain due to the fact that the operating point of a mouse needs to be continuously adjusted and fine adjustment of the range of a test area is generated in the automatic test process of the CAD software in the related technology are solved. The coordinate value of the mouse operation point is obtained by utilizing a Delta increment method in the CAD software automatic test script, so that the influence caused by the change of the test area is eliminated, and the effect of reducing the workload of the later maintenance automatic test script is further achieved.
It should be noted that the steps illustrated in the flowcharts of the figures may be performed in a computer system such as a set of computer-executable instructions and that, although a logical order is illustrated in the flowcharts, in some cases, the steps illustrated or described may be performed in an order different than presented herein.
The embodiment of the present application further provides an automatic test device for CAD software, and it should be noted that the automatic test device for CAD software of the embodiment of the present application can be used to execute the automatic test method for CAD software provided by the embodiment of the present application. The following describes an automated testing apparatus for CAD software provided in an embodiment of the present application.
Fig. 3 is a schematic diagram of an automated testing apparatus for CAD software according to an embodiment of the present application. As shown in fig. 3, the apparatus includes: a first acquisition unit 301, an adjustment unit 302 and an operation unit 303.
A first obtaining unit 301, configured to obtain an initial test script, where the initial test script is used to test the CAD software.
An adjusting unit 302, configured to modify a coordinate obtaining manner of the mouse operation point in the initial test script to obtain a coordinate NP (NPx, NPy) of the mouse operation point through calculation by using a Delta incremental method, so as to obtain a modified test script, where the Delta incremental method is used to eliminate an influence caused by a change in a test area in CAD software.
And the running unit 303 is used for running the modified test script so as to perform automatic test on the CAD software.
To sum up, the automatic test device for CAD software provided in the embodiment of the present application obtains an initial test script through the first obtaining unit 301; the adjusting unit 302 modifies the coordinate obtaining mode of the mouse operation point in the initial test script into the coordinate NP (NPx, NPy) of the mouse operation point calculated by the Delta incremental method, so as to obtain the modified test script; the operation unit 303 operates the modified test script to automatically test the CAD software, thereby solving the problem that the maintenance difficulty of the automatic test script is increased due to the fine adjustment of the test area range generated in the automatic test process of the CAD software in the related art and the continuous adjustment of the operation point of the mouse. The coordinate value of the mouse operation point is obtained by utilizing a Delta increment method in the CAD software automatic test script, so that the influence caused by the change of the test area is eliminated, and the effect of reducing the workload of the later maintenance automatic test script is further achieved.
Optionally, in the automatic testing apparatus for CAD software provided in this embodiment of the present application, a process of testing the CAD software through an initial test script is taken as a baseline testing process, in a case of the baseline testing, coordinates of a mouse operating point are OP (OPx, OPy), a length of a test area is OL, a width of the test area is OH, and left vertex coordinates O (Ox, Oy) of the test area; and taking the process of testing the CAD software by the modified test script as an automatic test process, wherein under the condition of automatic test, the coordinates of the mouse operating point are NP (NPx, NPy), the length of the test area is NL, the width of the test area is NH, and the coordinates N (Nx, Ny) of the left vertex of the test area.
Optionally, in the automatic testing apparatus for CAD software provided in an embodiment of the present application, the apparatus further includes: the second acquisition unit is used for acquiring an initial value of the length OL of the test area and an initial value of the width OH of the test area through the screenshot of the test area under the condition of baseline test; a setting unit for setting a preset coordinate value of a left vertex coordinate O (Ox, Oy) and a preset coordinate value of a mouse operation point coordinate OP (OPx, OPy) of the test area; a first storage unit for storing an initial value of a length OL of the test area, an initial value of a width OH of the test area, a preset coordinate value of a left vertex coordinate O (Ox, Oy) of the test area, and a preset coordinate value of a mouse operation point coordinate OP (OPx, OPy).
Optionally, in the automatic testing apparatus for CAD software provided in an embodiment of the present application, the adjusting unit includes: the first setting module is used for setting a first function in the initial test script, wherein the first function is used for acquiring 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 second function in the initial test script, where the second function is used to convert a data format of a coordinate N (Nx, Ny) of a left vertex of the test area, a data format of a length NL of the test area, and a data format of a width NH of the test area; and taking the initial test script with the function one and the function two as a modified test script.
Optionally, in the automatic testing apparatus for CAD software provided in an embodiment of the present application, the apparatus further includes: a third obtaining unit, configured to obtain, in the case of an automated test, a coordinate value of N (Nx, Ny), a numerical value of NL, and a numerical value of NH through the function one; a first conversion unit for converting the coordinate values of N (Nx, Ny), the format of the numerical values of NL and the format of the numerical values of NH into a target format by a function two; and a second storage unit for storing the coordinate value of N (Nx, Ny), the numerical value of NL and the numerical value of NH in the converted format.
Optionally, in the automatic testing apparatus for CAD software provided in an embodiment of the present application, the running unit includes: the first calculation module is used for obtaining an adjustment value (Deltax, Deltay) of a left vertex of the test area by adopting a formula I through O (Ox, Oy) and N (Nx, Ny), wherein the formula I is that Deltax is equal to Nx-Ox; deltay is Ny-Oy; a second calculation module for obtaining adjustment rates DeltaL and DeltaH of the length and width of the test area by using a second formula through OL, OH, NL and NH, wherein the second formula is
Figure BDA0003378504840000091
Figure BDA0003378504840000092
And the third calculating module is used for calculating and obtaining coordinates NP (NPx, NPy) of the mouse operation point by adopting a formula III, wherein the formula III is NPx-OPx + Deltax + DeltaL (OPx-Ox), and NPy-OPy + Deltay + DeltaH (OPy-Oy).
The automatic test device for CAD software comprises a processor and a memory, wherein the first acquiring unit 301, the adjusting unit 302, the running unit 303, and the like are stored in the memory as program units, and the processor executes the program units stored in the memory to realize corresponding functions.
The processor comprises a kernel, and the kernel calls the corresponding program unit from the memory. The kernel can be set to be one or more than one, and the adjustment of the mouse operating point in the CAD software automatic test process is realized by adjusting the kernel parameters.
The memory may include volatile memory in a computer readable medium, Random Access Memory (RAM) and/or nonvolatile memory such as Read Only Memory (ROM) or flash memory (flash RAM), and the memory includes at least one memory chip.
The embodiment of the invention provides a storage medium, wherein a program is stored on the storage medium, and the program realizes the automatic test method of the CAD software when being executed by a processor.
The embodiment of the invention provides a processor, which is used for running a program, wherein the program executes an automatic test method of CAD software when running.
The embodiment of the invention provides equipment, which comprises a processor, a memory and a program which is stored on the memory and can run on the processor, wherein the processor executes the program and realizes the following steps: acquiring an initial test script, wherein the initial test script is used for testing the CAD software; modifying the coordinate acquisition mode of the mouse operation point in the initial test script into a mode of calculating the coordinates NP (NPx, NPy) of the mouse operation point by a Delta incremental method to obtain a modified test script, wherein the Delta incremental method is used for eliminating the influence caused by the change of a test area in CAD software; and running the modified test script to automatically test the CAD software.
Optionally, a process of testing the CAD software through the initial test script is used as a baseline test process, under the baseline test condition, coordinates of a mouse operation point are OP (OPx, OPy), a length of a test area is OL, a width of the test area is OH, and left vertex coordinates O (Ox, Oy) of the test area are obtained; and taking the process of testing the CAD software by the modified test script as an automatic test process, wherein under the condition of automatic test, the coordinates of the mouse operating point are NP (NPx, NPy), the length of the test area is NL, the width of the test area is NH, and the coordinates N (Nx, Ny) of the left vertex of the test area.
Optionally, the method further includes: under the condition of baseline test, acquiring an initial value of the length OL of the test area and an initial value of the width OH of the test area through the screenshot of the test area; setting a preset coordinate value of a left vertex coordinate O (Ox, Oy) of the test area and a preset coordinate value of a mouse operating point coordinate OP (OPx, OPy); an initial value of the length OL of the test area, an initial value of the width OH of the test area, 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) are stored.
Optionally, the method for obtaining the coordinates of the mouse operation point in the initial test script is modified to obtain coordinates NP (NPx, NPy) of the mouse operation point through calculation by a Delta incremental method, and obtaining the modified test script includes: setting a function I in the initial test script, wherein the function I is used for acquiring 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 second function in the initial test script, wherein the second function is used for converting 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 taking the initial test script with the function one and the function two as a modified test script.
Optionally, the method includes: in the case of an automatic test, obtaining coordinate values of N (Nx, Ny), numerical values of NL and numerical values of NH through a first function; converting the coordinate values of N (Nx, Ny), the numerical values of NL and the numerical values of NH into target formats by a function II; the coordinate values of N (Nx, Ny), the numerical values of NL and the numerical values of NH of the converted format are stored.
Optionally, when the modified test script is run, the method includes: obtaining an adjustment value (Deltax, Deltay) of a left vertex of the test area by adopting a formula I through O (Ox, Oy) and N (Nx, Ny), wherein the formula I is that Deltax is Nx-Ox; deltay is Ny-Oy; obtaining adjustment rates DeltaL and DeltaH of the length and the width of the test area by OL, OH, NL and NH by adopting a formula II, wherein the formula II is
Figure BDA0003378504840000111
Figure BDA0003378504840000112
And calculating coordinates NP (NPx, NPy) of the mouse operation point by adopting a formula III, wherein the formula III is NPx-OPx + Deltax + DeltaL (OPx-Ox), and NPy-OPy + Deltay + DeltaH (OPy-Oy). The device herein may be a server, a PC, a PAD, a mobile phone, etc.
The present application further provides a computer program product adapted to perform a program for initializing the following method steps when executed on a data processing device: acquiring an initial test script, wherein the initial test script is used for testing the CAD software; modifying the coordinate acquisition mode of the mouse operation point in the initial test script into a mode of calculating the coordinates NP (NPx, NPy) of the mouse operation point by a Delta incremental method to obtain a modified test script, wherein the Delta incremental method is used for eliminating the influence caused by the change of a test area in CAD software; and running the modified test script to automatically test the CAD software.
Optionally, a process of testing the CAD software through the initial test script is used as a baseline test process, under the baseline test condition, coordinates of a mouse operation point are OP (OPx, OPy), a length of a test area is OL, a width of the test area is OH, and left vertex coordinates O (Ox, Oy) of the test area are obtained; and taking the process of testing the CAD software by the modified test script as an automatic test process, wherein under the condition of automatic test, the coordinates of the mouse operating point are NP (NPx, NPy), the length of the test area is NL, the width of the test area is NH, and the coordinates N (Nx, Ny) of the left vertex of the test area.
Optionally, the method further includes: under the condition of baseline test, acquiring an initial value of the length OL of the test area and an initial value of the width OH of the test area through the screenshot of the test area; setting a preset coordinate value of a left vertex coordinate O (Ox, Oy) of the test area and a preset coordinate value of a mouse operating point coordinate OP (OPx, OPy); an initial value of the length OL of the test area, an initial value of the width OH of the test area, 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) are stored.
Optionally, the method for obtaining the coordinates of the mouse operation point in the initial test script is modified to obtain coordinates NP (NPx, NPy) of the mouse operation point through calculation by a Delta incremental method, and obtaining the modified test script includes: setting a function I in the initial test script, wherein the function I is used for acquiring 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 second function in the initial test script, wherein the second function is used for converting 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 taking the initial test script with the function one and the function two as a modified test script.
Optionally, the method includes: in the case of an automatic test, obtaining coordinate values of N (Nx, Ny), numerical values of NL and numerical values of NH through a first function; converting the coordinate values of N (Nx, Ny), the numerical values of NL and the numerical values of NH into target formats by a function II; the coordinate values of N (Nx, Ny), the numerical values of NL and the numerical values of NH of the converted format are stored.
Optionally, when the modified test script is run, the method includes: obtaining an adjustment value (Deltax, Deltay) of a left vertex of the test area by adopting a formula I through O (Ox, Oy) and N (Nx, Ny), wherein the formula I is that Deltax is Nx-Ox; deltay is Ny-Oy; obtaining adjustment rates DeltaL and DeltaH of the length and the width of the test area by OL, OH, NL and NH by adopting a formula II, wherein the formula II is
Figure BDA0003378504840000121
Figure BDA0003378504840000122
And calculating coordinates NP (NPx, NPy) of the mouse operation point by adopting a formula III, wherein the formula III is NPx-OPx + Deltax + DeltaL (OPx-Ox), and NPy-OPy + Deltay + DeltaH (OPy-Oy).
As will be appreciated by one skilled in the art, 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. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
In a typical configuration, a computing device includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, 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.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, 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 technology, 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-transmission 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 a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in the process, method, article, or apparatus that comprises the element.
As will be appreciated by one skilled in the art, 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. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The above are merely examples of the present application and are not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. An automated test method for CAD software is characterized by comprising the following steps:
acquiring an initial test script, wherein the initial test script is used for testing CAD software;
modifying the coordinate acquisition mode of the mouse operation point in the initial test script into a mode of calculating and obtaining coordinates NP (NPx, NPy) of the mouse operation point by a Delta incremental method to obtain a modified test script, wherein the Delta incremental method is used for eliminating the influence caused by the change of a test area in the CAD software;
and running the modified test script to automatically test the CAD software.
2. The method according to claim 1, characterized in that a process of testing the CAD software by the initial test script is taken as a baseline test process, in which case 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, the left vertex coordinates O (Ox, Oy) of the test area; and taking the process of testing the CAD software by the modified test script as an automatic test process, wherein under the condition of the automatic test, the coordinates of the mouse operating 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).
3. The method of claim 2, further comprising:
under the baseline test condition, acquiring an initial value of the length OL of the test area and an initial value of the width OH of the test area through the screenshot of the test area;
setting a preset coordinate value of a left vertex coordinate O (Ox, Oy) of the test area and a preset coordinate value of a mouse operating point coordinate OP (OPx, OPy);
storing an initial value of the length OL of the test area, an initial value of the width OH of the test area, a preset coordinate value of a left vertex coordinate O (Ox, Oy) of the test area, and a preset coordinate value of the mouse operation point coordinate OP (OPx, OPy).
4. The method of claim 3, wherein the method for obtaining the coordinates of the mouse operation point in the initial test script is modified to obtain the coordinates NP (NPx, NPy) of the mouse operation point through Delta incremental calculation, and obtaining the modified test script comprises:
setting a function I in the initial test script, wherein the function I is used for acquiring 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 a second function in the initial test script, wherein the second function is used for converting 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 taking the initial test script with the first function and the second function as a modified test script.
5. The method of claim 4, wherein the method comprises:
in the case of the automated test, obtaining the coordinate values of N (Nx, Ny), the numerical value of NL and the numerical value of NH through the first function;
converting 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 second function;
storing the coordinate values of N (Nx, Ny), the numerical value of NL and the numerical value of NH in the converted format.
6. The method of claim 5, wherein running the modified test script comprises:
obtaining an adjustment value (Deltax, Deltay) of a left vertex of the test area by using a formula one through the O (Ox, Oy) and the N (Nx, Ny), wherein the formula one is that Deltax is Nx-Ox; deltay is Ny-Oy;
obtaining adjustment rates DeltaL and DeltaH of the length and the width of the test area by adopting a formula II through OL, OH, NL and NH, wherein the formula II is
Figure FDA0003378504830000021
Figure FDA0003378504830000022
Figure FDA0003378504830000023
And calculating coordinates NP (NPx, NPy) of the mouse operation point by adopting a formula III, wherein the formula III is NPx-OPx + Deltax + DeltaL (OPx-Ox), and NPy-OPy + Deltay + DeltaH (OPy-Oy).
7. An automated test device for CAD software, comprising:
the device comprises a first obtaining unit, a second obtaining unit and a third obtaining unit, wherein the first obtaining unit is used for obtaining an initial test script, and the initial test script is used for testing CAD software;
the adjusting unit is used for modifying the coordinate acquisition mode of the mouse operation point in the initial test script into a coordinate NP (NPx, NPy) of the mouse operation point calculated by a Delta incremental method to obtain a modified test script, wherein the Delta incremental method is used for eliminating the influence caused by the change of a test area in the CAD software;
and the running unit is used for running the modified test script so as to automatically test the CAD software.
8. The apparatus according to claim 7, wherein a process of testing the CAD software by the initial test script is taken as a baseline test process, in the baseline test case, coordinates of the mouse operation point are OP (OPx, OPy), a length of the test area is OL, a width of the test area is OH, and left vertex coordinates O (Ox, Oy) of the test area; and taking the process of testing the CAD software by the modified test script as an automatic test process, wherein under the condition of the automatic test, the coordinates of the mouse operating 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).
9. A computer-readable storage medium, characterized in that the storage medium includes a stored program, wherein the program executes the automated test method for CAD software according to any one of claims 1 to 6.
10. A processor, characterized in that the processor is configured to run a program, wherein the program is configured to execute the automated testing method of CAD software according to any of claims 1 to 6 when running.
CN202111426165.1A 2021-11-26 2021-11-26 Automatic test method and device for CAD software, storage medium and processor Pending CN114116485A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111426165.1A CN114116485A (en) 2021-11-26 2021-11-26 Automatic test method and device for CAD software, storage medium and processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111426165.1A CN114116485A (en) 2021-11-26 2021-11-26 Automatic test method and device for CAD software, storage medium and processor

Publications (1)

Publication Number Publication Date
CN114116485A true CN114116485A (en) 2022-03-01

Family

ID=80370776

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111426165.1A Pending CN114116485A (en) 2021-11-26 2021-11-26 Automatic test method and device for CAD software, storage medium and processor

Country Status (1)

Country Link
CN (1) CN114116485A (en)

Similar Documents

Publication Publication Date Title
CN106648556B (en) Method and device for front-end and back-end integrated development test
CN111506731B (en) Method, device and equipment for training field classification model
CN111476902B (en) Labeling method and device for objects in 3D point cloud, storage medium and processor
CN111026080A (en) Hardware-in-loop test method and device for controller
CN110969600A (en) Product defect detection method and device, electronic equipment and storage medium
CN109284115A (en) A kind of method and device generating tracker script
CN110968565A (en) Database creation method and system
CN113641592A (en) Test sequence generation method and device
CN114116485A (en) Automatic test method and device for CAD software, storage medium and processor
CN104765775A (en) Log saving method and device
CN112559313A (en) Test case setting method and device, storage medium and electronic equipment
CN114817209A (en) Monitoring rule processing method and device, processor and electronic equipment
CN111027716A (en) Load prediction method and device
CN113919683A (en) Method and device for calculating process man-hour, storage medium and processor
CN114116482A (en) Method and device for testing stability of CAD (computer-aided design) software, storage medium and processor
CN113055209B (en) Arranging method and device for edge calculation
CN110969461B (en) Method and device for processing public number information, storage medium and processor
CN112860779A (en) Batch data importing method and device
CN108241573B (en) Integrated test code generation method and device
CN111078574A (en) Method and device for generating influence analysis report
CN111125165A (en) Set merging method, device, processor and machine-readable storage medium
CN107479899B (en) File processing method and device, storage medium and processor
CN116124218B (en) Transformer fault diagnosis method and device, storage medium and electronic equipment
CN113312167B (en) Service control method and device, electronic equipment and computer readable medium
CN116823999B (en) Interaction method, device and medium based on picture identification

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination