CN112188192A - Code stream adaptability test method, system, computer equipment and storage medium - Google Patents

Code stream adaptability test method, system, computer equipment and storage medium Download PDF

Info

Publication number
CN112188192A
CN112188192A CN202011280121.8A CN202011280121A CN112188192A CN 112188192 A CN112188192 A CN 112188192A CN 202011280121 A CN202011280121 A CN 202011280121A CN 112188192 A CN112188192 A CN 112188192A
Authority
CN
China
Prior art keywords
code stream
television
module
test
player
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
CN202011280121.8A
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.)
Sichuan Changhong Electric Co Ltd
Original Assignee
Sichuan Changhong Electric 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 Sichuan Changhong Electric Co Ltd filed Critical Sichuan Changhong Electric Co Ltd
Priority to CN202011280121.8A priority Critical patent/CN112188192A/en
Publication of CN112188192A publication Critical patent/CN112188192A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/04Diagnosis, testing or measuring for television systems or their details for receivers

Landscapes

  • Engineering & Computer Science (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Multimedia (AREA)
  • Signal Processing (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)

Abstract

The invention discloses a method for automatically testing code stream adaptability of a television, which comprises the steps of controlling a keyboard and a mouse of a computer by using a PyAutoGUI module of python, realizing automatic playing and switching of a code stream player, automatically searching and switching channels of the television based on monkey playback, calling a program information menu, capturing information in the program information menu, and comparing results. The method can replace manual detection, greatly shorten the test period and improve the test accuracy.

Description

Code stream adaptability test method, system, computer equipment and storage medium
Technical Field
The invention relates to the technical field of code stream testing of televisions, in particular to a method, a system, computer equipment and a storage medium for automatically testing code stream adaptability of a television.
Background
In the process of research and development, the new television needs to perform code stream (TS) applicability test on the television. The test is a tedious task, and the TS is called Transport Stream. MPEG-TS is mainly applied to programs delivered in real time, such as television programs broadcast in real time. During testing, a large number of code streams are verified, and one code stream contains a plurality of television programs (more can reach more than 30 programs). The test needs to verify the correctness of the television to analyze the code stream information, and mainly includes information such as program name, program number, program time, program forecast, level information (programming), and audio language.
The code stream adaptability test is manual detection, and if each program information is verified during manual detection, the code stream adaptability test is a huge workload. If one code stream has 10 programs on average, and 1 program has 10 pieces of information to be verified, 10000 test points need to be verified for 100 code streams. Therefore, manual testing has the problem of being time consuming and cumbersome.
Disclosure of Invention
The invention aims to overcome the defects in the background art and provide a method, a system, computer equipment and a storage medium for automatically testing the code stream adaptability of a television, which realize automatic testing from playing to switching code streams to detection, can replace manual detection, greatly shorten the testing period and improve the testing accuracy.
In order to achieve the technical effects, the invention adopts the following technical scheme:
the method for automatically testing the code stream adaptability of the television comprises the following steps:
s1, recording coordinates of each control of a code stream player; the precise control of the player can be realized by recording the coordinates of each control of the player;
s2, importing a PyAutoGUI module into the python; the PyAutoGUI module can realize that the target position is determined through a screen xy coordinate system, the mouse and the keyboard are controlled to send virtual key strokes and mouse clicks, the operations of clicking buttons, filling forms and the like are completed, namely the mouse and the keyboard can be controlled by using the PyAutoGUI module, so that the automatic control of the mouse and the keyboard on the code stream player is realized,
s3, compiling a test script according to the operation flow of the code stream player, reading an electronic form of the code stream to be tested, and assigning the code streams to be played to the code stream player one by one; the code streams to be tested are collected and edited into an electronic form in advance, and the code streams to be played can be assigned to a code stream player one by one through a play list of the read code streams of python; the code streams to be played are collected in the spreadsheet, so that the maintenance and the modification are more convenient;
s4, establishing communication connection with a television;
s5, starting an automatic testing process and importing an API;
s6, controlling the television to realize automatic channel searching and determining the number of programs in the code stream;
s7, calling a corresponding test menu by using the corresponding movable object, positioning the element through the ID, and capturing and storing entry information in the element into the spreadsheet;
s8, switching to the next program after one program information is captured and stored until all program information is captured and stored; storing the captured information in an electronic form according to a format, namely ending a program test, switching to the next program to continue capturing and storing, and determining to circularly cut programs for several times according to the number of the programs determined by searching;
s9, judging whether the current code stream is the last one, if so, finishing the test, and if not, continuously testing the next code stream;
and S10, outputting a test result and comparing the results.
Further, the establishing of the communication connection with the television in the step S4 is realized through a USB connection or a network connection.
Further, the step S4 further includes using a function monkey runner, waitforconnection () to determine whether the connection is successful.
Further, in step S6, the maj or purpose of the munkeyyrner tool is to control the tv to perform automatic searching, the munkeyyrner tool is designed to test applications and devices at the function/framework level, or to run a unit test suite, the munkeyyrner tool provides an API, programs written by using the API can control the Android devices outside the Android code, and a Python program can be written by the munkeyyrner tool to call active objects (activities) to call up user interfaces or other menus and windows for use, wherein the munu, enterer, top, bottom, left, right, back, exit, etc. operations can be performed on the tv by the munu.
Further, in step S7, specifically, the method includes: the ID is obtained through an Android resource file (namely, an xml file under res- - > layout) corresponding to the application source code.
Further, in the step S10, the result comparison is specifically implemented by using a program written based on the C language for document comparison.
Meanwhile, the invention also discloses a system for automatically testing the code stream adaptability of the television, which comprises the following steps:
the code stream player automatic control module is used for realizing automatic control on the code stream player;
the code stream reading module is used for reading the code stream list and modifying and maintaining the code stream list;
the automatic test module of the television program information, is used for realizing the automatic control to the television and reading of the program information;
the result comparison module is used for outputting a result and comparing the result;
the television program information automatic test module is respectively connected with the code stream player automatic control module, the code stream reading module and the result comparison module.
Further, the code stream player automatic control module uses python's PyAutoGUI module to realize automatic control of the code stream player.
Meanwhile, the invention also discloses computer equipment which comprises a memory, a processor and a computer program which is stored in the memory and can run on the processor, wherein the processor realizes the steps of the method for automatically testing the code stream adaptability of the television when executing the computer program.
Meanwhile, the invention also discloses a computer readable storage medium, wherein a computer program is stored in the computer readable storage medium, and the computer program is executed by a processor to realize the steps of the method for automatically testing the code stream adaptability of the television.
Compared with the prior art, the invention has the following beneficial effects:
the method, the system, the computer equipment and the storage medium for automatically testing the code stream adaptability of the television have the following beneficial effects:
the automation of code stream playing and switching is realized. The playing code stream is generally played by using a code stream modulation card, the modulation card is generally inserted into a PCI or PCI-E interface or a USB interface of a desktop computer, and then the corresponding code stream playing software is used for playing. Through the technical scheme of the invention, the computer can play and switch in sequence according to the defined table.
Automatic output of results is achieved. In the scheme of the invention, the test equipment is connected with the television through a USB or a network, the television is controlled through a script to automatically search channels based on the monkey apparatus, then a movable object is called (for example, program information displayed by the television is a movable object), elements on the movable object are captured (for example, a program name in the program information is an element), and finally the captured information is output to an electronic form according to a defined format, so that the automatic output of results is realized.
And outputting automatic judgment of the result. The electronic form output in the scheme of the invention can be automatically compared with the standard list, and the result is judged.
Drawings
Fig. 1 is a flow chart of the method for automatically testing code stream adaptability of a television according to the present invention.
Detailed Description
The invention will be further elucidated and described with reference to the embodiments of the invention described hereinafter.
Example (b):
the first embodiment is as follows:
as shown in fig. 1, a method for automatically testing code stream adaptability of a television includes the following steps:
step 1, recording the coordinates of each control of the code stream player. The precise control of the player can be realized by recording the coordinates of each control of the player;
and 2, importing a PyAutoGUI module into the python.
PyAutoGUI is a module written in Python with which the mouse and keyboard can be controlled. Therefore, the automatic control of the mouse and the keyboard to the code stream player and the automatic playing and switching of the code stream are realized. The PyAutoGUI module can determine a target position through a screen xy coordinate system, control the mouse and the keyboard to send virtual keystrokes and mouse clicks, complete operations of button clicking, form filling and the like, and therefore the mouse and the keyboard can be controlled by the PyAutoGUI module, and automatic control of the mouse and the keyboard on the code stream player is achieved.
Specifically, in this embodiment, when the PyAutoGUI module is imported into python, the import implementation syntax is as follows:
import pyautogui
and 3, compiling a test script according to the operation flow of the code stream player, reading the spreadsheet of the code stream to be tested, and assigning the code streams to be played to the code stream player one by one.
For convenience of maintenance and modification, the code streams to be tested are collected and edited into a spreadsheet in advance, and the code streams to be played can be assigned to the code stream player one by reading a play list of the code streams through python.
Specifically, in this embodiment, when the read of the test code stream in the spreadsheet is implemented in python, the code stream is as follows:
bok=xlrd.open_workbook('d:\\Test\\tslist.xlsx')
sheet=bok.sheet_by_name('Sheet1')
row1=sheet.row_values(0)
cell_d4=sheet.cell(0,0).value
cell _ d4 is the code stream name and address
And 4, establishing communication connection with the television.
In particular, the method can be realized through USB connection or network connection. Meanwhile, a function monkey Runner.waitforConnection () is used to judge whether the network is successfully connected, if true is returned, the connection is successful, the next step is continued, if false is returned, the connection is failed, and the network needs to be manually reconnected.
And 5, starting an automatic test process and importing the API.
In this embodiment, after the preparation of the active object to be tested is completed, the automatic test process import API is started, where an implementation syntax of the import API is as follows:
from com.android.monkeyrunner import MonkeyRunner
from com.android.monkeyrunner import MonkeyDevice
from com.android.monkeyrunner import MonkeyImage。
and 6, controlling the television by the monkey launcher to realize automatic channel searching and determining the number of programs in the code stream.
And 7, calling a corresponding test menu by using the corresponding active object, positioning the element through the ID, and capturing and storing the entry information in the element into the spreadsheet.
The ID is obtained through an Android resource file (i.e., an xml file under res- > layout) corresponding to the application source code.
In this embodiment, the implementation code for the monkeyunner to call out the test menu through the active object is as follows:
viewer=device.getHierarchyViewer()
device.startActivity(component="com.mediatek.wwtv.tvcenter/com.mediatek.wwtv.tvcenter.nav.TurnkeyUiMainActivity")
the implementation code for grabbing elements by ID is as follows:
button=viewer.findViewById('id/banner_simple_channel_name')
#program_name
text=viewer.getText(button)
step 8, after one program information is captured and stored, switching to the next program until all program information is captured and stored; storing the captured information in an electronic form according to a format, namely ending a program test, switching to the next program to continue capturing and storing, and determining to circularly cut programs for several times according to the number of the programs determined by searching;
and 9, judging whether the current code stream is the last one, if so, finishing the test, and otherwise, continuously testing the next code stream.
And step 10, outputting the test result and comparing the results, specifically, using a file comparison program written based on C language to realize the comparison of the results.
Example two
A system for automatically testing code stream adaptability of a television comprises: the code stream player automatic control module is used for realizing automatic control on the code stream player; the code stream reading module is used for reading the code stream list and modifying and maintaining the code stream list; the automatic test module of the television program information is used for realizing the automatic control of the television and the reading of the program information; a result comparison module for outputting the result and comparing the result; the automatic television program information testing module is respectively connected with the code stream player automatic control module, the code stream reading module and the result comparison module.
The working principle of the system for automatically testing the code stream adaptability of the television in this embodiment is the operation steps of the method for automatically testing the code stream adaptability of the television in the first embodiment, and details are not repeated here.
EXAMPLE III
The embodiment discloses a computer device which can be a server and comprises a processor, a memory, a network interface and a database which are connected through a system bus. Wherein the processor of the computer device is configured to provide computing and control capabilities. The memory of the computer device comprises a nonvolatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program, and a database. The internal memory provides an environment for the operation of an operating system and computer programs in the non-volatile storage medium. The database of the computer equipment is used for storing data involved in the method for automatically testing the code stream adaptability of the television. The network interface of the computer device is used for communicating with an external terminal through a network connection. The computer program is executed by a processor to realize a method for automatically testing the code stream adaptability of the television.
In another embodiment, a computer device is provided, which includes a memory, a processor, and a computer program stored in the memory and executable on the processor, where the processor executes the computer program to implement the steps of the method for automatically testing code stream adaptability of a television in the first embodiment, or the processor executes the computer program to implement the functions of the modules of the system for automatically testing code stream adaptability of a television in the second embodiment. To avoid repetition, further description is omitted here.
In another embodiment, a computer-readable storage medium is provided, on which a computer program is stored, and the computer program, when executed by a processor, implements the steps of the method for automatically testing code stream adaptability of a television in the first embodiment, or the processor, when executing the computer program, implements the functions of the modules of the system for automatically testing code stream adaptability of a television in the second embodiment. To avoid repetition, further description is omitted here.
It will be understood that the above embodiments are merely exemplary embodiments taken to illustrate the principles of the present invention, which is not limited thereto. It will be apparent to those skilled in the art that various modifications and improvements can be made without departing from the spirit and substance of the invention, and these modifications and improvements are also considered to be within the scope of the invention.

Claims (10)

1. The method for automatically testing the code stream adaptability of the television is characterized by comprising the following steps of:
s1, recording coordinates of each control of a code stream player;
s2, importing a PyAutoGUI module into the python;
s3, compiling a test script according to the operation flow of the code stream player, reading an electronic form of the code stream to be tested, and assigning the code streams to be played to the code stream player one by one;
s4, establishing communication connection with a television;
s5, starting an automatic testing process and importing an API;
s6, controlling the television to realize automatic channel searching and determining the number of programs in the code stream;
s7, calling a corresponding test menu by using the corresponding movable object, positioning the element through the ID, and capturing and storing entry information in the element into the spreadsheet;
s8, switching to the next program after one program information is captured and stored until all program information is captured and stored;
s9, judging whether the current code stream is the last one, if so, finishing the test, and if not, continuously testing the next code stream;
and S10, outputting a test result and comparing the results.
2. The method according to claim 1, wherein the step S4 of establishing a communication connection with the tv is implemented by a USB connection or a network connection.
3. The method according to claim 1, wherein the step S4 further includes using a function monkey runner waitforconnection () to determine whether the connection is successful.
4. The method according to claim 3, wherein in step S6, automatic channel searching is implemented by controlling the tv through monkeyner.
5. The method for code stream adaptability automation test of television according to claim 1, wherein the step S7 specifically comprises: the ID is obtained through an Android resource file corresponding to the application source code.
6. The method according to claim 1, wherein the step S10 is implemented by using a file comparison program written based on C language to compare the results.
7. The system for automatically testing the code stream adaptability of the television is characterized by comprising the following steps:
the code stream player automatic control module is used for realizing automatic control on the code stream player;
the code stream reading module is used for reading the code stream list and modifying and maintaining the code stream list; the automatic test module of the television program information, is used for realizing the automatic control to the television and reading of the program information;
the result comparison module is used for outputting a result and comparing the result;
the television program information automatic test module is respectively connected with the code stream player automatic control module, the code stream reading module and the result comparison module.
8. The system according to claim 7, wherein the codestream player automatic control module uses python's PyAutoGUI module to realize automatic control of the codestream player.
9. 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 method for code stream adaptability automation test for television set according to any one of claims 1 to 6 when executing the computer program.
10. A computer-readable storage medium, in which a computer program is stored, and the computer program, when being executed by a processor, implements the steps of the method for code stream adaptability automated testing for televisions according to any one of claims 1 to 6.
CN202011280121.8A 2020-11-16 2020-11-16 Code stream adaptability test method, system, computer equipment and storage medium Pending CN112188192A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011280121.8A CN112188192A (en) 2020-11-16 2020-11-16 Code stream adaptability test method, system, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011280121.8A CN112188192A (en) 2020-11-16 2020-11-16 Code stream adaptability test method, system, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN112188192A true CN112188192A (en) 2021-01-05

Family

ID=73918605

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011280121.8A Pending CN112188192A (en) 2020-11-16 2020-11-16 Code stream adaptability test method, system, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112188192A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113194310A (en) * 2021-03-26 2021-07-30 福州智象信息技术有限公司 Full frequency point detection method and system based on smart television operating system

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104038757A (en) * 2014-06-20 2014-09-10 深圳市九洲电器有限公司 Method and system for testing digital television terminal
CN105979259A (en) * 2016-06-16 2016-09-28 乐视控股(北京)有限公司 Test method and test device
CN108040254A (en) * 2017-12-15 2018-05-15 四川长虹电器股份有限公司 The method of set-top box tuner performance automated tuning
CN110198480A (en) * 2019-07-02 2019-09-03 成都极米科技股份有限公司 A kind of code stream test method and device

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104038757A (en) * 2014-06-20 2014-09-10 深圳市九洲电器有限公司 Method and system for testing digital television terminal
CN105979259A (en) * 2016-06-16 2016-09-28 乐视控股(北京)有限公司 Test method and test device
CN108040254A (en) * 2017-12-15 2018-05-15 四川长虹电器股份有限公司 The method of set-top box tuner performance automated tuning
CN110198480A (en) * 2019-07-02 2019-09-03 成都极米科技股份有限公司 A kind of code stream test method and device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113194310A (en) * 2021-03-26 2021-07-30 福州智象信息技术有限公司 Full frequency point detection method and system based on smart television operating system
CN113194310B (en) * 2021-03-26 2022-05-17 北京智象信息技术有限公司 Full frequency point detection method and system based on smart television operating system

Similar Documents

Publication Publication Date Title
CN111159049B (en) Automatic interface testing method and system
US10853232B2 (en) Adaptive system for mobile device testing
CN108959068B (en) Software interface testing method, device and storage medium
CN102904996B (en) The method and device of a kind of handset touch panel performance test, system
CN109871326B (en) Script recording method and device
US9342237B2 (en) Automated testing of gesture-based applications
US9161238B2 (en) Mobile device monitoring and testing
CN104598380A (en) Method and system for automatic testing based on control
CN106776319B (en) Automatic test method and device
CN110716853A (en) Test script recording method, application program testing method and related device
CN110879777A (en) Control testing method and device for application interface, computer equipment and storage medium
CN103631590A (en) Method for editing automated testing script
CN105138463A (en) Testing method and system for mobile terminal software
CN110795000B (en) Automatic control method and device based on interface segmentation and terminal
CN110248235B (en) Software teaching method, device, terminal equipment and medium
CN109189688B (en) Test case script generation method and device and electronic equipment
CN102622233A (en) System and method for automatically generating user interface applicable to certain interactive terminal equipment
CN114090436A (en) Test method and device
CN112188192A (en) Code stream adaptability test method, system, computer equipment and storage medium
CN112035412A (en) Data file importing method, device, storage medium and device
CN109144841B (en) Method and device for identifying advertisement application, computer equipment and storage medium
CN106844186B (en) Offline test method of application and terminal equipment
CN111026644B (en) Operation result labeling method and device, storage medium and electronic equipment
CN116233414A (en) Method and device for automatically testing code stream adaptability of android television
CN115114136A (en) Test data generation method and device, electronic equipment and program product

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20210105