CN111400183A - Automatic testing method for vehicle-mounted terminal - Google Patents
Automatic testing method for vehicle-mounted terminal Download PDFInfo
- Publication number
- CN111400183A CN111400183A CN202010182266.8A CN202010182266A CN111400183A CN 111400183 A CN111400183 A CN 111400183A CN 202010182266 A CN202010182266 A CN 202010182266A CN 111400183 A CN111400183 A CN 111400183A
- Authority
- CN
- China
- Prior art keywords
- test
- vehicle
- test case
- mounted terminal
- current
- 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
Links
- 238000012360 testing method Methods 0.000 title claims abstract description 161
- 238000013515 script Methods 0.000 claims abstract description 16
- 230000004044 response Effects 0.000 claims abstract description 12
- 238000000034 method Methods 0.000 claims description 24
- 230000009191 jumping Effects 0.000 claims description 6
- 230000001960 triggered effect Effects 0.000 claims description 3
- 238000010998 test method Methods 0.000 abstract description 2
- 230000008569 process Effects 0.000 description 8
- 238000004590 computer program Methods 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 238000012544 monitoring process Methods 0.000 description 3
- 230000003287 optical effect Effects 0.000 description 3
- 238000004891 communication Methods 0.000 description 2
- 238000011161 development Methods 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004422 calculation algorithm Methods 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 230000006872 improvement Effects 0.000 description 1
- 238000013522 software testing Methods 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
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)
- Stored Programmes (AREA)
Abstract
The invention discloses an automatic test method of a vehicle-mounted terminal, which relates to the field of software test, and comprises the steps of reading a test case set, obtaining a test case from the test case set and the cycle times set by the test case, judging whether the current execution times of the current test case is less than or equal to the set cycle times in real time, if so, obtaining a corresponding test script from a test script library according to the parameters of the current test case, executing the test and establishing connection with an MQTT server, sending a control instruction to the vehicle-mounted terminal, analyzing response information and a serial port log, judging whether the test is successful and recording a test result, realizing the control of the vehicle-mounted terminal without depending on an APP or WEB page, automatically judging whether the execution result of the vehicle-mounted terminal to the vehicle-mounted terminal is correct, realizing the automatic test of a plurality of vehicle-mounted terminals at the same time, and saving human resources, the test efficiency and the reliability of the vehicle-mounted terminal are improved.
Description
Technical Field
The invention relates to the technical field of software testing, in particular to an automatic testing method for a vehicle-mounted terminal.
Background
In recent years, with the rapid development of the shared automobile industry, various vehicle-mounted terminals have been rapidly developed. The current vehicle-mounted terminal integrates functions of driving recording, real-time video monitoring, in-vehicle environment monitoring, fatigue driving early warning monitoring and the like, communication between the control end and the vehicle-mounted terminal is realized based on an MQTT protocol, safety of shared automobiles can be improved, accident handling capacity and user experience are improved, and the environment of a vehicle in a shared automobile enterprise can be monitored and processed conveniently. The more and more abundant functions also mean greater testing challenges, and the urgency of how to verify the basic functions of the vehicle-mounted terminal based on MQTT protocol communication and ensure the reliability of the vehicle-mounted terminal is increasingly highlighted through an efficient and convenient testing means.
At present, a test scheme of a vehicle-mounted terminal is mainly realized by manually clicking different controls of a control end to issue corresponding control instructions, a response result needs manual judgment, and the test progress is influenced by the development progress of a program module (APP or WEB page) installed on the control end. When a plurality of vehicle-mounted terminals need to be tested, a large amount of human resources are occupied, and the efficiency is low. In addition, sufficient stability and stress tests cannot be performed by manual execution, and the reliability of the in-vehicle terminal is not guaranteed.
Disclosure of Invention
In order to overcome the defects in the prior art, the embodiment of the invention provides an automatic testing method for a vehicle-mounted terminal, which comprises the following steps:
s101, reading a test case set, and acquiring a test case and the cycle number set by the test case from the test case set;
s102, judging whether the current execution times of the current test case is less than or equal to the set cycle times in real time;
s103, if yes, acquiring a corresponding test script from a test script library according to parameters of the current test case, executing the test, establishing connection with an MQTT server, and sending a control instruction to the vehicle-mounted terminal, wherein the parameters comprise the name, the execution sequence and the cycle execution times of the current test case;
s104, if not, judging whether the current test case is the last test case in the test case set, and if so, performing the next round of test;
and S105, receiving and analyzing the response message and the serial port log sent by the vehicle-mounted terminal, judging whether the test is successful or not, and recording a test result.
Preferably, the determining whether the current test case is the last test case in the test case set includes:
if not, jumping to step S101 to read the next test case.
Preferably, the method further comprises:
and judging whether the test stopping operation is triggered or not in real time, if so, ending the test, and otherwise, adding 1 to the execution times of the current test case and jumping to the step S102.
Preferably, the method further comprises:
and setting equipment numbers for the plurality of vehicle-mounted terminals, identifying test objects according to the equipment numbers, and simultaneously testing the plurality of vehicle-mounted terminals.
Preferably, the method further comprises:
a plurality of PCs are used for building a test environment, a test object is identified by the equipment number of the vehicle-mounted terminal, and a plurality of vehicle-mounted terminals are tested simultaneously.
Preferably, the sending of the control instruction to the vehicle-mounted terminal, the receiving and the analyzing of the response message sent by the vehicle-mounted terminal are all based on the MQTT protocol.
The automatic testing method for the vehicle-mounted terminal provided by the embodiment of the invention has the following beneficial effects:
the control to the vehicle-mounted terminal can be realized without depending on an APP or a WEB page, whether the execution result of the vehicle-mounted terminal to the instruction is correct or not is automatically judged, automatic testing of a plurality of vehicle-mounted terminals is realized, human resources are saved, the testing efficiency and the reliability of the vehicle-mounted terminals are improved, and the vehicle-mounted terminal testing device can be used for stability and pressure testing.
Detailed Description
The present invention will be described in detail with reference to the following embodiments.
The automatic testing method for the vehicle-mounted terminal provided by the embodiment of the invention comprises the following steps:
s101, reading a test case set, and acquiring a test case and the cycle number set by the test case from the test case set;
s102, judging whether the current execution times of the current test case is less than or equal to the set cycle times in real time;
s103, if yes, acquiring a corresponding test script from a test script library according to parameters of the current test case, executing the test, establishing connection with an MQTT server, and sending a control instruction to the vehicle-mounted terminal, wherein the parameters comprise the name, the execution sequence and the cycle execution times of the current test case;
s104, if not, judging whether the current test case is the last test case in the test case set, and if so, performing the next round of test;
and S105, receiving and analyzing the response message and the serial port log sent by the vehicle-mounted terminal, judging whether the test is successful or not, and recording a test result.
Optionally, the determining whether the current test case is the last test case in the test case set includes:
if not, jumping to step S101 to read the next test case.
Optionally, the method further comprises:
and judging whether the test stopping operation is triggered or not in real time, if so, ending the test, and otherwise, adding 1 to the execution times of the current test case and jumping to the step S102.
Optionally, the method further comprises:
and setting equipment numbers for the plurality of vehicle-mounted terminals, identifying test objects according to the equipment numbers, and testing the plurality of vehicle-mounted terminals simultaneously.
Optionally, the method further comprises:
a plurality of PCs are used for building a test environment, a test object is identified by the equipment number of the vehicle-mounted terminal, and a plurality of vehicle-mounted terminals are tested simultaneously.
Optionally, the control end sends a control instruction to the vehicle-mounted terminal, and receives and analyzes a response message sent by the vehicle-mounted terminal, which are all based on the MQTT protocol.
The implementation process of the automatic testing method for the vehicle-mounted terminal provided by the embodiment of the invention is as follows:
after the tested vehicle-mounted terminal is electrified and started, a registration process is automatically initiated to the MQTT server, and connection with the MQTT server is established;
establishing physical connection between the control end and the vehicle-mounted terminal to be tested by using the serial port line;
the method comprises the steps that a parameter configuration module of a test frame installed at a control end sets test parameters, the test parameters comprise parameters required by calling an MQTT server interface such as a vehicle-mounted terminal device number, an MQTT server IP address, a port number, a user name and a password and control instruction parameters issued to a tested vehicle-mounted terminal, the test frame is used for controlling the whole automatic test flow and comprises a main control module, a parameter configuration module, a test script library, a test case set customizing module, a log module and a result module, the automatic test of tested vehicle-mounted terminal software is realized in a mode of executing test scripts circularly, and the control end is a PC host;
the test case set customizing module of the test framework sets test case set parameters to be executed, wherein the test case set parameters comprise the name of a test case to be executed, the execution sequence of the test case and the cycle execution times of the test case;
the main control module of the test framework reads the parameters of the test case set and calls the corresponding test script in the test script library to execute the test;
the test script establishes connection with the MQTT server, and calls an MQTT server interface to issue and subscribe a control instruction theme message to the tested vehicle-mounted terminal through an Http request;
the tested vehicle-mounted terminal executes corresponding operation and issues a response message after receiving the control instruction message, and meanwhile, a working log is printed through a serial port;
and the test script verifies the response message of the tested vehicle-mounted terminal received by the subscribed theme, verifies the serial log, indicates that the tested vehicle-mounted terminal correctly responds to the instruction if the response message is in accordance with the expectation, and passes the test, otherwise fails the test.
A log module of the test framework records test execution process information;
and the result module of the test framework stores and displays the test result.
The automatic test method for the vehicle-mounted terminal provided by the embodiment of the invention obtains a test case and the cycle times set by the test case from the test case set by reading the test case set, judges whether the current execution times of the current test case is less than or equal to the set cycle times in real time, if so, obtains a corresponding test script from a test script library according to the parameters of the current test case, executes the test and establishes connection with an MQTT server, sends a control instruction to the vehicle-mounted terminal, if not, judges whether the current test case is the last test case in the test case set, receives and analyzes a response message and a serial port log sent by the vehicle-mounted terminal, judges whether the test is successful and records the test result, can realize the control of the vehicle-mounted terminal without depending on an APP or WEB page, and automatically judges whether the execution result of the instruction by the vehicle-mounted terminal is correct, the automatic test of a plurality of vehicle-mounted terminals is realized, the human resources are saved, and the test efficiency and the reliability of the vehicle-mounted terminals are improved.
In the foregoing embodiments, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
It will be appreciated that the relevant features of the method and apparatus described above are referred to one another.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described systems, apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The algorithms and displays presented herein are not inherently related to any particular computer, virtual machine, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. Moreover, the present invention is not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.
In addition, 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.
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.
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 (6)
1. An automatic testing method for a vehicle-mounted terminal is characterized by comprising the following steps:
s101, reading a test case set, and acquiring a test case and the cycle number set by the test case from the test case set;
s102, judging whether the current execution times of the current test case is less than or equal to the set cycle times in real time;
s103, if yes, acquiring a corresponding test script from a test script library according to parameters of the current test case, executing the test, establishing connection with an MQTT server, and sending a control instruction to the vehicle-mounted terminal, wherein the parameters comprise the name, the execution sequence and the cycle execution times of the current test case;
s104, if not, judging whether the current test case is the last test case in the test case set, and if so, performing the next round of test;
and S105, receiving and analyzing the response message and the serial port log sent by the vehicle-mounted terminal, judging whether the test is successful or not, and recording a test result.
2. The automated vehicle-mounted terminal testing method according to claim 1, wherein judging whether the current test case is the last test case in the test case set comprises:
if not, jumping to step S101 to read the next test case.
3. The automated vehicle terminal testing method according to claim 1, further comprising:
and judging whether the test stopping operation is triggered or not in real time, if so, ending the test, and otherwise, adding 1 to the execution times of the current test case and jumping to the step S102.
4. The automated vehicle terminal testing method according to claim 1, further comprising:
and setting equipment numbers for the plurality of vehicle-mounted terminals, identifying test objects according to the equipment numbers, and simultaneously testing the plurality of vehicle-mounted terminals.
5. The automated vehicle terminal testing method according to claim 1 or 4, wherein the method further comprises:
a plurality of PCs are used for building a test environment, a test object is identified by the equipment number of the vehicle-mounted terminal, and a plurality of vehicle-mounted terminals are tested simultaneously.
6. The automated testing method for vehicle-mounted terminals according to claim 1,
the control instruction is sent to the vehicle-mounted terminal, and the response message sent by the vehicle-mounted terminal is received and analyzed based on the MQTT protocol.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010182266.8A CN111400183A (en) | 2020-03-16 | 2020-03-16 | Automatic testing method for vehicle-mounted terminal |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202010182266.8A CN111400183A (en) | 2020-03-16 | 2020-03-16 | Automatic testing method for vehicle-mounted terminal |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111400183A true CN111400183A (en) | 2020-07-10 |
Family
ID=71430847
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202010182266.8A Pending CN111400183A (en) | 2020-03-16 | 2020-03-16 | Automatic testing method for vehicle-mounted terminal |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111400183A (en) |
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112596972A (en) * | 2020-12-23 | 2021-04-02 | 文思海辉智科科技有限公司 | Vehicle-mounted equipment testing method, device and system and computer equipment |
CN113111007A (en) * | 2021-05-07 | 2021-07-13 | 广州小鹏汽车科技有限公司 | Vehicle-mounted object testing method and device |
CN113901285A (en) * | 2021-12-09 | 2022-01-07 | 深圳佑驾创新科技有限公司 | Vehicle road test method, device, electronic equipment and storage medium |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108920372A (en) * | 2018-07-09 | 2018-11-30 | 北京首汽智行科技有限公司 | Shared automobile intelligent car-mounted terminal automatization test system and method based on serial ports |
CN108932193A (en) * | 2018-06-01 | 2018-12-04 | 四川斐讯全智信息技术有限公司 | A kind of MQTT server interface test method and system |
CN109032912A (en) * | 2018-07-25 | 2018-12-18 | 北京首汽智行科技有限公司 | The method for testing pressure of car-mounted terminal firmware upgrade |
CN109062790A (en) * | 2018-07-19 | 2018-12-21 | 北京首汽智行科技有限公司 | The upgrading test method of car-mounted terminal bluetooth firmware |
-
2020
- 2020-03-16 CN CN202010182266.8A patent/CN111400183A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN108932193A (en) * | 2018-06-01 | 2018-12-04 | 四川斐讯全智信息技术有限公司 | A kind of MQTT server interface test method and system |
CN108920372A (en) * | 2018-07-09 | 2018-11-30 | 北京首汽智行科技有限公司 | Shared automobile intelligent car-mounted terminal automatization test system and method based on serial ports |
CN109062790A (en) * | 2018-07-19 | 2018-12-21 | 北京首汽智行科技有限公司 | The upgrading test method of car-mounted terminal bluetooth firmware |
CN109032912A (en) * | 2018-07-25 | 2018-12-18 | 北京首汽智行科技有限公司 | The method for testing pressure of car-mounted terminal firmware upgrade |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112596972A (en) * | 2020-12-23 | 2021-04-02 | 文思海辉智科科技有限公司 | Vehicle-mounted equipment testing method, device and system and computer equipment |
CN112596972B (en) * | 2020-12-23 | 2024-05-03 | 文思海辉智科科技有限公司 | Test method, device and system of vehicle-mounted equipment and computer equipment |
CN113111007A (en) * | 2021-05-07 | 2021-07-13 | 广州小鹏汽车科技有限公司 | Vehicle-mounted object testing method and device |
CN113901285A (en) * | 2021-12-09 | 2022-01-07 | 深圳佑驾创新科技有限公司 | Vehicle road test method, device, electronic equipment and storage medium |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111400183A (en) | Automatic testing method for vehicle-mounted terminal | |
CN109062790B (en) | Upgrading test method for Bluetooth firmware of vehicle-mounted terminal | |
CN110300017B (en) | Standard configuration generating device and method and network equipment configuration error correcting device and method | |
CN108121633B (en) | Abnormity capturing method and device | |
CN107229566B (en) | Method and system for maintaining functional consistency of SOA service conversion language | |
CN113515453B (en) | Webpage testing system | |
CN112115005B (en) | Test data acquisition method and device, computer equipment and storage medium | |
CN113419747A (en) | Middleware deployment method, device, equipment and storage medium | |
CN112650676A (en) | Software testing method, device, equipment and storage medium | |
CN111258591A (en) | Program deployment task execution method and device, computer equipment and storage medium | |
CN112463618A (en) | Automated testing method, device, medium and equipment | |
CN113110960A (en) | Automatic tuning test method and system based on hard disk performance | |
CN110990289A (en) | Method and device for automatically submitting bug, electronic equipment and storage medium | |
CN111274130A (en) | Automatic testing method, device, equipment and storage medium | |
CN112269697B (en) | Equipment storage performance testing method, system and related device | |
CN110198222B (en) | Plug-and-play test method and test master station for power distribution automation terminal | |
CN112422361A (en) | Switch testing method, device and medium | |
CN116028290A (en) | Solid state disk testing method, device, equipment and medium | |
CN109656791B (en) | gPC performance test method and device based on Jmeter | |
CN113722240B (en) | Stability testing method and system for linux operating system management platform | |
CN104424098A (en) | Application test method and application testing device | |
CN116431522A (en) | Automatic test method and system for low-code object storage gateway | |
CN112559313A (en) | Test case setting method and device, storage medium and electronic equipment | |
CN115525545A (en) | Docker-based automatic testing method, system, equipment and medium | |
CN115454856A (en) | Multi-application security detection method, device, medium and electronic equipment |
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 | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200710 |
|
RJ01 | Rejection of invention patent application after publication |