[go: up one dir, main page]
More Web Proxy on the site http://driver.im/

CN107135390A - Automatic testing method and system for television application - Google Patents

Automatic testing method and system for television application Download PDF

Info

Publication number
CN107135390A
CN107135390A CN201710316535.3A CN201710316535A CN107135390A CN 107135390 A CN107135390 A CN 107135390A CN 201710316535 A CN201710316535 A CN 201710316535A CN 107135390 A CN107135390 A CN 107135390A
Authority
CN
China
Prior art keywords
test
television
python
television set
environment
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
CN201710316535.3A
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.)
Hunan MgtvCom Interactive Entertainment Media Co Ltd
Original Assignee
Hunan MgtvCom Interactive Entertainment Media 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 Hunan MgtvCom Interactive Entertainment Media Co Ltd filed Critical Hunan MgtvCom Interactive Entertainment Media Co Ltd
Priority to CN201710316535.3A priority Critical patent/CN107135390A/en
Publication of CN107135390A publication Critical patent/CN107135390A/en
Pending legal-status Critical Current

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N17/00Diagnosis, testing or measuring for television systems or their details
    • H04N17/004Diagnosis, testing or measuring for television systems or their details for digital television systems
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • 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
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/44227Monitoring of local network, e.g. connection or bandwidth variations; Detecting new devices in the local network
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04NPICTORIAL COMMUNICATION, e.g. TELEVISION
    • H04N21/00Selective content distribution, e.g. interactive television or video on demand [VOD]
    • H04N21/40Client devices specifically adapted for the reception of or interaction with content, e.g. set-top-box [STB]; Operations thereof
    • H04N21/43Processing of content or additional data, e.g. demultiplexing additional data from a digital video stream; Elementary client operations, e.g. monitoring of home network or synchronising decoder's clock; Client middleware
    • H04N21/442Monitoring of processes or resources, e.g. detecting the failure of a recording device, monitoring the downstream bandwidth, the number of times a movie has been viewed, the storage space available from the internal hard disk
    • H04N21/4424Monitoring of the internal components or processes of the client device, e.g. CPU or memory load, processing speed, timer, counter or percentage of the hard disk space used

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Signal Processing (AREA)
  • Multimedia (AREA)
  • Quality & Reliability (AREA)
  • Computer Hardware Design (AREA)
  • Databases & Information Systems (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Health & Medical Sciences (AREA)
  • Biomedical Technology (AREA)
  • General Health & Medical Sciences (AREA)
  • Testing, Inspecting, Measuring Of Stereoscopic Televisions And Televisions (AREA)

Abstract

The invention discloses an automatic testing method and system for television application, which comprises the steps of setting up a normal or abnormal testing environment according to different application services or business scenes after an APK (android package) is installed on a television; the method comprises the steps of setting a test scene of a television cluster according to a built test environment, running a Python automatic test script on the test scene, simulating the television key operation according to the Python automatic test script, realizing the automatic operation of a television, storing test data of application service of the television by adopting a Python log service program in the automatic operation process of the television, compiling a Python test verification script, analyzing current logs or data, analyzing and comparing the current logs or data with an expected result, and finally returning a test result. The invention greatly improves the testing efficiency, reduces the labor cost, ensures the testing accuracy and reduces the error rate, and adopts the simulation of an abnormal testing environment to greatly improve the testing coverage rate; the automatic test of the television cluster is realized.

Description

The automated testing method and system of a kind of TV applications
Technical field
The present invention relates to computer testing technology field, the automated testing method of particularly a kind of TV applications and it is System.
Background technology
With development in science and technology, the concept of intelligent television from the date of birth, is just developed rapidly with the situation that a single spark can start a prairie fire.When Before, intelligent television industry development is very rapid, and scale continuous enlargement, emerging technology is continued to bring out, and application service becomes increasingly abundant, raw State system accelerates to build, and fusion situation is more notable.Issue is constantly updated with the application service of intelligent television, use is being brought On the premise of the optimum experience of family, application service is required for carrying out substantial amounts of test before issue of reaching the standard grade.But current TV applications Test, most of company, which remains unchanged, uses manual test, is seldom related to automatic test.Existing TV applications method of testing With following deficiency:(1)The proving time of manual test is long can not to meet Quick thread demand, while substantial amounts of repeated work Cause the overtime of tester long.(2)Single test causes single test coverage low only for optimization function point.(3) Manual test has that error rate is higher simultaneously.(4)The operation behavior of simulated television is TV application automation One big difficult point of test.(5)The automatic test of TV applications can not simulate abnormal scene.(6)TV applications are in operating process In the validation problem of data feedback do not properly settled always.Therefore, in order to solve the above problems, it is necessary to which a kind of be adapted to electricity Depending on the automated testing method and system of application.
The content of the invention
The present invention is intended to provide the automated testing method and system of a kind of TV applications, reduce the testing time, improve and survey Try efficiency;Manpower is greatlyd save, without repeated work;Test accuracy is ensured, error rate is reduced;Improve test coverage.
In order to solve the above technical problems, the technical solution adopted in the present invention is:A kind of automatic test of TV applications Method, comprises the following steps:
1)In same LAN, TV applications APK installation kits are uploaded in same office by automated terminal test Multiple independent television sets in the net of domain, i.e. television set cluster, and installation instruction is issued to the television set cluster, automation is surveyed Try terminal-pair television set to be tested and carry out the installation of APK bags;
2)Normal or abnormal test environment is built according to different application service or business scenario, while the test environment is matched somebody with somebody Put to be issued to and complete the television set cluster that APK bags are installed, so that television set to be tested corresponds independent of each other survey Test ring border;Python automatic test scripts are write simultaneously, and dynamically wait page response, television set, Ran Houtong is automatically brought into operation Automated terminal test is crossed, test instruction is issued and gives television set cluster, tested for television set to be measured and its application service;
3)According to step 2)In the test environment built, the test scene of television set cluster is set, run on the test scene The Python automatic test scripts, and according to the Python automatic test scripts simulated television button operation, it is real The automation mechanized operation of existing television, during the automation mechanized operation of television, electricity is preserved using Python log services program Test data depending on holding application service, then writes Python test checking scripts, parses current daily record or data, and with it is pre- Phase interpretation of result is compared, and finally returns that test result.
Step 2)In, when building test environment for different application service or business, built using Python service routines Test environment, not only solve the problem of TV applications can not simulate abnormality test environment, and clearly develop and test Responsibility boundary, hereafter, test environment do not need developer to intervene or provide, it is ensured that the independence of testing process, test result Reliability.It subsequently includes the process that implements of the test environment configuration distributing to television set cluster:
1)For different application services or business scenario, the request of environment on its line is intercepted and captured, is returned according to testing requirement different Request results, so as to simulate various test scenes;For building test environment service, using Django frameworks, write Python service routines(Python service routines are that the request for intercepting and capturing environment on line is realized with Python, and return to difference Request results whole flow process);Start Python service routines, it is outside that Python service routines are accessed by port, externally Service is provided;
2)Nginx servers are built, and there is provided port is accessed during external service to switch to set domain name host for configuration nginx files;
3)Automated terminal test issues ADB orders to television set to be measured, and the order is the corresponding host of configuration, or cancels corresponding Host, as television set to be measured sets corresponding test environment, or cancels test environment.
Step 2)In, using Appium automated test frames, write based on the Appium automated test frames Python automatic test scripts.The Python automatic test scripts write based on the test frame are by realizing simulated television The remote controller key operation of machine, the problem of perfection solves automation mechanized operation television set, so as to realize television applications Automatic test.
In the present invention, the specific compiling procedure of Python automatic test scripts includes:Appium basic parameter is set; Writing includes the page elements of simulating keyboard transmission content and checking TV response feedback inside test function, the test function It is whether correct, it is different when existing using python exception handling come the abnormal conditions in processing routine inside test function In the case of often, reported an error into program and exit flow, otherwise, into normal follow-up processing flow(For example, such as search is " fast Happy base camp ", then plays some program of happy base camp, and normal follow-up processing flow just refers to after searching for successfully Playing flow).The Python automatic test scripts using abnormal mechanism it is ingenious solve test in face manually can not It is known and the problem of intervene.The stability of test script substantially reduces the error rate in test process;The repeated multiple times operation of script, Substantially increase testing efficiency;For single test, the recurrence functional coverage of test script(Non- individual feature point), greatly improve Coverage rate.
The specific compiling procedure of Python log services programs is:Intercept and capture log request interface;By whole log requests The data that interface is returned are stored in log server in the form of file.
Python tests verify that the specific compiling procedure of script is:Parse numerous different daily record numbers in log server According to;Comparative analysis and verify the correctness of data above one by one.
The present invention has abandoned conventionally employed software packet capturing mode using Python log services programs, not only thoroughly solves Packet loss problem in software packet capturing, and its scheme the problem of the solution data feedback of TV applications is verified, are follow-up survey Examination technology opens new thinking in the extension of other service ends.
Correspondingly, present invention also offers a kind of automatization test system of TV applications, including:
APK installs module:For in same LAN, TV applications APK installation kits to be uploaded by automated terminal test To multiple independent television sets in same LAN, i.e. television set cluster, and installation instruction is issued to the TV Machine cluster, automated terminal test carries out APK bags to television set to be tested and installed;
Test environment builds module:For building normal or abnormal test environment according to different application service or business scenario, Simultaneously by the test environment configuration distributing to the television set cluster that APK bags are installed is completed, so that television set to be tested Correspond test environment independent of each other;
Automatic test module:For writing Python automatic test scripts, and page response is dynamically waited, be automatically brought into operation electricity Depending on machine, then by automated terminal test, issue test instruction and give television set cluster, taken for television set to be measured and its application Business is tested;
Test result analysis module:For according to the test environment built, the test scene of television set cluster being set, in the test The Python automatic test scripts are run in scene, and are pressed according to the Python automatic test scripts simulated television Key operation, realizes the automation mechanized operation of television, during the automation mechanized operation of television, using Python log services journeys Sequence preserves the test data of television application service, then writes Python test checking scripts, the current daily record of parsing or number According to, and with expected results com-parison and analysis, finally return that test result.
Compared with prior art, the advantageous effect of present invention is that:The automation that the present invention solves television set is surveyed Key issue is tried, the operation behavior for TV remote controller employs the mode of button simulated operation and realizes the automatic of television set Change;By the automatic test to TV applications, testing efficiency is greatly improved, cost of labor is reduced, test accuracy, drop is ensured Low error rate, using abnormality test environmental simulation, substantially increases test coverage;The automation for realizing television set cluster is surveyed Examination.
Brief description of the drawings
Fig. 1 is the test frame of TV applications of the present invention;
Fig. 2 is the testing process of TV applications of the present invention.
Embodiment
It is as follows that the present invention implements process:
Step 1:In same LAN, TV applications APK installation kits are uploaded in same by automated terminal test Numerous independent carrying Android operation systems in individual LAN(Android)Television set(Abbreviation television set cluster), and under Hair installation instruction gives television set cluster, and automated terminal test carries out APK bags to television set to be tested and installed.
Step 2:APK bags have been installed to television set to be measured in step 1, what the present invention was mainly tested be television set application it is soft Part, it is necessary to build individually controllable test environment before any operational trials, for the test of TV applications, abnormal scene Test environment build and be even more important.Specific to test environment service is built, then according to different application service or business scenario Normal or abnormal test environment is built, while by individually controllable test environment configuration distributing to television set cluster, so that Obtain television set to be tested and correspond test environment independent of each other.
Step 3:For automatic test, test environment is write after building successfully, it is necessary to carry out test script.How Realize that the operation behavior of simulated television is a big difficult point of TV application automatic test by script.It is current numerous Realize that the manually-operated technology of automatic imitation is generally basede on the page elements attribute of identification current machine equipment, so that for having known Other page elements carry out simulated operation.Television devices due to its page elements particularity can only identification division content, and All controls can not be recognized.Television set is operated by remote control simultaneously, thus the present invention needs to realize analog telecommand The function of the behavior of device, television set is automatically brought into operation so as to realize.Simulated operation TV is directed in the present invention inside Python scripts Machine uses two ways, and a kind of is the button operation mode using analog telecommand device, a kind of control for identification television equipment interface Part mode.Mainly write Python automatic test scripts in the step, test script by corresponding analogue-key operate with And control identification two ways realizes simulation behavior, and page response is dynamically waited, television set is automatically brought into operation so as to realize.Then By automated terminal test, issue test instruction and give television set cluster, carried out for television equipment to be measured and its application service Test.
Step 4:First according to the test environment built in step 2, test environment such as step 2 institute of television set cluster is set Show, the test environment of such as certain television applications is set to some scene, the test script of operating procedure 3 in this scene, and Simulated television button operation is write according to the test script in step 3, the automation mechanized operation of television is realized.It is in step 2 Individually controllable test environment in by the operation of the test script simulated television keyboard in step 3, step 4 is equivalent to test Environment is the estimated input content of TV applications, and the data in data feedback and test environment after automatic test operation are carried out Compare checking one by one.An ensuing most important step is test result checking, the i.e. data of TV applications in operation The checking of feedback.The step is mainly Python log services programs of building, and log server obtains TV applications service testing During daily record or interface data and preserve.Then Python test checking scripts, the current daily record of parsing or data are write, And with expected results com-parison and analysis, return to current test result, finally, test terminates to return to integrated testability report.
According to the automated testing method of TV applications, in its step 1, the definition of television set cluster is:
Television set cluster is the cluster of single multiple TV set composition inside same LAN.Every television set Android operation system need to be carried(Android).The composition rule of cluster is:It is No. 1 by N platforms television set numbering, No. 2 ... No. N, The television set cluster is i.e. by N platforms bank of televisions into every television set possesses single numbering, and numbering is tied up with television set IP address Fixed, when notifying No. 1 television set, the ADB orders actually issued are operated by the IP address of ADB No. 1 television set of connection Processing.By that analogy.
Automated terminal test carries out APK bags to television set to be tested and installed.What the present invention was tested is TV applications, electricity Need to be attached to television set to be measured in the form of APK bags depending on application software.Signified APK bags, refer to intelligent television system in the present invention System(The system is also that television set to be measured is attached in the form of APK bags), can also refer to single TV applications software.
In its step 2, build test environment service and specifically include following steps:
Step 21:For current automatic test business is for building test environment, typically provided by exploitation(It is substantially same Code dispose a set of test environment), and scene without exception builds.But the test environment in the present invention includes normal field Scape and abnormal scene, and be all to be built by tester by the test scene constructed after Test Sample Design.This hair Bright that test environment is built using a kind of new thinking, that is, the request for intercepting and capturing environment on line returns to different ask according to testing requirement Result is sought, so as to simulate various test scenes.
For building test environment(Abnormal scene and normal scene)Service, the present invention uses Django frameworks, writes Python service routines, i.e., realize the request for intercepting and capturing environment on line, and return to the whole of different request results with Python Individual flow(Its general principle is:The parameter of request interface on line is intercepted and captured and parsed, the different required parameter of same interface is simulated Return to different request results).Then start the service routine, outside is accessed by port, so as to realize external offer service.
Finally, the test environment that Python service routines are realized is described below shown, such as same interface, and required parameter is When " live ", 404 are returned.Required parameter is " program request ", is back on line and asks, request is normal, the like.(Test The live film of environment such as certain returns to 404 mistakes, the live film can not normal play, but other program request films, still just Often play).
Step 22:Python procedure services can only be accessed by port, and then need further to build nginx in the present invention Server, the configuration by nginx files is there is provided accessing port during external service to switch to set domain name host, then outside can Directly to configure domain name host access, it is not necessary to accessed by port(Baidu is such as accessed by domain name www.baidu.com, and It is not xxx.xxx.xxx.xxx:8080 this access stencils).
Step 23:By above step, the present invention realizes a set of test environment for being available for outside access, and outside only needs to carry out Host, which is set, may have access to, and similarly similar, the present invention can realize a variety of independent test environments.Then automatic test service Device configures corresponding host files, television set as to be measured by issuing ADB orders to television set cluster for television set to be measured Corresponding test environment is set.Test environment class is such as:When TV applications service access certain domain name, what is actually accessed is test The domain name of environment, but other domain names are not influenceed, for the same domain name of test environment, the interface being trapped only is influenceed, Other interfaces are still accessed to normal scene, and further, the same interface of test environment also only influences the parameter being trapped That request, do not interfere with other request.In this step, the ADB orders that automatic test server terminal is issued are to be measured Television set, the order is the corresponding host of configuration, or cancels corresponding host.Television set as to be measured sets corresponding test wrapper Border, or cancel test environment.
According to the automated testing method of TV applications, in its step 3, following steps are specifically included:
Step 31:The present invention is needed to write Python automatic test scripts, and two kinds are recognized by button simulated operation and control Mode realizes the function of the behavior of analog telecommand device, and television set is automatically brought into operation so as to realize.Present invention employs Appium certainly Dynamicization test frame, the automatic test that Python automatic test scripts realize TV applications is write based on the framework.
The reason for present invention is using two ways is:Television set carries Android operation system(Android), thus can be with By write Python scripts recognize android system television equipment interface control so that operational controls,(It is similar to The automatic test of mobile terminal), and then operate television set.But the television set of Android operation system is carried, it is not to know Not whole controls, can only identification division control, so Python scripts can be carried out for the control that can recognize of part Operation, it is impossible to which the control of identification is still realized by the way of button simulated operation is automatically brought into operation television set.
Button simulated operation method is:Appium provides the API of a set of button operation, and API realizations are upward, downward, turn over Page, arouse Menu key etc. operation.The Python scripts that the present invention writes are by calling Appium analogue-keys to operate API, realizes the operation behavior of similar simulated television set remote-controller, television set is automatically brought into operation so as to realize.Such as Python script moulds Intend remote control and send upward order to television set to be measured, television set recognizes and responds upward button, this process is that realization is automatic Operate television set.
Control recognition methods is:Appium provides the API of a set of control identification, the API realize the identification of page control with The operation of page control(Click on, input)Deng operation.In the process, Python scripts remain unchanged the control by calling Appium API is recognized, the control of the identification television set page is realized and operates its control, television set responds its operation, so as to realize automatic behaviour Make television set.This control is clicked on as Python scripts recognize some button control of television set and triggered, television set is recognized and rung Corresponding button control is answered, this process is that realization is automatically brought into operation television set.
Step 32:Further, the flow of writing of Python automatic test scripts is to initialize service parameter first, Appium basic parameter is set, and such as its corresponding test IP address is the IP address of television set, and test system is Android systems System etc..Secondly, writing mainly includes simulating keyboard transmission content inside test function, test function(It is button simulated operation Two ways is recognized with control)It is whether correct with the page elements for verifying its TV response feedback.
In order in automatic test course, preferably capture its exception error(As simulating keyboard sends upwarding key, but its Respond into down Arrow, similar exception error etc.), test function the inside is using python exception handling, such as try ... Except ... else etc., when depositing in an exceptional case, into abnormality processing flow, otherwise, into normal process flow.Such as mould Intend keyboard and send upwarding key, when its response is upwarding key, then into normal process flow(Continue subsequent operation), when it is responded not For upwarding key(Such as other any exception errors), then into abnormality processing flow(Interruption, which is exited, to report an error).
Test function realizes the testing process of some business:Its flow carries out simulated operation mainly for operation flow, such as For a search behavior of TV applications, i.e. test function can click on search button(Simulating keyboard is sent), verify whether into Enter searched page(The element of its page feedback is verified, is continued if normal, abnormal then interruption is exited and reported an error), for searched page Input frame above, inputs some parameter and scans for behavior(Simulating keyboard is sent), search result is shown after searching for successfully(Test The element of its page feedback is demonstrate,proved, is continued if normal, abnormal then interruption is exited and reported an error), click on current search result(Simulating keyboard Send), verify whether current search result is searched for correctly(Verify its page feedback element, such as normally if continue, it is abnormal then Interruption, which is exited, to report an error).Finally, terminate current business, exit current scene.As described above, single test script is completed.
Step 33:Python scripts in above step send commands to television set, it is necessary to wait television set to respond, because This, Python scripts are in test process, for the wait-for-response time of the television set page, using dynamic waiting mechanism, rather than How long is fixed wait.This mechanism, not only greatly reduces the testing time, and got the single page for realizing Response time.
Step 34:Python scripts recognize two ways by button simulated operation and control, and standby using dynamic etc. System realizes the page after processing response in time.In above step, Python automatic test scripts have been fully able to realize pin To the simulated operation of television set.After the completion of Python automatic test scripts, it will subsequently pass through automatic test server terminal Test starting order is issued to television set to be measured, television set recognizes and responds the test command of Python test scripts, performs survey Try flow.
Further, the step 4 is specifically included:
Step 41:First according to the test environment built in step 2, set television set cluster test environment as shown in step 2, Test environment such as certain television applications is set to some scene, the test script of operating procedure 3 in this scene, and according to Test script in step 3 writes simulated television button operation, realizes the automation mechanized operation of television.It is in the only of step 2 Pass through the operation of the test script simulated television keyboard in step 3 in vertical controllable test environment.
Step 42:For the checking of the data feedback of TV applications in operation, the technology typically used is using grabbing Bag software, is then analyzed the result after packet capturing.But there is packet loss in packet capturing software, and in inside television The test of its internal applications software can be influenceed by installing packet capturing software.The method that the present invention is used is builds Python log services journeys Sequence, the principle that its program is built is:Log request interface is intercepted and captured, the data that whole log request interfaces is returned are stored in daily record Server.Its follow-up external service procedure is consistent with the external service procedure of the offer of the step 22 in above-mentioned steps 2.Pass through clothes Domain name of being engaged in configuration, the present invention is in the test process that TV applications are serviced, and its whole log request produced can be automatically saved to Log server.
Step 43:The final step of the automatic test of TV applications is analysis and validation test result.For step 41 The daily record of reservation, the present invention write Python test checking script, parse log server current operation process log, and with Expected results com-parison and analysis, returns to test result.Certain daily record of log server is such as parsed, its result is 15 parameters, than Whether it is 15 parameters compared with expected results, whether each parameter further compared in daily record is consistent with expected results, such as differs Cause, then return to failure.Unanimously, then pass through.Finally, test terminates, and returns to the test report of current process or whole result.
It is described further with reference to the accompanying drawings and detailed description.Reference picture 1, in same LAN, it is necessary to Television set cluster, automatic test server, test environment service device, log server, automatic test server connection electricity Depending on machine cluster, the configuration of television set cluster internal and connecting test environment server and log server.
Such as Fig. 2, the inventive method comprises the following steps:
Step 1:In same LAN, the APK of TV applications or intelligent television system is uploaded by automated terminal test Installation kit issues installation instruction and gives television set cluster to television set cluster, and automated terminal test is to television set to be measured(Compile Number be 1)Carry out APK bags to install, because numbering and its IP address of television set are bound, the APK that issues of automated terminal test connects Connect and be with the instruction installed:Adb connect IP, adb install-r xxx.apk." adb connect IP " are company The television set that numbering is 1 is connect, " adb install-r " is that some current APK of solar obligation covering is installed on TV machine Bag(This is intelligent operating system or application software).
Step 2:Test environment service is built, the present invention uses Django frameworks, write Python service routines, program is compiled The principle write is:The parameter of request interface on line is intercepted and captured and parsed, the different required parameter of same interface is simulated and returns to difference Request results.I.e. same interface, when required parameter is " live ", returns to 404.Required parameter is " program request ", is back to Asked on line, request is normal, the like.(The live film of test environment such as certain returns to 404 mistakes, and the live film can not Normal play, but other program request films, still normal play), lower example is intercepts and captures current POST request, and parsing wherein v joins Number, obtains vid value, and when confirming that vid is some value, the result for returning to parameter current request interface is 404.Same interface Other specification request remains in that normal return.
if req.method == 'POST':
v = req.POST.get('v')
vjson = json.loads(v)
vid = str(vjson["v"]["id"])
if vid == “xxxx”:
return HttpResponseNotFound('<h1>Page not found</h1>')
else:
te = urllib.urlopen('http://xxx.xxx.com' + req.get_full_path())
return HttpResponse(te.read(), content_type="application/xml")
Then nginx servers are built, by the configuration of nginx files, external service can be provided.It is because nginx can be with Configure and ask certain domain name to some local service, switch to set domain name so as to access port when providing external service host。
By step 2, the present invention realizes a set of test environment for being available for outside access, and outside only needs to carry out host to set i.e. It may have access to, similarly similar, the present invention can realize a variety of independent test environments.Then automatic test server is by issuing ADB orders configure corresponding host files, the application service request of television set will to television set cluster for the television set selected It is intercepted, asks to current test environment, so as to realize various scenes(Including abnormal scene and normal scene)Simulation.From Its ADB order issued of dynamicization testing service is:Adb shell su-c ' mount-o remount, rw/system', adb shell su -c 'echo “x.x.x.x xxx.xxx.com”>>/ system/etc/host', first order be Current/system catalogue access limits are assigned, second order is as above ordered to write test environment service to system host files It is specific test environment to make the environment configurations for servicing TV applications(Including abnormal and normal).By that analogy, television set collection The TV applications of group can configure different testing service environment one by one respectively.
Step 3:Python automatic test scripts are write, test script is known by corresponding button simulated operation and control Do not constitute, constitute a series of operation behavior flow of simulated television.The automated test frame that the present invention is selected is Appium. The method of testing one of the present invention is the remote controller operation behavior using button operation simulated television, and method two is use UiAutomator is positioned and is recognized the control operation of television set, waits page loading using dynamic waiting mechanism in the process Time.
Button simulated operation method is:Television set is used and pressed accordingly by remote controller operation, therefore automatic test script The remote controller operation of key operation order simulated television, Appium Data inputing order includes:KEYCODE_ENTER carriage returns Key 66, KEYCODE_DPAD_CENTER determination keys 23, KEYCODE_DPAD_UP navigation keys upward 19, KEYCODE_ Downward 20, the KEYCODE_DPAD_LEFT navigation keys of DPAD_DOWN navigation keys to the left 21, KEYCODE_DPAD_ RIGHT navigation keys 22, KEYCODE_PAGE_UP page up keys 92 to the right, KEYCODE_PAGE_DOWN is turned over downwards Page key 93, etc., such as the determination key of analog telecommand device, the order of its Python is:self.driver.press_ keycode(23)。
Control recognition methods is:The method of the control of UiAutomator fixation and recognition television sets be broadly divided into it is following several, By text message fixation and recognition, its method is find_element_by_name (), is positioned by the classname of control Identification, its method is find_element_by_class_name (), and by xpath method fixation and recognitions, its method is Find_element_by_xpath (), by control ID fixation and recognitions, its method is find_element_by_id (), is passed through Androiduiautomator fixation and recognitions, its method is find_element_by_android_uiautomator () etc. Deng.Such as recognize some control and click on, the order of its Python is:find_element_by_id(“someid”) .click()
Meanwhile, television set sends key commands to its response and there is the stand-by period, and script provides an operation state waiting mode Its order is:element = WebDriverWait(self.driver, 5).until(lambda x: x.find_ Element_by_id (' someid')), self.driver is WebDriverWait driver, 5 for it is most long overtime when Between, until is calls the parameter of driver that this method is provided, until return value is not False.Lambda provides a fortune The method of dynamic creation function during row.Its implication ordered is situation about being occurred without as control someid on the page more than 5s Under, report an error.As occurred in 5s, then succeed.
Automatic test service terminal, issues test instruction and gives television set cluster, pass through the Python pin in above-mentioned steps Order in this is tested television equipment to be measured and its application service.Automatic test services its ADB order issued: Adb connect IP, adb shell su-c ' python test.py', first order is certain television set of connection, the Two orders are to run some test script for the television set, the like, automatic test service terminal can bristle with anger down Make to numerous independent television sets, and perform respectively under different test scenes(Abnormal scene and normal scene)Test.
Step 4:Television set cluster and test environment are divided according to the ADB orders of automatic test service down distributing in step 2 Cloth correspondence after, then for the test script of every television set operating procedure 3, the ADB orders that it is issued as shown in step 3, Test script simulated television key in realizing it in the individually controllable test environment of step 2 by step 3 so as to the present invention The operation of disk.During the entire process of television set automatic test, its application service is preserved using Python log services programs Test data(Test log or interface data).The principle that Python log services programs are built is:Log request is intercepted and captured to connect Mouthful, the data that whole log request interfaces is returned are stored in log server.Its follow-up external service procedure and above-mentioned step The external service procedure of offer in rapid 2 is consistent.Configured by servicing domain name, the test process that the present invention is serviced in TV applications In, its whole log request produced can be automatically saved to log server.
The present invention write Python test checking script, parse log server current operation process log, and with it is pre- Phase interpretation of result is compared, and returns to test result.Certain daily record of log server is such as parsed, its result is 15 parameters, is compared Whether expected results are 15 parameters, and whether each parameter further compared in daily record is consistent with expected results, such as inconsistent, Then return to failure.Unanimously, then pass through.Finally, test terminates, and returns to the test report of current process or whole result.
Send instructions under automatic test server terminal and carry out the test of TV applications, after it terminates, can show current Test result, and mail sends test result to related personnel.
Further, TV applications APK installation kits of the present invention refer to intelligent television system(Such as the autonomous intelligence TV of certain brand System), can also refer to single TV applications software.
Further, test environment service includes abnormal scene and normal scene test environment service.
Further, keyboard and control operation include click, input, evoking screens, selection and drag operation.

Claims (7)

1. a kind of automated testing method of TV applications, it is characterised in that comprise the following steps:
1)In same LAN, TV applications APK installation kits are uploaded in same office by automated terminal test Multiple independent television sets in the net of domain, i.e. television set cluster, and installation instruction is issued to the television set cluster, automation is surveyed Try terminal-pair television set to be tested and carry out the installation of APK bags;
2)Normal or abnormal test environment is built according to different application service or business scenario, while the test environment is matched somebody with somebody Put to be issued to and complete the television set cluster that APK bags are installed, so that television set to be tested corresponds independent of each other survey Test ring border;Python automatic test scripts are write simultaneously, and dynamically wait page response, television set, Ran Houtong is automatically brought into operation Automated terminal test is crossed, test instruction is issued and gives television set cluster, tested for television set to be measured and its application service;
3)According to step 2)In the test environment built, the test scene of television set cluster is set, run on the test scene The Python automatic test scripts, and according to the Python automatic test scripts simulated television button operation, it is real The automation mechanized operation of existing television, during the automation mechanized operation of television, electricity is preserved using Python log services program Test data depending on holding application service, then writes Python test checking scripts, parses current daily record or data, and with it is pre- Phase interpretation of result is compared, and finally returns that test result.
2. the automated testing method of TV applications according to claim 1, it is characterised in that step 2)In, will be described The process that implements of test environment configuration distributing to television set cluster includes:
1)For different application services or business scenario, the request of environment on its line is intercepted and captured, is returned according to testing requirement different Request results, so as to simulate various test scenes;For building test environment service, using Django frameworks, write Python service routines;Start Python service routines, it is outside that Python service routines are accessed by port, clothes are externally provided Business;
2)Nginx servers are built, and there is provided port is accessed during external service to switch to set domain name host for configuration nginx files;
3)Automated terminal test issues ADB orders to television set to be measured, and the order is the corresponding host of configuration, or cancels corresponding Host, as television set to be measured sets corresponding test environment, or cancels test environment.
3. the automated testing method of TV applications according to claim 1, it is characterised in that step 2)In, use Appium automated test frames, Python automatic test scripts are write based on the Appium automated test frames.
4. the automated testing method of TV applications according to claim 3, it is characterised in that Python automatic tests The specific compiling procedure of script includes:Appium basic parameter is set;Write includes inside test function, the test function Whether the page elements of simulating keyboard transmission content and checking TV response feedback are correct, using Python's inside test function The abnormal conditions that exception handling comes in processing routine, when depositing in an exceptional case, report an error into program and exit flow, no Then, into normal follow-up processing flow.
5. the automated testing method of TV applications according to claim 1, step 3)In, it is characterised in that Python The specific compiling procedure of log services program is:Intercept and capture log request interface;The data that whole log request interfaces is returned Log server is stored in the form of file.
6. the automated testing method of TV applications according to claim 1, step 3)In, it is characterised in that Python Test verifies that the specific compiling procedure of script is:Parse numerous different daily record datas in log server;Comparative analysis one by one And verify the correctness of data above.
7. a kind of automatization test system of TV applications, it is characterised in that including:
APK installs module:For in same LAN, TV applications APK installation kits to be uploaded by automated terminal test To multiple independent television sets in same LAN, i.e. television set cluster, and installation instruction is issued to the TV Machine cluster, automated terminal test carries out APK bags to television set to be tested and installed;
Test environment builds module:For building normal or abnormal test environment according to different application service or business scenario, Simultaneously by the test environment configuration distributing to the television set cluster that APK bags are installed is completed, so that television set to be tested Correspond test environment independent of each other;
Automatic test module:For writing Python automatic test scripts, and page response is dynamically waited, be automatically brought into operation electricity Depending on machine, then by automated terminal test, issue test instruction and give television set cluster, taken for television set to be measured and its application Business is tested;
Test result analysis module:For according to the test environment built, the test scene of television set cluster being set, in the test The Python automatic test scripts are run in scene, and are pressed according to the Python automatic test scripts simulated television Key operation, realizes the automation mechanized operation of television, during the automation mechanized operation of television, using Python log services journeys Sequence preserves the test data of television application service, then writes Python test checking scripts, the current daily record of parsing or number According to, and with expected results com-parison and analysis, finally return that test result.
CN201710316535.3A 2017-05-08 2017-05-08 Automatic testing method and system for television application Pending CN107135390A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710316535.3A CN107135390A (en) 2017-05-08 2017-05-08 Automatic testing method and system for television application

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710316535.3A CN107135390A (en) 2017-05-08 2017-05-08 Automatic testing method and system for television application

Publications (1)

Publication Number Publication Date
CN107135390A true CN107135390A (en) 2017-09-05

Family

ID=59732389

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710316535.3A Pending CN107135390A (en) 2017-05-08 2017-05-08 Automatic testing method and system for television application

Country Status (1)

Country Link
CN (1) CN107135390A (en)

Cited By (21)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109413678A (en) * 2018-12-25 2019-03-01 欧普照明股份有限公司 A kind of Wi-Fi module automatic test approach and test macro
CN109446091A (en) * 2018-10-31 2019-03-08 中国银行股份有限公司 Business Entity object test method and device
CN109582568A (en) * 2018-11-13 2019-04-05 武汉风行在线技术有限公司 A kind of data report automated testing method
CN109634824A (en) * 2018-12-03 2019-04-16 郑州云海信息技术有限公司 Distributed storage performance test methods and system under a kind of broadcasting and TV business scenario
CN109726100A (en) * 2018-04-19 2019-05-07 平安普惠企业管理有限公司 Application performance test method, apparatus, equipment and computer readable storage medium
CN109960646A (en) * 2017-12-25 2019-07-02 福建天晴数码有限公司 A kind of test method and terminal of application
CN110061864A (en) * 2019-03-26 2019-07-26 网宿科技股份有限公司 A kind of method and system of domain name configuration automatic Verification
CN110196804A (en) * 2018-04-24 2019-09-03 腾讯科技(深圳)有限公司 The test method and device of business, storage medium, electronic device
CN110287069A (en) * 2019-05-21 2019-09-27 平安银行股份有限公司 ESB automatic interface testing method, server and computer readable storage medium
CN110830796A (en) * 2019-11-01 2020-02-21 深圳创维-Rgb电子有限公司 Television application testing method, television application testing device and readable storage medium
CN110971890A (en) * 2018-09-30 2020-04-07 青岛海尔多媒体有限公司 Method and device for television production test and computer storage medium
CN111209181A (en) * 2018-11-21 2020-05-29 北京京东尚科信息技术有限公司 Regression testing method, system, device and computer storage medium
CN111949551A (en) * 2020-09-01 2020-11-17 网易(杭州)网络有限公司 Application program testing method, device, equipment and storage medium
CN112015653A (en) * 2020-08-31 2020-12-01 中移(杭州)信息技术有限公司 Problem positioning method, server and storage medium
CN112203082A (en) * 2020-09-27 2021-01-08 深圳创维-Rgb电子有限公司 Data driving frame test method of virtual key value, television and readable storage medium
CN112532473A (en) * 2020-11-12 2021-03-19 苏宁金融科技(南京)有限公司 DNS (Domain name System) -based multi-environment test access method and device
CN112911283A (en) * 2021-02-05 2021-06-04 湖南快乐阳光互动娱乐传媒有限公司 Smart television testing method and device
CN112965907A (en) * 2021-03-11 2021-06-15 南京爱奇艺智能科技有限公司 VR APP automatic test method and device
CN113342677A (en) * 2021-06-29 2021-09-03 平安普惠企业管理有限公司 Interface testing method and device, computer equipment and storage medium
CN115278224A (en) * 2022-08-24 2022-11-01 视若飞信息科技(上海)有限公司 Method and device for testing HbbTV of smart television
CN117395175A (en) * 2023-10-08 2024-01-12 宁畅信息产业(北京)有限公司 Network application software testing method, device, equipment, medium and program product

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1859581A (en) * 2005-12-02 2006-11-08 华为技术有限公司 Detecting system for IP set-top tox and realizing method
CN103473174A (en) * 2013-09-10 2013-12-25 四川长虹电器股份有限公司 Cloud testing method for application software of intelligent televisions
CN103634592A (en) * 2013-12-09 2014-03-12 乐视致新电子科技(天津)有限公司 Automatic test method and system for intelligent televisions
CN105426298A (en) * 2014-08-25 2016-03-23 腾讯科技(深圳)有限公司 ADB (Android debug bridge)-based software test method and system
CN106227662A (en) * 2016-07-22 2016-12-14 中国科学院声学研究所 A kind of intelligent television application examination & verification test system and method
CN106341681A (en) * 2016-08-09 2017-01-18 青岛海信传媒网络技术有限公司 Television application testing method and apparatus

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1859581A (en) * 2005-12-02 2006-11-08 华为技术有限公司 Detecting system for IP set-top tox and realizing method
CN103473174A (en) * 2013-09-10 2013-12-25 四川长虹电器股份有限公司 Cloud testing method for application software of intelligent televisions
CN103634592A (en) * 2013-12-09 2014-03-12 乐视致新电子科技(天津)有限公司 Automatic test method and system for intelligent televisions
CN105426298A (en) * 2014-08-25 2016-03-23 腾讯科技(深圳)有限公司 ADB (Android debug bridge)-based software test method and system
CN106227662A (en) * 2016-07-22 2016-12-14 中国科学院声学研究所 A kind of intelligent television application examination & verification test system and method
CN106341681A (en) * 2016-08-09 2017-01-18 青岛海信传媒网络技术有限公司 Television application testing method and apparatus

Cited By (28)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109960646A (en) * 2017-12-25 2019-07-02 福建天晴数码有限公司 A kind of test method and terminal of application
CN109960646B (en) * 2017-12-25 2023-02-28 福建天晴数码有限公司 Application testing method and terminal
CN109726100A (en) * 2018-04-19 2019-05-07 平安普惠企业管理有限公司 Application performance test method, apparatus, equipment and computer readable storage medium
CN110196804B (en) * 2018-04-24 2022-03-11 腾讯科技(深圳)有限公司 Service testing method and device, storage medium and electronic device
CN110196804A (en) * 2018-04-24 2019-09-03 腾讯科技(深圳)有限公司 The test method and device of business, storage medium, electronic device
CN110971890B (en) * 2018-09-30 2022-04-19 青岛海尔多媒体有限公司 Method and device for television production test and computer storage medium
CN110971890A (en) * 2018-09-30 2020-04-07 青岛海尔多媒体有限公司 Method and device for television production test and computer storage medium
CN109446091A (en) * 2018-10-31 2019-03-08 中国银行股份有限公司 Business Entity object test method and device
CN109582568A (en) * 2018-11-13 2019-04-05 武汉风行在线技术有限公司 A kind of data report automated testing method
CN111209181A (en) * 2018-11-21 2020-05-29 北京京东尚科信息技术有限公司 Regression testing method, system, device and computer storage medium
CN109634824A (en) * 2018-12-03 2019-04-16 郑州云海信息技术有限公司 Distributed storage performance test methods and system under a kind of broadcasting and TV business scenario
CN109413678A (en) * 2018-12-25 2019-03-01 欧普照明股份有限公司 A kind of Wi-Fi module automatic test approach and test macro
CN110061864A (en) * 2019-03-26 2019-07-26 网宿科技股份有限公司 A kind of method and system of domain name configuration automatic Verification
CN110061864B (en) * 2019-03-26 2022-07-26 网宿科技股份有限公司 Method and system for automatically verifying domain name configuration
CN110287069B (en) * 2019-05-21 2023-08-22 平安银行股份有限公司 ESB interface automatic test method, server and computer readable storage medium
CN110287069A (en) * 2019-05-21 2019-09-27 平安银行股份有限公司 ESB automatic interface testing method, server and computer readable storage medium
CN110830796A (en) * 2019-11-01 2020-02-21 深圳创维-Rgb电子有限公司 Television application testing method, television application testing device and readable storage medium
CN110830796B (en) * 2019-11-01 2021-09-03 深圳创维-Rgb电子有限公司 Television application testing method, television application testing device and readable storage medium
CN112015653A (en) * 2020-08-31 2020-12-01 中移(杭州)信息技术有限公司 Problem positioning method, server and storage medium
CN111949551A (en) * 2020-09-01 2020-11-17 网易(杭州)网络有限公司 Application program testing method, device, equipment and storage medium
CN112203082A (en) * 2020-09-27 2021-01-08 深圳创维-Rgb电子有限公司 Data driving frame test method of virtual key value, television and readable storage medium
CN112532473A (en) * 2020-11-12 2021-03-19 苏宁金融科技(南京)有限公司 DNS (Domain name System) -based multi-environment test access method and device
CN112532473B (en) * 2020-11-12 2023-09-01 苏宁金融科技(南京)有限公司 DNS-based multi-environment test access method and device
CN112911283A (en) * 2021-02-05 2021-06-04 湖南快乐阳光互动娱乐传媒有限公司 Smart television testing method and device
CN112965907A (en) * 2021-03-11 2021-06-15 南京爱奇艺智能科技有限公司 VR APP automatic test method and device
CN113342677A (en) * 2021-06-29 2021-09-03 平安普惠企业管理有限公司 Interface testing method and device, computer equipment and storage medium
CN115278224A (en) * 2022-08-24 2022-11-01 视若飞信息科技(上海)有限公司 Method and device for testing HbbTV of smart television
CN117395175A (en) * 2023-10-08 2024-01-12 宁畅信息产业(北京)有限公司 Network application software testing method, device, equipment, medium and program product

Similar Documents

Publication Publication Date Title
CN107135390A (en) Automatic testing method and system for television application
US11281570B2 (en) Software testing method, system, apparatus, device medium, and computer program product
CN109361562B (en) Automatic testing method based on associated network equipment access
US9069903B2 (en) Multi-platform test automation enhancement
KR20080065936A (en) Systems and methods for turbine control simulation
CN107465572A (en) Intelligent terminal method of testing, apparatus and system
US20150100832A1 (en) Method and system for selecting and executing test scripts
CN110309051A (en) Method, system, equipment and the storage medium of management of test cases
CN111124919A (en) User interface testing method, device, equipment and storage medium
CN110013672B (en) Method, device, apparatus and computer-readable storage medium for automated testing of machine-run games
CN103399814B (en) The method and device of automatic test
CN105487859B (en) A kind of big data component WEB dispositions methods based on template
CN115686540B (en) RPA control method and system based on Hongmong system
CN103412817B (en) Automatic test script Off Line Debugging Method and system
US20150100831A1 (en) Method and system for selecting and executing test scripts
CN108809755B (en) Automatic testing method and system for home gateway compatible with command line and WEB interface
CN107451060A (en) A kind of across mobile terminal automated test frame system
CN115658529A (en) Automatic testing method for user page and related equipment
CN106294172A (en) App self-testing method based on terminal unit and device
CN112231206A (en) Script editing method for application program test, computer readable storage medium and test platform
CN106445810B (en) A kind of test method and system of interactive software and equipment compatibility
CN112911283B (en) Smart television testing method and device
CN105550103B (en) A kind of automated testing method based on self-defined test script
CN111444109B (en) Mobile terminal UI automatic test method and system
CN112506772B (en) Web automatic test method, device, electronic equipment and storage medium

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: 20170905

RJ01 Rejection of invention patent application after publication