CN114860583B - Digital zoom test method, device and equipment based on data drive - Google Patents

Digital zoom test method, device and equipment based on data drive Download PDF

Info

Publication number
CN114860583B
CN114860583B CN202210402913.0A CN202210402913A CN114860583B CN 114860583 B CN114860583 B CN 114860583B CN 202210402913 A CN202210402913 A CN 202210402913A CN 114860583 B CN114860583 B CN 114860583B
Authority
CN
China
Prior art keywords
test
script
serial port
point
generating
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.)
Active
Application number
CN202210402913.0A
Other languages
Chinese (zh)
Other versions
CN114860583A (en
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.)
Zhuhai Shixi Technology Co Ltd
Original Assignee
Zhuhai Shixi 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 Zhuhai Shixi Technology Co Ltd filed Critical Zhuhai Shixi Technology Co Ltd
Priority to CN202210402913.0A priority Critical patent/CN114860583B/en
Publication of CN114860583A publication Critical patent/CN114860583A/en
Application granted granted Critical
Publication of CN114860583B publication Critical patent/CN114860583B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

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

Abstract

The application relates to a digital zoom test method, a digital zoom test device, digital zoom test equipment and a digital zoom test medium based on data driving, wherein the digital zoom test method comprises the following steps: the method comprises the steps of obtaining an original test case, splitting each test point of the original test case to obtain object elements of each test point, generating a test script according to the object elements of each test point, carrying out automatic test on the test script to obtain a test result, and writing the test result into each corresponding test point. The method provided by the application takes each test case of each test point as a data driving template, automatically executes the test script, and ensures the integrity and reliability of each test case of each test point; the test operation is automatically carried out, the reading of each test case of each test point and the writing of the test result are not influenced by manual operation, and a certain fault-tolerant mechanism is provided under the condition of ensuring the accuracy; the test script has strong reusability and is compatible with the digital zoom test of most Windows interface cameras on the market.

Description

Digital zoom test method, device and equipment based on data driving
Technical Field
The application relates to the technical field of automatic testing, in particular to a digital zoom testing method, a digital zoom testing device and digital zoom testing equipment based on data driving.
Background
The test is a very important link in software development, and whether the test work is in place directly influences the final delivery quality of the software. The automatic test can effectively reduce the workload of the test and improve the working efficiency of the test.
In the field of camera technology, the realization of functions such as automatic image position adjustment, digital pan-tilt and the like is required to be based on digital zooming. The digital zoom test is to check whether the functions of zooming in, zooming out, moving the designated steps, resetting and the like of the camera are normal.
However, the prior art lacks an automated test method for digital zoom of a camera.
Disclosure of Invention
In order to solve the above problems, embodiments of the present application provide a digital zoom test method, apparatus, device, and medium based on data driving, which analyze test requirements and reconstruct test cases to distinguish and judge results, and have a certain fault-tolerant mechanism.
The embodiment of the application adopts the following technical scheme:
in a first aspect, a data-driven digital zoom test method is provided, where the method includes:
acquiring an original test case, splitting each test point of the original test case to obtain object elements of each test point;
generating a test script according to the object elements of the test points, and carrying out automatic test on the test script to obtain a test result;
and writing the test result into the corresponding test points.
In a second aspect, there is provided a data-driven digital zoom test apparatus, comprising:
the test point object element determining unit is used for acquiring an original test case, splitting each test point of the original test case and obtaining an object element of each test point;
the test unit is used for generating a test script according to the object elements of the test points and automatically testing the test script to obtain a test result;
and the test result writing unit is used for writing the test result into each corresponding test point.
In a third aspect, an embodiment of the present application further provides a computer device, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor implements the steps of the digital zoom test method based on data driving when executing the computer program.
In a fourth aspect, the present application further provides a computer-readable storage medium, where a computer program is stored, and the computer program, when being instructed by a processor, implements the steps of the digital zoom test method based on data driving.
The embodiment of the application adopts at least one technical scheme which can achieve the following beneficial effects:
according to the digital zoom test method based on the data drive, an original test case is obtained, and each test point of the original test case is split to obtain an object element of each test point; generating a test script according to the object elements of the test points, and carrying out automatic test on the test script to obtain a test result; and writing the test result into the corresponding test points. According to the digital zoom test method based on data driving, all test cases of all test points are used as data driving templates, test scripts are automatically executed, and the integrity and reliability of all test cases of all test points are guaranteed; the test operation of the method and the device is automatically carried out, the reading of the test cases of the test points and the writing of the test results are not affected by manual operation, and a certain fault-tolerant mechanism is provided under the condition of ensuring accuracy. The test script of this application is strong, and compatible most Windows interface cameras's on the market digital zoom test.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 shows a flow diagram of a digital zoom test method based on data driving according to an embodiment of the present application;
FIG. 2 is a flow diagram illustrating a digital zoom test method based on data driving according to another embodiment of the present application;
FIG. 3 is a schematic structural diagram of a digital zoom test apparatus based on data driving according to an embodiment of the present application;
FIG. 4 shows a schematic structural diagram of a computer device according to an embodiment of the present application.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the technical solutions of the present application will be described in detail and completely with reference to the following specific embodiments of the present application and the accompanying drawings. It should be apparent that the described embodiments are only some of the embodiments of the present application, and not all of the embodiments. All other embodiments obtained by a person of ordinary skill in the art based on the embodiments in the present application without making any creative effort belong to the protection scope of the present application.
The technical solutions provided by the embodiments of the present application are described in detail below with reference to the accompanying drawings.
The idea of the application is that: in the digital zoom test process, data are reported by the serial port after each test operation is executed. After the camera is opened for previewing, the background can continuously report serial port data, so that the data volume is overlarge and is not controlled. Therefore, through format analysis of serial port data and classification processing of test points of corresponding test cases, and screening of regular expressions, effective data after each test operation is accurately extracted for final result judgment.
According to the digital zoom test method and device, the digital zoom test process based on data driving is completed by logically controlling and matching different third-party support libraries based on Python language. The Python language is an interpreted, object-oriented, dynamic data-type high-level programming language developed by Guido van Rossum that has a vast resource pool that can implement and be used to perform a variety of functions from web pages to scientific research. The Python language is used as a programming language of the whole automatic test script, and the logic and the function of the test script are realized by the Python language.
Fig. 1 illustrates a digital zoom test method based on data driving according to an embodiment of the present application.
According to fig. 1, the method comprises steps S110 to S130:
step S110, an original test case is obtained, and each test point of the original test case is split to obtain an object element of each test point.
The realization of functions such as automatic image position adjustment, digital pan-tilt and the like is all based on digital zooming. The digital zoom test is to check whether the functions of zooming in, zooming out, moving the designated steps, resetting and the like of the camera are normal.
When testing, the original test case is obtained first. The original test case may be, but is not limited to, a test case written into an EXCEL table, where each row in the EXCEL table is used as each test point of the original test case. And splitting each test point of the original test case to obtain an object element corresponding to each row of test points. The object elements may include, but are not limited to, resolution, number of test steps, type of test, and test steps, etc.
And step S120, generating a test script according to the object elements of the test points, and carrying out automatic test on the test script to obtain a test result.
And generating test scripts corresponding to the test points based on the object elements of the test points, and automatically testing and executing the test scripts in batches to obtain test results corresponding to the test points. For example, when the original test case is a test case written in the EXCEL table, test scripts are respectively generated according to the object elements of each row of test points, and batch test is performed on each test script to obtain the test result of each row of test points.
And step S130, writing the test result into each corresponding test point.
And after the automatic batch test is finished, obtaining the test result of each test point, and correspondingly writing each test result into each test point. For example, when the original test case is a test case written into the EXCEL table, the test result of each row of test points is written into the corresponding row according to the number of rows and the test result returned after the execution of each row of test points is completed.
As can be seen from the method shown in fig. 1, the digital zoom test method based on data driving provided by the present application obtains an original test case, and splits each test point of the original test case to obtain an object element of each test point; generating a test script according to the object elements of the test points, and carrying out automatic test on the test script to obtain a test result; and writing the test result into the corresponding test points. According to the digital zoom test method based on data driving, all test cases of all test points are used as data driving templates, test scripts are automatically executed, and the integrity and reliability of all test cases of all test points are guaranteed; the test operation of the method is carried out automatically, reading of test cases of test points and writing of test results are not affected by manual operation, and a certain fault-tolerant mechanism is provided under the condition that accuracy is guaranteed. The test script of the application has strong reusability and is compatible with digital zoom tests of most Windows interface cameras on the market.
In some embodiments of the present application, in the method, acquiring an original test case, and splitting test points of the original test case to obtain object elements of the test points includes: acquiring an original test case; reading each test point of an original test case by using a Pandas library; and splitting each test point to obtain the resolution, the test step number, the test type and the test step of each test point.
The Pandas library is a Python package, provides a fast, flexible and expressive data structure, aims to process the 'relationship' and 'label' data more simply and intuitively, and performs powerful and flexible data analysis and processing. The Pandas library is used for reading and writing EXCEL files and is the dominant library of data drive.
For example, when the original test case is a test case written in an EXCEL table, each row of test points in the EXCEL table is read through a Pandas library, and after each row of test points is split, the resolution, the test step number, the test type and the test step of each row of test points are obtained.
In some embodiments of the present application, in the above method, generating a test script according to an object element of each test point, and performing an automated test on the test script includes: generating a serial port control data receiving script; generating a shunting test script according to the test type; generating a Windows end tool control script according to the resolution and the test steps; according to the testing step, a test script is generated based on the serial port control data receiving script, the shunt test script and the Windows end tool control script; and carrying out automatic test on the test script to obtain a test result.
And after the resolution, the test step number, the test type and the test steps of each test point are obtained, generating a test script based on the object elements. The serial port control data receiving script is generated, and the function of serial port control data receiving can be realized through codes but not limited. The split test script is generated according to test types, which may include, but are not limited to, 0-fault value test, 1-zoom-in test, 2-zoom-out test, and the like. And generating a Windows end tool control script according to the resolution and the test steps, and realizing Windows end tool control through codes. And according to the test step, generating a test script based on the serial port control data receiving script, the Windows end tool control script and the shunting test script. And performing batch test on the test scripts of the test points to obtain test results of the test points.
In some embodiments of the application, in the above method, generating a serial port control data receiving script comprises: and controlling the serial port by utilizing a Pyrerial library, acquiring the serial port function supported by the serial port and packaging.
The PySerial library encapsulates access to the serial port and provides Python backend running on Windows, OSX, linux, BSD, ironPython, and the like. The PySerial library is used for realizing access and control of the serial port. The control of the serial port is realized through a PyrSerial library, and the control can include but is not limited to the functional packaging of connecting a COM port to a current computer, initializing the serial port, acquiring the super management authority of the serial port, opening high-level log output of the serial port, acquiring input return data by the serial port, quitting the super management authority of the serial port and the like.
In some embodiments of the present application, in the method, generating a Windows end tool control script according to the resolution and the test step number includes: controlling the Potplayer software by using a uiautomation library, acquiring a resolution function supported by the Potplayer software, and packaging; and controlling HidTool software by using the uiautomation library, acquiring a step number function supported by the HidTool software, and packaging.
The Uiautomation library encapsulates Microsoft UIAutomation API (application program interface), and supports automation Win32, MFC, WPF, modem UI, qt, IE, firefox, chrome and application programs developed based on Electron. The Uiautomation library is used for control support of Windows application programs in scripts.
The Potplayer software is controlled by using the Uiautomation library, and functions of opening the software, closing the software, entering a setting page, specifying resolution switching, acquiring all resolutions and the like can be packaged. The resolutions may include, but are not limited to, MJPG 3840 × 2160, MJPG 1920 × 1080, MJPG1280 × 720, H264 3840 × 2160, H264 1920 × 1080, H264 1280 × 720, and the like.
The HidTool software is controlled by using the Uiautomation library, and functions of opening the software, closing the software, amplifying a specified step number, reducing the specified step number, moving the specified step number, resetting and the like can be packaged.
In some embodiments of the present application, in the method, the automatically testing the test script to obtain the test result includes: operating a serial port control data receiving script to initialize the serial port, acquiring the super management authority of the serial port, and opening the high-level log output of the serial port; running a shunting test script to execute shunting test on each test point; running a Windows end tool control script to obtain test data of each test point; and running the serial port control data receiving script to obtain the test data of each test point to obtain a test result.
In the automatic test process, a serial port control data receiving script is operated, a serial port object is initialized, and then serial port over-management authority is obtained and serial port high-level log output is opened. And running a shunting test script, and executing shunting test on each test point according to the test type. The test types may include, but are not limited to, a 0-error value test, a 1-zoom-in test, and a 2-zoom-out test, among others. And running the Windows end tool control script, and testing each test point according to the resolution and the test steps to obtain test data. And operating a serial port control data receiving script, receiving test data returned after each test operation is executed through a serial port, substituting the test data into a preset formula for calculation, and determining the test result of each test case of each test point.
In one case, the automated test is premised on the no zoom state using a 4K resolution preview. In one case, after the execution of each test case of each test point is finished, the data returned back through the serial port left by the last test is cleared, so that the test result is prevented from being influenced by interference.
In one case, after the automated test obtains the test result, if the test result is failure, the failure reason can be further checked. In this embodiment, the automated testing includes some fault-tolerant approach to prevent human effects through a fault-tolerant mechanism. The fault tolerance mode may include, but is not limited to, abnormal power failure of the device under test, loss of control of the test tool, abnormal test data, abnormal transmission of serial data, etc.
In some embodiments of the present application, in the method, writing the test result into the corresponding test point includes: and writing the test result into each corresponding test point by utilizing an Openpyxl library.
The Openpyxl library is a Python library for reading and writing EXCEL 2010 xlsxlsx/xlsm/xltx/xlsm, is simple and easy to use, has wide functions, covers the functions of cell formats, pictures, tables, formulas, screening, annotation, file protection and the like, and has a chart function as a major highlight point. The Openpyxl library is used for assisting the writing of test results.
For example, when the original test case is a test case written into the EXCEL table, the test result of each row of test points is written into the corresponding row according to the number of rows and the test result returned after the execution of each row of test points is completed.
Fig. 2 shows a digital zoom test method based on data driving according to another embodiment of the present application. As shown in fig. 2, the digital zoom test method based on data driving of the present embodiment includes the following steps S201 to S213:
step S201, obtaining an original test case.
And step S202, reading each test point of the original test case by using a Pandas library.
And S203, splitting each test point to obtain the resolution, the test step number, the test type and the test step of each test point.
Table 1 shows a schematic diagram of a test case according to another embodiment of the present application. As shown in table 1, the original test case includes 2 test points: test point 1[ 2 ], [0 ], mjpeg 3840 [ 2160p 30 (P16). Splitting the test point 1 to obtain the test point with the resolution of MJPEG 3840 × 2160, the test step number of 1 and the test type of 0-error value test, wherein the test steps are the encoding format MJPEG and the resolution of 3840 × 2160, zooming 1 step number by using HID during previewing, and viewing a preview picture, a moving picture and a moving picture. And splitting the test point 2 to obtain the test point with the resolution of MJPG 3840 × 2160, the test step number of 5, the test type of 1-amplification test, the test steps of the test step are the encoding format MJPG and the resolution of 3840 × 2160, amplifying the step number of 5 steps by using HID during preview, and viewing a preview picture, a moving picture and a moving picture.
Table 1:
Figure BDA0003601009090000071
and S204, controlling the serial port by using a Pyrerial library, acquiring and packaging the serial port function supported by the serial port, and generating a serial port control data receiving script.
And step S205, generating a shunting test script according to the test type.
And S206, controlling Potplayer software by using the uiautomation library, acquiring and packaging the resolution function supported by the Potplayer software, controlling HidTool software by using the uiautomation library, acquiring and packaging the step function supported by the HidTool software, and generating a Windows end tool control script.
Step S207, according to the test step, generating a test script based on the serial port control data receiving script, the shunting test script and the Windows end tool control script.
And step S208, operating the serial port control data receiving script to initialize the serial port, acquiring the super management authority of the serial port, and opening the high-level log output of the serial port.
In step S209, the shunt test script is run to execute the shunt test on each test point.
Step S210, a Windows end tool control script is run to obtain test data of each test point.
Step S211, running the serial port control data receiving script to obtain the test data of each test point, and obtaining the test result.
In one case, whether the values of enlargement, reduction, and movement are correct is judged by the width, height, abscissa of the reference point, and ordinate of the reference point.
The amplification can be expressed by the following equations 1 and 2:
w=w 1 -step×n 1 (ii) a (formula 1)
h=h 1 -step×n 2 . (formula 2)
The reduction can be expressed by the following equations 3 and 4:
w=w 1 +step×n 1 (ii) a (formula 3)
h=h 1 +step×n 2 . (formula 4)
The movement can be expressed by the following equations 5 and 6:
x=x 1 +step×n 3 (ii) a (formula 5)
y=y 1 . (equation 6)
Wherein w 1 For previewing the width of the frame before testing, h 1 For the height of the preview picture before testing, x 1 For the abscissa, y, of the reference point of the preview picture before testing 1 The vertical coordinate of the reference point of the preview picture before testing, w is the width of the current theoretical preview picture, h is the height of the current theoretical preview picture, x is the horizontal coordinate of the reference point of the current theoretical preview picture, y is the vertical coordinate of the reference point of the current theoretical preview picture, step is the step number, n 1 Is the width step size, n 2 For height step, n 3 Is the step size of the move. In an alternative case, the width step may be 64 pixels,the height step may be 36 pixels and the move step may be 32 pixels. The width, height and moving step length are illustrative examples, and the application is not limited thereto, and can be flexibly set according to the requirement.
Under the condition of the test case of the test point 2 shown in table 1, according to the test steps and based on the test script, the test data of the test point 2 obtained by the test are respectively: width w of the current actual preview screen N Height h of current actual preview screen N Abscissa x of reference point of current actual preview screen N Ordinate y of reference point of current actual preview picture N . Will w N Is compared with the value of w, h N Is compared with the value of h, x N Comparison with the value of x, y N Comparing with the value of y; if the comparison results are all the same, the test result passes; if at least one of the comparison results is different, the test result is not passed.
And step S212, writing the test result into each corresponding test point by utilizing the Openpyxl library.
Fig. 3 shows a schematic structural diagram of a digital zoom test apparatus based on data driving according to an embodiment of the present application. As shown in fig. 3, the apparatus 300 comprises:
the test point object element determining unit 301 is configured to obtain an original test case, split each test point of the original test case, and obtain an object element of each test point.
The realization of functions such as automatic image position adjustment, digital pan-tilt and the like is all required to be based on digital zooming. The digital zoom test is to check whether the functions of zooming in, zooming out, moving the designated steps, resetting and the like of the camera are normal.
When testing, the original test case is obtained first. The original test case may be, but is not limited to, a test case written into an EXCEL table, where each row in the EXCEL table is used as each test point of the original test case. And splitting each test point of the original test case to obtain an object element corresponding to each row of test points. The object elements may include, but are not limited to, resolution, number of test steps, type of test, and test steps, among others.
The test unit 302 is configured to generate a test script according to the object elements of the test points, and perform an automated test on the test script to obtain a test result.
And generating test scripts corresponding to the test points based on the object elements of the test points, and automatically testing and executing the test scripts in batches to obtain test results corresponding to the test points. For example, when the original test case is a test case written in the EXCEL table, test scripts are respectively generated according to the object elements of each row of test points, and batch test is performed on each test script to obtain the test result of each row of test points.
And a test result writing unit 303, configured to write the test result into each corresponding test point.
And after the automatic batch test is finished, obtaining the test result of each test point, and correspondingly writing each test result into each test point. For example, when the original test case is a test case written into the EXCEL table, the test result of each row of test points is written into the corresponding row according to the number of rows and the test result returned after the execution of each row of test points is completed.
In some embodiments of the present application, in the above apparatus, the test point object element determining unit 301 is specifically configured to: acquiring an original test case; reading each test point of an original test case by using a Pandas library; and splitting each test point to obtain the resolution, the test step number, the test type and the test step of each test point.
In some embodiments of the present application, in the above apparatus, the test unit 302 includes: the serial port control data receiving script generating module is used for generating a serial port control data receiving script; the shunt test script generating module is used for generating a shunt test script according to the test type; the Windows end tool control script generating module is used for generating a Windows end tool control script according to the resolution and the test steps; the test script generating module is used for generating a test script based on the serial port control data receiving script, the shunting test script and the Windows end tool control script according to the test steps; and the test result generation module is used for carrying out automatic test on the test script to obtain a test result.
In some embodiments of the present application, in the above apparatus, the serial port control data receiving script generating module is specifically configured to control a serial port by using a PySerial library, obtain a serial port function supported by the serial port, and package the serial port function.
In some embodiments of the present application, in the apparatus, the Windows-side tool control script generation module is specifically configured to control the potlayer software by using the uiautomation library, obtain a resolution function supported by the potlayer software, and package the resolution function; and controlling HidTool software by using the uiautomation library, acquiring a step number function supported by the HidTool software, and packaging.
In some embodiments of the present application, in the apparatus, the test result generating module is specifically configured to run a serial port control data receiving script to initialize the serial port, obtain a super management authority of the serial port, and open a high-level log output of the serial port; running a shunting test script to execute shunting test on each test point; running a Windows end tool control script to obtain test data of each test point; and running the serial port control data receiving script to obtain the test data of each test point to obtain a test result.
In some embodiments of the present application, in the above apparatus, the test result writing unit 303 is specifically configured to write the test result into each corresponding test point by using an Openpyxl library.
Fig. 4 shows a schematic structural diagram of a computer device according to an embodiment of the present application. As shown in fig. 4, at the hardware level, the computer device includes a processor, and optionally further includes an internal bus, a network interface, and a memory. The Memory may include a Memory, such as a Random-Access Memory (RAM), and may further include a non-volatile Memory, such as at least 1 disk Memory. Of course, the computer device may also include hardware required for other services.
The processor, the network interface, and the memory may be connected to each other via an internal bus, which may be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, an EISA (Extended Industry Standard Architecture) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one double-headed arrow is shown in FIG. 4, but this does not indicate only one bus or one type of bus.
And the memory is used for storing programs. In particular, the program may include program code including computer operating instructions. The memory may include both memory and non-volatile storage and provides instructions and data to the processor.
The processor reads a corresponding computer program from the non-volatile memory into the memory and then runs the computer program, and forms the digital zoom test device 300 based on data driving on a logic level. The processor is used for executing the program stored in the memory and is specifically used for executing the following operations:
acquiring an original test case, splitting each test point of the original test case to obtain object elements of each test point;
generating a test script according to the object elements of the test points, and carrying out automatic test on the test script to obtain a test result;
and writing the test result into the corresponding test points.
The method executed by the digital zoom test device 300 based on data driving according to the embodiment of fig. 3 of the present application can be applied to or implemented by a processor. The processor may be an integrated circuit chip having signal processing capabilities. In implementation, the steps of the above method may be performed by integrated logic circuits of hardware in a processor or instructions in the form of software. The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), application Specific Integrated Circuits (ASICs), field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components. The various methods, steps, and logic blocks disclosed in the embodiments of the present application may be implemented or performed. A general purpose processor may be a microprocessor or the processor may be any conventional processor or the like. The steps of the method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware decoding processor, or implemented by a combination of hardware and software modules in the decoding processor. The software module may be located in ram, flash memory, rom, prom, or eprom, registers, etc. storage media as is well known in the art. The storage medium is located in a memory, and a processor reads information in the memory and completes the steps of the method in combination with hardware of the processor.
The computer device may further execute the method executed by the digital zoom testing apparatus 300 based on data driving in fig. 3, and implement the functions of the digital zoom testing apparatus 300 based on data driving in the embodiment shown in fig. 3, which are not described herein again.
Embodiments of the present application further provide a computer-readable storage medium storing one or more programs, where the one or more programs include instructions, which, when executed by a computer device including a plurality of application programs, enable the computer device to perform the method performed by the data-driven digital zoom test apparatus 300 in the embodiment shown in fig. 3, and are specifically configured to perform:
acquiring an original test case, and splitting each test point of the original test case to obtain object elements of each test point;
generating a test script according to the object elements of the test points, and carrying out automatic test on the test script to obtain a test result;
and writing the test result into the corresponding test points.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, apparatus, 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 flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations 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). 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 phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of other like elements in a process, method, article, or apparatus comprising 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-mentioned embodiments are only used for illustrating the technical solutions of the present invention, and not for limiting the same; although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present invention, and are intended to be included within the scope of the present invention.

Claims (9)

1. A digital zoom test method based on data driving is characterized by comprising the following steps:
acquiring an original test case, and splitting each test point of the original test case to obtain an object element of each test point; the object elements comprise resolution, test step number, test type and test step;
generating a test script according to the object elements of the test points, and carrying out automatic test on the test script to obtain a test result;
writing the test result into each corresponding test point;
generating a test script according to the object elements of the test points, and performing automatic test on the test script, wherein the test script comprises the following steps:
generating a serial port control data receiving script;
generating a shunting test script according to the test type;
generating a Windows end tool control script according to the resolution and the test steps;
according to the test step, generating a test script based on the serial port control data receiving script, the shunting test script and the Windows end tool control script;
and carrying out automatic test on the test script to obtain a test result.
2. The digital zoom test method based on data driving of claim 1, wherein the obtaining of the original test case and the splitting of the test points of the original test case to obtain the object elements of the test points comprises:
acquiring an original test case;
reading each test point of the original test case by utilizing a Pandas library;
and splitting the test points to obtain the resolution, the test step number, the test type and the test step of each test point.
3. The digital zoom test method based on data driving of claim 1, wherein the generating a serial port control data receiving script comprises:
and controlling the serial port by using a PyrSerial library, acquiring the serial port function supported by the serial port and packaging.
4. The digital zoom test method based on data driving of claim 1, wherein the generating a Windows-side tool control script according to the resolution and the test steps comprises:
controlling Potplayer software by using a uiautomation library, acquiring a resolution function supported by the Potplayer software, and packaging;
and controlling HidTool software by using a uiautomation library, acquiring a step number function supported by the HidTool software, and packaging.
5. The digital zoom test method based on data driving of claim 1, wherein the performing of the automated test on the test script to obtain the test result comprises:
operating the serial port control data receiving script to initialize a serial port, acquiring the super management authority of the serial port, and opening the high-level log output of the serial port;
running the shunting test script to execute shunting test on each test point;
running the Windows end tool control script to obtain the test data of each test point;
and operating the serial port control data receiving script to obtain the test data of each test point to obtain a test result.
6. The digital zoom test method based on data driving of claim 1, wherein the writing the test result into the corresponding test point comprises:
and writing the test result into each corresponding test point by utilizing an Openpyxl library.
7. A digital zoom test device based on data driving, the device comprising:
the test point object element determining unit is used for acquiring an original test case, splitting each test point of the original test case and obtaining an object element of each test point; the object elements comprise resolution, test step number, test type and test step;
the test unit is used for generating a test script according to the object elements of the test points and carrying out automatic test on the test script to obtain a test result;
a test result writing unit for writing the test result into each corresponding test point;
wherein the test unit includes:
the serial port control data receiving script generating module is used for generating a serial port control data receiving script;
the shunt test script generating module is used for generating a shunt test script according to the test type;
the Windows end tool control script generating module is used for generating a Windows end tool control script according to the resolution ratio and the test steps;
the test script generating module is used for generating a test script based on the serial port control data receiving script, the shunting test script and the Windows end tool control script according to the test step;
and the test result generation module is used for carrying out automatic test on the test script to obtain a test result.
8. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the data-driven-based digital zoom test method according to any one of claims 1 to 6 when executing the computer program.
9. A computer-readable storage medium storing a computer program, wherein the computer program is configured to implement the steps of the data-driven-based digital zoom testing method according to any one of claims 1 to 6 when being instructed by a processor.
CN202210402913.0A 2022-04-18 2022-04-18 Digital zoom test method, device and equipment based on data drive Active CN114860583B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210402913.0A CN114860583B (en) 2022-04-18 2022-04-18 Digital zoom test method, device and equipment based on data drive

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210402913.0A CN114860583B (en) 2022-04-18 2022-04-18 Digital zoom test method, device and equipment based on data drive

Publications (2)

Publication Number Publication Date
CN114860583A CN114860583A (en) 2022-08-05
CN114860583B true CN114860583B (en) 2022-12-02

Family

ID=82631043

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210402913.0A Active CN114860583B (en) 2022-04-18 2022-04-18 Digital zoom test method, device and equipment based on data drive

Country Status (1)

Country Link
CN (1) CN114860583B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101526917A (en) * 2009-04-22 2009-09-09 南京大学 Method for reproducing test scripts based on data drive
CN102387398A (en) * 2010-08-27 2012-03-21 索尼公司 Method and apparatus for determining the movement of an optical axis
CN102622416A (en) * 2012-02-20 2012-08-01 苏州阔地网络科技有限公司 Browser zoom state detection method based on Flash
US9021440B1 (en) * 2014-08-11 2015-04-28 Pmc-Sierra Us, Inc. System and method for automated test script generation
CN108111744A (en) * 2016-11-25 2018-06-01 努比亚技术有限公司 A kind of filming apparatus and method
CN111338965A (en) * 2020-03-02 2020-06-26 五八有限公司 Case testing method and device, electronic equipment and storage medium
CN112699055A (en) * 2021-01-19 2021-04-23 航天恒星科技有限公司 Software automation test method and system with low maintenance cost
CN113419946A (en) * 2021-05-31 2021-09-21 西南电子技术研究所(中国电子科技集团公司第十研究所) Ice interface test case and test script automatic generation method

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102141962B (en) * 2011-04-07 2013-06-19 北京航空航天大学 Safety distributed test framework system and test method thereof
CN102156673B (en) * 2011-04-20 2013-09-18 北京航空航天大学 Test case description oriented GUI (Graphical User Interface) automatic test system and test method thereof
CN105279196B (en) * 2014-07-23 2019-03-19 阿里巴巴集团控股有限公司 The generation method and device of test script
CN110457212B (en) * 2019-07-24 2023-02-03 艾瑞克·李 Test modeling and test case automatic generation method based on complex system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101526917A (en) * 2009-04-22 2009-09-09 南京大学 Method for reproducing test scripts based on data drive
CN102387398A (en) * 2010-08-27 2012-03-21 索尼公司 Method and apparatus for determining the movement of an optical axis
CN102622416A (en) * 2012-02-20 2012-08-01 苏州阔地网络科技有限公司 Browser zoom state detection method based on Flash
US9021440B1 (en) * 2014-08-11 2015-04-28 Pmc-Sierra Us, Inc. System and method for automated test script generation
CN108111744A (en) * 2016-11-25 2018-06-01 努比亚技术有限公司 A kind of filming apparatus and method
CN111338965A (en) * 2020-03-02 2020-06-26 五八有限公司 Case testing method and device, electronic equipment and storage medium
CN112699055A (en) * 2021-01-19 2021-04-23 航天恒星科技有限公司 Software automation test method and system with low maintenance cost
CN113419946A (en) * 2021-05-31 2021-09-21 西南电子技术研究所(中国电子科技集团公司第十研究所) Ice interface test case and test script automatic generation method

Non-Patent Citations (3)

* Cited by examiner, † Cited by third party
Title
A Web Testing Platform Based on Hybrid Automated Testing Framework;Zhe Sun 等;《2019 IEEE 4th Advanced Information Technology, Electronic and Automation Control Conference 》;20200213;第689-692页 *
IPCam模糊测试自动化框架的设计与实现;张帆;《中国优秀硕士学位论文全文数据库信息科技辑》;20220415(第4期);I138-211 *
相机测试用例:手机、相机和摄像头测试看过来;python测试开发;《http://www.51testing.com/html/33/n-4480933.html》;20220119;第1-6页 *

Also Published As

Publication number Publication date
CN114860583A (en) 2022-08-05

Similar Documents

Publication Publication Date Title
CN109189682B (en) Script recording method and device
CN107274442B (en) Image identification method and device
CN109800154B (en) Test data loading method and device, computer equipment and storage medium
US8797338B2 (en) Platform agnostic screen capture tool
CN111272067A (en) Mobile phone detection method and equipment
CN111124870A (en) Interface testing method and device
CN112613380A (en) Machine room patrol inspection method and device, electronic equipment and storage medium
CN109978044B (en) Training data generation method and device, and model training method and device
CN114860583B (en) Digital zoom test method, device and equipment based on data drive
CN111272388A (en) Method and device for detecting camera flash lamp
CN111522583A (en) Method and device for generating configuration file, computer equipment and storage medium
CN111277659A (en) Method and device for detecting display state of transverse screen and vertical screen of mobile phone
CN110888641B (en) Script automatic generation method and device, server and storage medium
CN116402165A (en) Operator detection method and device, storage medium and electronic equipment
CN113641594B (en) Cross-terminal automatic testing method and related device
CN111459474B (en) Templated data processing method and device
CN111294453B (en) Mobile phone key test method and equipment
CN114791884A (en) Test environment construction method and device, storage medium and electronic equipment
CN114171107A (en) Detection method, device, equipment and storage medium for VPD information of solid state disk
CN110737515B (en) Processing method of data task instruction, computer equipment and storage medium
CN107479899B (en) File processing method and device, storage medium and processor
CN113031574B (en) Equipment operation process reproduction method and system
CN113886228B (en) Compatibility detection method and device, storage medium and electronic equipment
CN117234936A (en) Abnormal picture detection method, device, equipment and storage medium
CN113986739A (en) Monitoring method and device for website memory leakage, storage medium and processor

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
GR01 Patent grant
GR01 Patent grant