CN106095666B - Game automated testing method and relevant apparatus - Google Patents

Game automated testing method and relevant apparatus Download PDF

Info

Publication number
CN106095666B
CN106095666B CN201610388475.1A CN201610388475A CN106095666B CN 106095666 B CN106095666 B CN 106095666B CN 201610388475 A CN201610388475 A CN 201610388475A CN 106095666 B CN106095666 B CN 106095666B
Authority
CN
China
Prior art keywords
controls
target
game
server
automatic test
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610388475.1A
Other languages
Chinese (zh)
Other versions
CN106095666A (en
Inventor
方亮
荆彦青
许敏华
孙大伟
杨君
张伟
蔡怡峰
施晓廉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen 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 Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201610388475.1A priority Critical patent/CN106095666B/en
Publication of CN106095666A publication Critical patent/CN106095666A/en
Application granted granted Critical
Publication of CN106095666B publication Critical patent/CN106095666B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Pinball Game Machines (AREA)

Abstract

The embodiment of the present invention provides game automated testing method and relevant apparatus.This method includes:Target UI controls are searched, determine overlay area and current vertex position of the target UI controls on terminal display screen;According to current vertex position and overlay area, it is determined that the Action Events for target UI controls;Action Events comprise at least mode of operation and the operating position on terminal display screen;Terminal is notified to perform Action Events, to realize pair target UI controls corresponding with operating position, be operated using mode of operation.Game automated testing method and relevant apparatus in the embodiment of the present invention can simulate touching of the people to UI controls of playing and operate, and then realize and game is operated in terminal, and automatic test is carried out to game.

Description

Game automated testing method and relevant apparatus
Technical field
The present invention relates to Computer Applied Technology field, and in particular to game automated testing method and relevant apparatus.
Background technology
The species of terminal (such as PC, intelligent terminal) is many in the market, to be provided with Android operation system Smart mobile phone exemplified by, the up to thousands of moneys of its type, because the hardware and software that different type of machines uses is all different, so game It is required for carrying out compatibility test in mainstream model on stream and before listing, to verify that can it normally transport OK.
Conventional test methodologies are that tester manually operates game, this test mode labor intensive in different terminals And the time.
The content of the invention
In view of this, the embodiment of the present invention provides a kind of game automated testing method and relevant apparatus, to realize game Automatic test, save manpower and time.
To achieve the above object, the embodiment of the present invention provides following technical scheme:
One kind game automated testing method, the game automated testing method include:
Search target UI controls;
Determine overlay area and current vertex position of the target UI controls on the terminal display screen;
According to the current vertex position and overlay area, it is determined that the Action Events for the target UI controls;It is described Action Events comprise at least mode of operation and the operating position on the terminal display screen;
Notify the terminal to perform the Action Events, with realize pair target UI controls corresponding with the operating position, Operated using the mode of operation.
One kind game automatic test device, the game automatic test device includes automatic test module, described Automatic test module includes:
Searching unit, for searching target user interface UI controls;
First determining unit, for determining overlay area of the target UI controls on the terminal display screen and current Vertex position;
Action Events determining unit, for according to the current vertex position and overlay area, it is determined that being directed to the target The Action Events of UI controls;The Action Events comprise at least mode of operation and the operating position on the terminal display screen;
Communication unit, it is corresponding with the operating position with realization pair for notifying the terminal to perform the Action Events Target UI controls, operated using the mode of operation.
A kind of server, automatic test is carried out for the game to terminal;The server comprises at least processor, deposited Reservoir, wherein, it is stored with automatic test script in the memory;
The processor at least performs operations described below by running the automatic test script:
Determine overlay area and current vertex position of the target UI controls on the terminal display screen;
According to the current vertex position and overlay area, it is determined that the Action Events for the target UI controls;It is described Action Events comprise at least mode of operation and the operating position on the terminal display screen;
Notify the terminal to perform the Action Events, with realize pair target UI controls corresponding with the operating position, Operated using the mode of operation.
One kind game automated testing method, applied to terminal, the game automated testing method includes:
Receive from server or game automatic test device, instruction execution Action Events notice;The operation Event comprises at least mode of operation and the operating position on the terminal display screen;The mode of operation and operating position be by What the server or game automatic test device determined according to the current vertex position of the UI controls and overlay area;
According to the notice, the Action Events are performed, to realize pair UI controls corresponding with the operating position, use The mode of operation determined is operated.
A kind of terminal, it is characterised in that including:
Communication unit, for receiving from server or game automatic test device, instruction execution Action Events Notice;The Action Events comprise at least mode of operation and the operating position on the terminal display screen;Wherein, the operation Mode and operating position are by the server or current vertex position of the automatic test device according to the UI controls of playing Determined with overlay area;
Execution unit, it is pair corresponding with the operating position to realize for according to the notice, performing the Action Events UI controls, operated using the mode of operation determined.
One kind game automatization test system, including above-mentioned terminal, and, above-mentioned server, or above-mentioned game Automatic test device.
Due to touching operation of the people to UI controls in game, the really behaviour to the coordinate points (position) on terminal display screen Make, for example, clicking on some UI control, be click on coordinate points corresponding with the UI controls in fact.And in the embodiment of the present invention Game automated testing method and relevant apparatus, obtain the UI controls to be operated (target UI controls) covering on terminal display screen Cover area and current vertex position, and determine therefrom that out the Action Events for target UI controls.Then, notice terminal performs behaviour Make event.
By including mode of operation and the operating position on terminal display screen in the Action Events determined, therefore can Operation of the people to UI controls of playing is simulated, and then realizes and game is operated in terminal, automatic test is carried out to game.Cross herein Cheng Zhong, and game need not be manually operated in different terminals, therefore can save manpower and time.
Meanwhile game automated testing method and relevant apparatus in the embodiment of the present invention, be using target UI controls as pair As overlay area and current vertex position of the target UI controls on terminal display screen being determined, that is, what is obtained is target UI controls The real-time vertex position of part, with reference to overlay area, where the real position of target UI controls can be positioned in real time, without by random The dispar influence of pop-up window, resolution ratio, realize automation adaptation.
Brief description of the drawings
In order to illustrate more clearly about the embodiment of the present invention or technical scheme of the prior art, below will be to embodiment or existing There is the required accompanying drawing used in technology description to be briefly described, it should be apparent that, drawings in the following description are only this The embodiment of invention, for those of ordinary skill in the art, on the premise of not paying creative work, can also basis The accompanying drawing of offer obtains other accompanying drawings.
Fig. 1 is the computer architecture exemplary plot of server provided in an embodiment of the present invention or terminal;
Fig. 2 is server provided in an embodiment of the present invention and terminal interaction schematic diagram;
Fig. 3 is game current interface provided in an embodiment of the present invention and UI control tree schematic diagrames;
Fig. 4 a, 4b, 5-10 are game automated testing method exemplary process diagram provided in an embodiment of the present invention;
Figure 11,12 for it is provided in an embodiment of the present invention game automatic test device or server exemplary block diagram;
Figure 13 is the exemplary knot of terminal provided in an embodiment of the present invention (or game automatic test device in terminal) Composition.
Embodiment
Technical term that the present invention may use, write a Chinese character in simplified form or abridge as follows:
Hand is swum:Mobile phone games, for the game on PC is operated in, it is primarily referred to as operating on terminal and platform Game;
Game compatibility test:Because the species of in the market terminal is many, to be provided with the intelligence of Android operation system Exemplified by energy mobile phone, the up to thousands of moneys of its type, because the hardware and software that different type of machines uses is all different, so game is being opened During hair and listing before be required for carrying out compatibility test in mainstream model, with verify its can normal operation, this It is game compatibility test;
Unity engines:Unity engines are for creating the more flat of the type interaction contents such as 3d gaming, building visualization The comprehensive development of games instrument of platform, it is a professional game engine integrated comprehensively.100% game uses on the market at present Unity engines make;
UI:User interface;
UI controls:User interface controls, for example, referring to Fig. 3, it is an interface on the left of Fig. 3, there is two on the surface Individual UI controls, i.e., button and " being played with QQ friends " button " are played " with wechat good friend.In fact, UI controls are the UI shown in the figure right side A certain GameObject (node) in control tree is corresponding.Every UI controls correspond to a node in UI control trees.UI is controlled The title of GameObject corresponding to part is the control title of UI controls.
For example, the path of " being played with QQ friends " corresponding node of button is:"/BootObj/CUIManager/Form_ Login/LoginContainer/pnlMobileLogin/btnGroup/btnQQ"。
Wherein, the control title " played with QQ friends " is tnQQ, and its father's nodename is btnGroup, and btnGroup Father's node be pnlMobileLogin, by that analogy.
NGUI:Next-Gen UI kit, NGUI are that a set of powerful UI and event transmit framework on Unity engines;
UGUI:Similar with NGUI, UGUI is that a set of UI that Unity officials produce and event transmit framework.Available for creating Button, slide the UI controls such as column, click event etc. corresponding to treatment button;
WeTest platforms:High in the clouds cell phone managing system, the mobile phone of management misconduct room hundreds of.It can be obtained by WeTest platforms Take the service such as the screen shift of a certain portion's mobile phone, length and width, sectional drawing;WeTest platforms may include multiple cloud servers.
SDK:Software development kit;
ADB:One of Android Debug Bridge, Google offers, android developing instruments.Main effect is, Interactive service between computer and intelligent terminal is provided.By USB line, the software on computer can directly access intelligent terminal, even Connect intelligent terminal.
The present invention provides the game automated testing method applied to server, the game applied to server is automated and surveyed Trial assembly puts, the game automated testing method applied to terminal, the game automatic test device applied to terminal, server, Terminal and game automatization test system.
Game automatization test system may include server and terminal, and concretely home server or high in the clouds take server Business device.Home server can connect a station terminal, and cloud server can then connect more station terminals, is provided with terminal to be tested Game.
Above-mentioned terminal can be PC ends, or intelligent terminal, such as mobile phone, ipad etc..
Fig. 1 shows a kind of general-purpose computing system structure of above-mentioned server or terminal.
Above computer system may include bus, processor 101, memory 102, communication interface 103, input equipment 104 With output equipment 105.Processor 101, memory 102, communication interface 103, input equipment 104 and output equipment 105 are by total Line is connected with each other.Wherein:
Bus may include a path, and information is transmitted between computer system all parts.
Processor 101 can be general processor, such as general central processor (CPU), network processing unit (Network Processor, abbreviation NP), microprocessor etc. or ASIC (application-specific Integrated circuit, ASIC), or one or more integrated circuits for being used to control the present invention program program to perform.Also Can be digital signal processor (DSP), application specific integrated circuit (ASIC), ready-made programmable gate array (FPGA) or other can Programmed logic device, discrete gate or transistor logic, discrete hardware components.
Processor 101 may include primary processor, may also include baseband chip, modem etc..
The program or script for performing technical solution of the present invention are preserved in memory 102, operating system can also be preserved With other key businesses.Specifically, program can include program code, and program code includes computer-managed instruction.Script is then Generally preserved with text (such as ASCII), only explain or compile when called.
More specifically, memory 102 can include read-only storage (read-only memory, ROM), can store static state Information and instruction other kinds of static storage device, random access memory (random access memory, RAM), Can storage information and instruction other kinds of dynamic memory, magnetic disk storage, flash etc..
Input equipment 104 may include receive user input data and information device, such as keyboard, mouse, camera, Scanner, light pen, speech input device, touch-screen, pedometer or gravity sensor etc..
Output equipment 105 may include the device for allowing output information to user, such as display screen, printer, loudspeaker etc..
Communication interface 103 may include using a kind of device of any transceiver, to lead to other equipment or communication network Letter, such as Ethernet, wireless access network (RAN), WLAN (WLAN) etc..
Fig. 2 shows a kind of example arrangement of game automatization test system, including server and terminal.
It should be noted that the game automatization test system shown in Fig. 2 is only with containing a station terminal and a playscript with stage directions The example of server, it should not be construed as game automatization test system and be only limitted to include a station terminal and a server.
Game automatization test system can include multiple cloud servers, and each cloud server can connect more station terminals.
Automatic test device/module is included in server, performing game automation by automatic test device/module surveys Method for testing.
In one example, python scripts (game automatic test script) are stored with server, pass through operation Python scripts, the function of automatic test device/module can be achieved, perform above-mentioned game automated testing method.
In addition, also module can be checked comprising UI controls in server.In one example, UI controls check the function of module The editor's locator that can be stored by the CPU run memories in server is realized.
Game is installed, in order to complete game automatic test with hop server, above-mentioned game embedded in terminal WeTest SDK。
Wherein:
WeTest SDK can be considered the component of game, it is possible to provide gaming controls (particularly UI controls) ID inquiries, control position Put inquiry, interactive operation etc. (such as click, long-press, slip etc.).When playing startup, WeTest SDK start therewith, and meeting A socket service is opened, monitors the request from Python scripts.
Certainly, WeTest SDK are installed in gaming in automatic test course.The game version really issued In do not include WeTest SDK.
Python scripts:It can be communicated by ADB with WeTest SDK.Its function, which can include, checks game current interface, certainly Determine operation behavior, Predicated execution result.
UI controls check module:It is similar with UI Automator functions in Fig. 2, unlike, UI Automator can be looked into Android system standard UI controls are seen, and UI controls check that module can be used for the UI checked in the game developed using Unity engines Control, and each GameObject association attributes can be checked.It will use to UI controls and check in exploitation Python scripts Module.
For cloud server, foregoing description can connect more station terminals.The corresponding wetest of one station terminal service into Journey, it is corresponding to run a script.For example, cloud server connects 10 station terminals, then there are 10 wetest service processes, script meeting Operation 10 times.
Below by terms of the general character being related to based on invention described above, to the embodiment of the present invention further specifically It is bright.
First introduce the exploitation of automatic test script.
Automatic test script in the embodiment of the present invention may include that multiple classes realize object and automatic test logic;
Any sort realizes a kind of operation of basic test of object definition, for example, click, long-press, slip, sectional drawing, on sectional drawing Mark click location, performance data collection, terminal log collection or crash (collapse or sudden strain of a muscle are moved back) detection etc..
And the execution sequences of the above-mentioned one or more basic tests operations of automatic test logical definition, operation object and Execution condition.
The foregoing processor referred to runs the automatic test script, is suitable according to performing by automatic test logic Sequence, operation object and execution condition call corresponding class to realize object implementatio8.
Basic test operation be similar to cut, sew, stitching a button, buttonhole etc. operates.And automatic test logic is similar In defining when (under what conditions) cuts, cutting is any fabric, and when (under what conditions) sews, sewing Position be where, when stitch a button, stitched a button at what position (under what conditions), when (under what conditions) lock Eye, in what position buttonhole.
For different game, automatic test logic is different, and basic test operation is general constant.Basic test Operation need not typically develop, and can be directed to different game, exploitation design is carried out to automatic test logic.
In the present invention, automatic test logical AND specific implementation (class realizes object) is separated.So developer can Automatic test logic is concerned only with, and specifically how to be realized without concern.For example, clicking on this fundamental operation, tester can When design is clicked on, and what the specific implementation hit without focus is.
Fig. 4 a and Fig. 4 b are referred to, developing the flow of automatic test script may include:
401 parts:UI controls in server check that module obtains UI corresponding to the current interface and current interface of game Control tree, and be shown on the display screen of server.
In the present embodiment, the game that game is concretely developed by unity, such as mobile phone games, or can run on The game at PC ends.
The part may be implemented on PC (server) mesh of the UI control trees of synchronously play current picture and current interface 's.
Lockage button can be provided on the interface that server is shown, developer clicks on lockage button, and synchronous trip can be achieved The purpose for current picture and the UI control trees of playing, checks going game control state.
More specifically, Fig. 4 b are referred to, are that WeTest SDK of the module into game is checked from the UI controls in server Send synchronization request, the mode of WeTest SDK Resume Missions current pictures and UI control trees come obtain the current interface of game and UI control trees.
402 parts:UI controls check that module obtains the positional information of the input equipment input of server.
Above-mentioned input equipment is generally mouse or keyboard.In practical operation, in terms of developer's angle, it is to use mouse Mark or keyboard choose the UI controls in server current interface (synchronous with game current picture), then UI controls check that module can Get the positional information of mouse or input through keyboard.
For example, refer to Fig. 3, developer, which clicks, " plays that " this button, actual development personnel are click on QQ friends " with QQ friends play " coordinate points (x1, y1) corresponding to this button, then UI controls check that module has got position letter Breath --- coordinate points (x1, y1).
403 parts:UI controls check that module searches corresponding UI controls according to above-mentioned positional information, obtain searching knot Fruit.
In one example, Fig. 4 b, UI controls are referred to and check that module can send inquiry to the WeTest SDK in game Ask (positional information can be included), WeTest SDK return to lookup result.
More specifically, above-mentioned lookup result (alternatively referred to as UI control informations) may include the title of UI controls, path, current The overlay area of vertex position and UI controls on terminal display screen.
The top left co-ordinate of above-mentioned vertex position actually control, and overlay area is specially the length and width of UI controls.
It should be noted that, although UI controls can be rendered into variously-shaped, such as circle, ellipse etc. on foreground.But From the background, UI controls are shaped as rectangle.So every UI controls have the upper left corner.And for a rectangle, it is known that its upper left corner Coordinate, its overlay area is known again, then can uniquely determine the position where the rectangle.
The overlay area of current vertex position and UI controls on terminal display screen can be calculated by WeTest SDK.
Because in exploitation, developer is not aware that the relevant information of UI controls, can only position UI by location lookup Node of the control in UI control trees, obtain UI control informations.
404 parts:UI controls check module according to above-mentioned lookup result, and the game shown by the display screen in server is worked as The UI controls found are highlighted on front interface, meanwhile, the UI controls found are highlighted corresponding in UI control trees Node.
More specifically, UI controls check that module can be according to the current vertex position for the UI controls that SDK is fed back and at end The overlay area on display screen is held, UI controls are highlighted in the game current interface shown by the display screen in server.Example Such as, Fig. 3 is referred to, is highlighted with thick line square frame and " plays " this button with QQ friends.Certainly, it is also possible to which red, which encloses, to be come. Those skilled in the art can be highlighted using various ways, and therefore not to repeat here.
Meanwhile UI controls check the title, path that module can be according to the UI controls that SDK is fed back, and determine that UI controls exist Corresponding node in UI control trees, so as to highlight the node on the display screen of server.For example, referring to Fig. 3, use Dash box is highlighted node.Those skilled in the art can be highlighted using various ways, and therefore not to repeat here.
Because in exploitation, developer is not aware that the title of clicked on UI controls, and it is to develop to highlight Personnel can see the UI controls chosen with very clear, and see its position in UI control trees.So, exploit person is contributed to Member is more efficient must to write automatic test script.
405 parts:Server obtains the edit instruction of input equipment input.
In one example, server can dispose editor module, to perform 405 parts and 406 parts.
Above-mentioned edit instruction be used to editing the execution sequence that basic test in automatic test logic operates, operation object and Any one or any combination of execution condition.
Edit instruction can be generated based on second lookup result.
In practice, after getting title/path of UI controls in 404 parts, developer can by the title of UI controls/ Path is programmed into automatic test script as operation object, to edit automatic test logic.
In fact, any operation and input for python scripts, can be assumed that and assigned edit instruction.
406 parts:Server is according to edit instruction editor's automatic test logic.
Fig. 5 is referred to, how corresponding according to positional information lookup example below will be discussed in detail so that hand is swum as an example UI controls, obtain lookup result (UI control informations).
500 parts:Developer clicks on the lockage button on server interface.
501 parts:UI controls check that module is established socket with WeTest SDK and is connected, obtain hand trip current interface and Corresponding UI control trees.
In one example, it is to check that WeTest SDK of the module into hand trip is sent synchronously from the UI controls in server Request, WeTest SDK return to the mode of hand trip current picture and UI control trees, to obtain the current interface and UI controls of hand trip Tree.
502 parts:UI controls check that the hand of acquisition is swum current interface by module and UI control trees export showing to server Display screen, to show hand trip current interface and UI control trees.
503 parts:The UI controls on interface, UI controls check module face to face for the hand trip that developer's click server is shown Obtain the coordinate position clicked on;
For example, refer to Fig. 3, developer, which clicks, " plays that " this button, actual development personnel click with QQ friends Coordinate points (x1, y1) in server display, then UI controls check positional information that module gets include coordinate points (x1, y1)。
504 parts:UI controls check that the screen size of module acquisition intelligent terminal (can be by sending to andord mobile phones Adb shell-commands row obtains screen size), above-mentioned positional information is converted to the positional information of intelligent terminal display screen.
By taking Android phone as an example, 504 parts, which are accomplished that, is converted to the coordinate points on PC ends (server) The coordinate points of Android phone.
505 parts:UI controls check that the positional information of intelligent terminal display screen is transferred to WeTest SDK by module.
In one example, UI controls check that module can send query messages to WeTest SDK, are taken in the query messages Positional information with intelligent terminal display screen.
506 parts:The positional information of the intelligent terminal display screen received is converted into unity coordinate systems by WeTest SDK Under positional information.
By taking Android system as an example, android coordinate systems are different from unity coordinate systems, and android coordinate systems are with screen The upper left corner is the origin of coordinates, and unity coordinate systems are using the screen lower right corner as the origin of coordinates.
Due to WeTest SDK receive be Android screen coordinate system under positional information (coordinate), it is therefore desirable to The positional information (coordinate) positional information being converted under Unity screen coordinate system.
507 parts:UI controls corresponding to coordinate position under WeTest SDK lookup unity coordinate systems (or UI control trees On node), return UI control information (title, path, current vertex position and the area of coverage on intelligent terminal display screen Domain).
It should be noted that the UI controls of hand trip can be developed by the NGUI or UGUI of Unity engines.
For the control of NGUI exploitations, UICamera.Raycast methods can be called by reflecting, obtained under changing coordinates Corresponding GameObject.
For UGUI exploitations, can be got current by EventSystem.current.RaycastAll () method All controls under coordinate.If RaycastAll returns to multiple controls, the information of first control is returned.
Therefore, WeTest SDK can have two versions, and one is directed to NGUI, and one is directed to UGUI.
508 parts:UI controls check module according to above-mentioned lookup result, and the hand trip shown by the display screen in server is worked as The UI controls found are highlighted on front interface, meanwhile, the UI controls found are highlighted corresponding in UI control trees Node.
508 parts and 404 parts are similar, and therefore not to repeat here.
509 parts:Server obtains the edit instruction of input equipment input.
510 parts:Server is according to edit instruction editor's automatic test logic.
509 and 510 parts are similar with foregoing 405 and 406 parts respectively, and therefore not to repeat here.
Start to introduce game automatic testing process below.That play automatic test simulation is behaviour of the people to UI controls Make.
Fig. 6 is referred to, game automatic testing process may include:
600 parts:Whois lookup target UI controls.
In one example, 600 parts can be performed by the automatic test module in server.
Further, the function of automatic test module can by server processor run automatic test script Realize.
601 parts:Server determines overlay area and current vertex position of the target UI controls on terminal display screen.
In one example, 601 parts can be performed by the automatic test module in server.
Further, the function of automatic test module can by server processor run automatic test script Realize.
It should be noted that on script, general three row performs an operation, and the operation object of operation can be controlled with a UI Part, then this UI control is exactly target UI controls.
Certainly, foregoing to be referred to, automatic test script can perform a variety of basic test operations, such as click, long-press, cunning Dynamic, sectional drawing, click location, performance data collection, terminal log collection or crash detections etc. are marked on sectional drawing.
Click location, performance data collection, terminal log collection or crash detections etc. are marked for sectional drawing, on sectional drawing The operation object of operation may not be UI controls, then can be without carrying out 601 parts.
In addition, the overlay area in the present embodiment specifically may include the length and width of UI controls.
Its vertex position refers to coordinate of the UI controls upper left corner on terminal display screen.
In one example, above-mentioned overlay area and current vertex position can be true according to the unique mark of target UI controls It is fixed.Then in other embodiments of the present invention, before 601 parts, it is right in UI control trees that lookup target UI controls be can also carry out The node answered, the step of obtaining including target UI control unique marks.
602 parts:Server is according to the current vertex position and overlay area got, it is determined that for target UI controls Action Events.
Wherein, Action Events at least may include mode of operation and the operating position on terminal display screen.
In one example, the mode of operation for target UI controls concretely click on, long-press or slip.
Certainly, the mode of operation that those skilled in the art can support according to terminal carries out flexible design, and therefore not to repeat here.
And operating position (coordinate), can be single operation position with the difference of mode of operation, or it is multiple continuous Operating position.For example, click on, long-press, generally be directed to the operation of a single point, corresponding single operation position, and slide, then can be right Answer multiple continuous operating positions.
In one example, operating position can be calculated according to the current vertex position and overlay area got.Need Illustrate, game automatic test simulation is operation of the people to UI controls.
By people clicked on or long-press exemplified by, people is usually that can click on or the centre of long-press UI controls.For sliding UI controls are also such.And what is got in 601 parts is the coordinate in the UI controls upper left corner, therefore, it is necessary to calculate operating position.
In one example, 602 parts can be performed by the automatic test module in server.Further, automate The function of test module can run automatic test script to realize by the processor in server.
603 parts:Server notice terminal performs Action Events.
In one example, 603 parts can be performed by the automatic test module in server.Further, automate The function of test module can run automatic test script to realize by the processor in server.
Please referring also to Fig. 2, in one example, can from automatic test script (python scripts) by ADB to trip WeTest SDK in play send notice.
Then terminal performs aforesaid operations event, to realize pair UI controls corresponding with operating position, using true according to notice The mode of operation made is operated.
It can be seen that in embodiments of the present invention, the UI controls to be operated (target UI controls) can be obtained on terminal display screen Overlay area and current vertex position, and determine therefrom that out the Action Events for target UI controls.Afterwards, notice terminal is held Row Action Events.
On PC, the operation such as people can be clicked on by input equipments such as mouse, keyboards, long-press or slip, if certainly Screen on PC is touch-screen, can also be clicked on by touch-screen, the operation such as long-press or slip.
And on mobile device (intelligent terminal), the operation such as people is typically clicked on by touch-screen, long-press or slip.
Due to operation of the people to UI controls in game, the really operation to the coordinate points (position) on terminal display screen, For example, clicking on some UI control, coordinate points corresponding with the UI controls have been click in fact.And the embodiment of the present invention is determined Action Events in, the operating position comprising mode of operation and on terminal display screen.Therefore, the embodiment of the present invention is provided Scheme, touching of the people to UI controls of playing can be simulated and operated, realize and game is operated in terminal, automation survey is carried out to game Examination.
It should be noted that existing game automatization testing technique is mainly by recording coordinate sequence and then playing back to operate Game, to reach the purpose of automatic test.Its way is:Tester plays game in terminal, during game is played, Application program, which can record which position in terminal, to be touched or is slided, and records the resolution of coordinate position and current phone Rate, generate operation note.
Afterwards, main frame presses the coordinate information simulated touch in operation note or the operation of slip successively in chronological order, Reach the purpose of the whole testing process of simulation test personnel.But its shortcoming is obvious:
Shortcoming one, in existing automatic test course, because application program is in chronological order successively by operation note In coordinate information simulated touch or slip operation, can't go to identify the UI controls of current interface, but mechanically press The coordinate points of operation note in operation note, therefore, if there is unexpected interface (such as random pop-up window), subsequently Operation will likely complete entanglement.
Shortcoming two:Account state is different may to influence test.Because the account of different conditions, UI circle into game Face is laid out and flow is probably different, may cause to operate complete entanglement, can not completely expected testing process.
Shortcoming three:It may be influenceed by resolution ratio, then the coordinate points corresponding to same UI controls can be different for resolution ratio difference, machine The coordinate points of operation note in operation note are pressed tool, may influence test effect.
And the automatic test mode that the present embodiment is provided can then solve the above problems.Therefore, in the present embodiment, it is first Before this using target UI controls as object, overlay area and current vertex position of the target UI controls on terminal display screen are determined, That is, what is obtained is real-time vertex position, with reference to overlay area, it can position that target UI controls are real-time, where real position. The Action Events determined therefrom that out, the operation to the target UI controls on terminal game can be realized really.
Therefore, no matter random pop-up window, or account state, or resolution ratio do not interfered with to target UI The operation of control, really realize automation adaptation.
Fig. 7 shows a kind of interactive flow of game automatic test, and it may include:
700 parts:Server initiation python scripts;
How extended meeting introduction initializes python scripts after this paper.
701 parts:Server sends the inquiry request of target UI controls to terminal, to determine that target UI controls are worked as in game It whether there is in front interface.
In one example, the inquiry that can send target UI controls to the WeTest SDK of terminal from python scripts please Ask.
In view of in an interface, it is understood that there may be multiple title identical GameObject, therefore, fuzzy look into can be carried out Look for.Then above-mentioned inquiry request can include target UI controls relevant information as search criterion, for example, the name of target UI controls Title, the word in target UI controls, the picture name in target UI controls, and node corresponding to target UI controls are relative to father Any one in the position of node or any combination.
For example, with the word in target UI controls, the picture name in target UI controls, and corresponding to target UI controls Node is search criterion relative to position of father node etc., make WeTest SDK carry out fuzzy search, find out it is all meet look into Look for the UI controls of condition.
For example, search expression formula/BootObj/ScrollRect [0]/Content/* { txt=hand Q Androids great Qu, img =11203 }.Wherein, "/" represents one layer in GameObject structure trees, and txt=represents the word content in UI, img=tables Show the picture name in UI, [] represents position of the present node in father node since 0.
702 parts:Terminal searches target UI controls corresponding node in the UI control trees of game current interface, is wrapped The lookup result of the unique mark of the controls of UI containing target and return.
Unique mark can be InstanceID (object oriented), and inside an interface, InstanceID can unique mark One node.But InstanceID is temporary.
Certainly, if target UI controls are not present in the current interface of game, unique mark can be NULL, or other The numerical value that unique mark is not present can be represented.
In one example, 702 parts can be performed by the WeTest SDK to play.
SDK can obtain all effective GameObject in going game first, then Ergodic judgement node whether with target The relevant information of UI controls matches, and after all searching, returns to the node of all matchings.
And server can be using the node of all matchings as target UI controls.
701 and 702 parts are the refinements of foregoing 600 part.
703 parts:Server obtains target UI controls in the terminal display screen according to the unique mark of target UI controls On overlay area and current vertex position.
In one example, position enquiring request can be sent from python scripts to the WeTest SDK of terminal.Position is looked into Ask the unique mark got in request comprising 702 parts.
Then WeTest SDK determine above-mentioned overlay area and current vertex position according to the unique mark and returned.
The related content of overlay area and current vertex position can be found in 601 parts, and therefore not to repeat here.
704 parts:Server is according to the current vertex position and overlay area got, it is determined that for target UI controls Action Events.
704 parts and 602 parts are similar, and therefore not to repeat here.
705 parts:Server notice terminal performs Action Events.
705 parts and 603 parts are similar, and therefore not to repeat here.
706 parts:Terminal performs aforesaid operations event according to notice, with realize pair UI controls corresponding with operating position, Operated using the mode of operation determined.
In one example, 706 parts can be performed by the execution unit in terminal.
Specifically, the function of execution unit can be realized by the WeTest SDK to be played in terminal.
It is assumed that the mode of operation in Action Events is clicks on, operating position is coordinate points (x1, y1), then WeTest SDK Click is performed to the coordinate points (x1, y1) on terminal display screen.
In the present embodiment, to how to determine overlay area of the target UI controls on the terminal display screen and work as sinciput Point position has carried out more detailed description, ensure that the execution of game automatic test.
Fig. 8 shows a kind of interactive flow of game automatic test, and it may include:
801 parts:Connect WeTest SDK.
It for details, reference can be made to the introduction of following 1012 or 1021 parts.
After connection, python scripts can communicate with the WeTest SDK of terminal, and completing previous embodiment by interaction refers to Acquisition game work at present interface and UI control trees, inquiry unique mark, notice perform the action such as Action Events.
802 parts:Judgement tests whether to terminate, if so, into 808 parts, otherwise into 802 parts;
803 parts:Target UI controls are searched, obtain lookup result.
In one example, server sends the inquiry request of target UI controls to terminal.Terminal searches target UI controls The corresponding node in the UI control trees of game current interface, obtain the lookup result of the unique mark comprising target UI controls simultaneously Return.
Detail refers to foregoing 701 and 702 parts, and therefore not to repeat here.
804 parts:Judge whether target UI controls exist in game current interface, if in the presence of no into 805 parts Then enter 807 parts;
805 parts:Server obtains target UI controls in the terminal display screen according to the unique mark of target UI controls On overlay area and current vertex position.
805 parts and 703 parts are similar, and therefore not to repeat here.
806 parts:Server is according to the current vertex position and overlay area got, it is determined that for target UI controls Action Events, notice terminal perform Action Events.
Details can be found in 602 and 603 parts, and therefore not to repeat here.
807 parts:Triggering, which performs, is not present processing logic.
Flexible design processing logic can be not present as needed in those skilled in the art.For example, it can design in the absence of processing Logic is to exit, or collecting performance data etc..
808 parts:Terminate.
The initialization of python scripts will be introduced below.It can be initialized when performing and playing automatic test.
Fig. 9 is referred to, initialization procedure may include following steps:
901 parts:Current running environment is determined by the presence or absence of environmental variance.
Preceding to have addressed, server can be home server and cloud server.Running environment is corresponding to home server Home environment;Running environment corresponding to high in the clouds survey server is high in the clouds environment.
Server storage has environmental variance WPYSCRIPTS_MODE beyond the clouds, and its content can be " Cloud ", for high in the clouds Environment.And home server is not stored with environmental variance.
In order to cater to two kinds of running environment, automatic test script includes realizing class for different running environment.
902 parts:Establish the mapping relations of the network port of local or cloud server and the network monitoring port of terminal.
Local or cloud server are communicated by the network monitoring port of the network port and terminal.It is foregoing to refer to The communication of python scripts and WeTest SDK is carried out, it is necessary to pass through the network port with network monitoring port.
903 parts:Class is realized accordingly according to current running environment selection, corresponding class is created and realizes object.
Specifically, if running environment is high in the clouds environment, high in the clouds running environment is directed to from selection automatic test script Realize class, create corresponding class and realize object.Conversely, the reality of local operating conditions is directed to from selection automatic test script Existing class, creates corresponding class and realizes object.
Figure 10 shows a kind of more specifically implementation of initialization.Embodiment illustrated in fig. 10 by taking intelligent terminal as an example, The mapping relations of the main network monitoring port for having refined the network port for establishing local or cloud server and intelligent terminal Operation.Including:
1000 parts:Environmental variance whether there is, if it is, into 1011 parts, if not into 9021 parts;
Particular content on environmental variance can be found in 901 parts, and therefore not to repeat here.
1011 parts:The wetest service processes of phthon scripts and wetest platforms, which are established, to be connected.
It is foregoing to be referred to, operate in the corresponding terminal of a wetest service processes of cloud server.Wetest takes Business process is binding with mobile phone.Script goes to play games by connecting wetest service processes using wetest service processes Automatic test.
1012 parts:Python scripts establish first network port and the intelligence of cloud server to wetest platform requests Mapping relations between the first network listening port (SDK ports) of terminal, after wetest platforms establish mapping relations, first The port numbers of the network port return to python scripts.
It should be noted that either server, or intelligent terminal, port number is up to tens thousand of.And port numbers 6000 with On port, will not typically be used to.
The port numbers 1024-65535 being of little use then can dynamically be randomly choosed as SDK ports, such as 27018.
Certainly, 27018 port numbers of intelligent terminal can be also editing into by developer as the port numbers of SDK ports Python scripts.
After establishing mapping relations, python scripts can be by first network port and first network listening port, with intelligence The WeTest SDK communications of terminal, by interaction complete the acquisition that refers to of previous embodiment play (hand trip) work at present interface with UI control trees, inquiry unique mark, notice perform the action such as Action Events.
1013 parts:Python scripts establish second network port and intelligence of cloud server to wetest platform requests Mapping relations between the second network monitoring port (UIAutomator ports) of terminal, wetest platforms establish mapping relations Afterwards, the port numbers of second network port are returned to python scripts.
After establishing mapping relations, python scripts can be by second network port and the second network monitoring port, with intelligence The operation such as the UIAutomator servicing communications of terminal, the acquisition screen size referred to by interaction completion previous embodiment, also may be used Pass through UIAutomator query criteria UI controls.
First, second is served only for distinguishing.
1014 parts:The class that Python scripts create high in the clouds realizes object.
It is emphasized that this part is transparent for test logic development person.It is supplied to test logic development person Python scripts inside contained the class in high in the clouds and realize object.
1021 parts:Python scripts are serviced by ADB, by the first network port of home server and intelligent terminal Mapping relations between first network listening port (SDK ports).
After establishing mapping relations, python scripts can be by first network port and first network listening port, with intelligence The WeTest SDK communications of terminal, acquisition game work at present interface and the UI controls that previous embodiment refers to are completed by interaction Tree, inquiry unique mark, notice perform the action such as Action Events.
Due to being local operating conditions, the port numbers of the first network port of server can be fixed as to 40018, will intelligence 27018 port numbers of terminal are editing into python scripts as SDK port numbers.
Certainly, also can be in the port numbers 1024-65535 that dynamic random selects to be of little use as SDK ports.
1022 parts:Python scripts are serviced by ADB, and UIAutomator services are installed on intelligent terminal, and is opened Dynamic UIAutomator services.
1023 parts:Serviced by ADB, python scripts establish second network port and intelligent terminal of home server The second network monitoring port (UIAutomator ports) between mapping relations.
Due to being local operating conditions, the port numbers of second network port of server can be fixed as to 19008, will intelligence 9008 port numbers of terminal are editing into python scripts as the port numbers of UIAutomator ports.
1024 parts:Create local class and realize object.
It should be noted that under home environment, it need not typically support sectional drawing, click location, property are marked on sectional drawing Energy data acquisition, terminal log collection or crash detections, and environment beyond the clouds, then need to support aforesaid operations.Therefore, this reality Regular meeting is applied based on different running environment, the class to create different realizes object.
, can be in local after exploitation tester has write python scripts due to supporting to run in local or high in the clouds simultaneously Realize playback.Local playback is debugged successfully, can directly be uploaded to platform, is run in platform.
Figure 11 show in above-described embodiment involved game automatic test device 1100 (being applied to server) or A kind of possible structural representation of server, including game automatic test module 1, wherein:
Automatic test module 1 may include:
First determining unit 1101, for determining overlay area and current vertex of the target UI controls on terminal display screen Position;
Action Events determining unit 1102, for according to the current vertex position and overlay area, it is determined that for described The Action Events of target UI controls;The Action Events comprise at least mode of operation and the operative position on the terminal display screen Put;
Communication unit 1103, for notifying the terminal to perform the Action Events, with realization pair and the operating position Corresponding target UI controls, operated using the mode of operation.
Searching unit 1104, for determining target UI controls in the terminal display screen in first determining unit 1101 On overlay area and current vertex position before, search the target UI controls.
More specifically, searching unit 1104 can search target UI controls it is described game face to face picture user interface UI control Node corresponding to part tree is upper, obtains the first lookup result.
First lookup result includes unique mark corresponding with the target UI controls;Wherein, the UI control trees Comprising multiple nodes, every UI controls correspond to a node in UI control trees, the corresponding unique mark of the node.It is related Details refers to record described previously herein, and therefore not to repeat here.
In other embodiments of the present invention, Figure 12 a are referred to, above-mentioned game automatic test device 1100 may also include UI Control checks module 2 and editor module 3.
When developing automatic test module 1, UI controls check that module 2 can be used for:
The current interface of the game and the UI control trees of the game current interface are obtained, and is shown in the server Display screen on;Obtain the positional information of the input equipment input of the server;Searched according to the positional information corresponding UI controls, obtain the second lookup result, second lookup result includes the title of the UI controls found, path, current Vertex position and the overlay area on the terminal display screen;According to second lookup result, in the aobvious of the server The UI controls found are highlighted in current interface shown by display screen, meanwhile, highlight the UI found Control corresponding node in the UI control trees;
Editor module 3 can be used for:Obtain the edit instruction of the input equipment input of the server;The edit instruction is Based on second lookup result generation;According to automatic test module 1 described in the edit instruction editor.
Wherein, the first determining unit 1101 can be used for performing 601 parts shown in Fig. 6, the 700-703 parts shown in Fig. 7.
Action Events determining unit 1102 can be used for performing 602 parts shown in Fig. 6,704 parts shown in Fig. 7, Fig. 8 institutes 806 parts shown.
Communication unit 1103 can be used for performing 603 parts shown in Fig. 6,705 parts shown in Fig. 7,801 shown in Fig. 8 Part.
Searching unit 1104 can be used for performing 600 parts shown in Fig. 6,701 parts shown in Fig. 7.
From whole automatic test die angle, automatic test module 1 can be used for performing the 600-603 portions shown in Fig. 6 Divide, the 801-807 parts of the 700-705 shown in Fig. 7 partly, shown in Fig. 8.
UI controls check module 2 available for the 401-404 parts performed shown in Fig. 4, the 501-505 shown in Fig. 5,508 Point.
Editor module 3 can be used for the 405-406 parts shown in execution Fig. 4 a, 509-510 parts shown in Fig. 5.
In other embodiments of the present invention, Figure 12 b are referred to, above-mentioned game automatic test device 1100 may also include just Beginningization module 4, for being initialized.
Initialization module 4 can be used for the 901-903 parts shown in execution Fig. 9,1000-1024 parts shown in Figure 10.
Figure 13 shows terminal (or game automatic test device in terminal) 1300 involved in above-described embodiment A kind of possible structural representation.It may include:
Communication unit 1301, for receiving from server or game automatic test device, instruction execution operation thing The notice of part;The Action Events comprise at least mode of operation and the operating position on the terminal display screen;Wherein, it is described Mode of operation and operating position are by the server or current vertex of the automatic test device according to the UI controls of playing What position and overlay area determined;
Execution unit 1302, for according to the notice, the Action Events being performed, with realization pair and the operating position Corresponding UI controls, operated using the mode of operation determined.
Wherein, communication unit 1301 can be used for supporting terminal (or game automatic test device in terminal) and other dresses Put and communicated.For example, for supporting what is shown in terminal (or game automatic test device in terminal) and Fig. 4 b, 5-7 Other devices are communicated.
Execution unit 1302 can be used for performing 706 parts shown in Fig. 7, in addition, execution unit 1302 can also carry out Fig. 7 institutes 506-507 parts shown in 702,703 parts that show, Fig. 5, and the operation of the WeTest SDK shown in Fig. 4 b.
The alternatively possible structural representation of server/terminal involved by above-mentioned all embodiments is stupefied referring to Fig. 1, bag Include:
Bus, processor 101, memory 102, communication interface 103, input equipment 104 and output equipment 105.Processor 101st, memory 102, communication interface 103, input equipment 104 and output equipment 105 are connected with each other by bus.Wherein:
Bus may include a path, and information is transmitted between computer system all parts.
Processor 101 can be general processor, such as general central processor (CPU), network processing unit (Network Processor, abbreviation NP), microprocessor etc. or ASIC (application-specific Integrated circuit, ASIC), or one or more integrated circuits for being used to control the present invention program program to perform.Also Can be digital signal processor (DSP), application specific integrated circuit (ASIC), ready-made programmable gate array (FPGA) or other can Programmed logic device, discrete gate or transistor logic, discrete hardware components.
Processor 101 may include primary processor, and the processor of terminal may also include baseband chip, modem etc..
The program or script for performing technical solution of the present invention are preserved in memory 102, operating system can also be preserved With other key businesses.Specifically, program can include program code, and program code includes computer-managed instruction.Script is then Generally preserved with text (such as ASCII), only explain or compile when called.
More specifically, memory 102 can include read-only storage (read-only memory, ROM), can store static state Information and instruction other kinds of static storage device, random access memory (random access memory, RAM), Can storage information and instruction other kinds of dynamic memory, magnetic disk storage, flash etc..
Input equipment 104 may include receive user input data and information device, such as keyboard, mouse, camera, Scanner, light pen, speech input device, touch-screen, pedometer or gravity sensor etc..
Output equipment 105 may include the device for allowing output information to user, such as display screen, printer, loudspeaker etc..
Communication interface 103 may include using a kind of device of any transceiver, to lead to other equipment or communication network Letter, such as Ethernet, wireless access network (RAN), WLAN (WLAN) etc..
Controller/processor of server can be used for performing Fig. 4 a, the processing procedure for being related to server in 4b, 5-8 and/or Other processes for technology described herein.Controller/processor can also be used for realizing foregoing automatic test module 1st, UI controls check the function of module 2, editor module 3 and initialization module 4.
The communication interface of server is then used to support server to be communicated with other devices.Such as supporting to service Device and Fig. 4 a, 4b, other devices shown in 5-8 are communicated.
Controller/processor of terminal can be used for performing and be related to the processing procedure of terminal in Fig. 4 a, 4b, 5-8 and/or be used for Other processes of technology described herein.Controller/processor can also be used for realizing the function of foregoing execution unit 1302.
The communication interface of server is then used to support terminal to be communicated with other devices.Such as supporting server With Fig. 4 a, 4b, other devices shown in 5-8 are communicated.
Designed it is understood that Fig. 1 illustrate only simplifying for server/terminal.In actual applications, server/ Terminal can include any number of transmitter, receiver, processor, controller, memory, communication interface etc., and it is all can To realize the server/terminal of the present invention all within protection scope of the present invention.
Game automatization test system is also claimed in the embodiment of the present invention, and it may include the end in above-mentioned all embodiments End and above-mentioned server, or including the terminal in above-mentioned all embodiments and game automatic test device.
The step of method or algorithm with reference to described by the disclosure of invention, can be realized in a manner of hardware, also may be used By be by computing device software instruction in a manner of realize.Software instruction can be made up of corresponding software module, software mould Block can be stored on RAM memory, flash memory, ROM memory, eprom memory, eeprom memory, register, hard disk, In the storage medium of mobile hard disk, CD-ROM or any other form well known in the art.A kind of exemplary storage medium Coupled to processor, so as to enable a processor to from the read information, and information can be write to the storage medium.When So, storage medium can also be the part of processor.Processor and storage medium can be located in ASIC.In addition, should ASIC can be located in user equipment.Certainly, processor and storage medium can also be present in user equipment as discrete assembly In.
Those skilled in the art are it will be appreciated that in said one or multiple examples, work(described in the invention It is able to can be realized with hardware, software, firmware or their any combination.When implemented in software, can be by these functions It is stored in computer-readable medium or is transmitted as one or more instructions on computer-readable medium or code. Computer-readable medium includes computer-readable storage medium and communication media, and wherein communication media includes being easy to from a place to another Any medium of one place transmission computer program.It is any that storage medium can be that universal or special computer can access Usable medium.
Above-described embodiment, the purpose of the present invention, technical scheme and beneficial effect are carried out further Describe in detail, should be understood that the embodiment that the foregoing is only the present invention, be not intended to limit the present invention Protection domain, all any modification, equivalent substitution and improvements on the basis of technical scheme, done etc., all should It is included within protection scope of the present invention.

Claims (25)

1. one kind game automated testing method, it is characterised in that the game automated testing method includes:
Search target UI controls;
Determine overlay area and real-time vertex position of the target UI controls on terminal display screen;
According to vertex position and the overlay area in real time, it is determined that the Action Events for the target UI controls;The operation Event comprises at least mode of operation and the operating position on the terminal display screen;
The terminal is notified to perform the Action Events, to realize pair target UI controls corresponding with the operating position, use The mode of operation is operated, so as to simulate operation of the people to the target UI controls.
2. the method as described in claim 1, it is characterised in that the lookup target UI controls include:
The target UI controls are searched in the game corresponding node in the user interface UI control trees of picture face to face, obtain the One lookup result;First lookup result includes unique mark corresponding with the target UI controls;
Wherein, the UI control trees include multiple nodes, and every UI controls during the game is drawn a picture face to face correspond to the UI controls A node on part tree, the corresponding unique mark of the node.
3. method as claimed in claim 2, it is characterised in that described to search the target UI controls in the picture face to face of playing UI control trees on corresponding node include:
According to the relevant information of the target UI controls, the target UI controls corresponding section in the UI control trees is searched for Point;
Wherein, the relevant information includes title, the word in the target UI controls, the target of the target UI controls Picture name in UI controls, and node corresponding to the target UI controls is relative to any one in the position of father node Or any combination.
4. method as claimed in claim 2, it is characterised in that the determination target UI controls are on the terminal display screen Overlay area and real-time vertex position include:
According to unique mark corresponding to the target UI controls, target UI controls the covering on the terminal display screen is obtained Cover area and real-time vertex position.
5. the method as described in claim any one of 1-4, it is characterised in that automatic test pin is stored with the server This, each step in the game automated testing method, is described automatic by running by the processor of the server Change what test script performed.
6. method as claimed in claim 5, it is characterised in that also include:Develop the automatic test script.
7. method as claimed in claim 6, it is characterised in that
The automatic test script realizes object and the automatic test logic for the game including multiple classes;
Any class realizes a kind of basic test operation of object definition;
The execution sequence of the automatic test logical definition basic test operation, operation object and perform condition;
The operation automatic test script is according to the execution sequence, operation pair by the automatic test logic As and perform condition and call corresponding class to realize object implementatio8.
8. method as claimed in claim 7, it is characterised in that basic test operation is click, long-press, slip, sectional drawing, Click location, performance data collection, terminal log collection or crash detections are marked on sectional drawing.
9. method as claimed in claim 7 or 8, it is characterised in that the exploitation automatic test script includes:
Obtain the game current interface and the current interface corresponding to UI control trees, and be shown in the aobvious of the server In display screen;
Obtain the positional information of the input equipment input of the server;
Corresponding UI controls are searched according to the positional information, obtain the second lookup result, second lookup result includes Title, path, real-time vertex position and the UI controls found of the UI controls found are on the terminal display screen Overlay area;
According to second lookup result, described look into is highlighted in the current interface shown by display screen in the server The UI controls found, meanwhile, highlight the UI controls found corresponding node in the UI control trees.
10. method as claimed in claim 9, it is characterised in that the exploitation automatic test script also includes:
Obtain the edit instruction of the input equipment input of the server;The edit instruction is used to edit automatic test logic The execution sequence of middle basic test operation, operation object and any one or any combination that perform condition, the edit instruction It is to be generated based on second lookup result;
According to automatic test logic described in the edit instruction editor.
11. method as claimed in claim 9, it is characterised in that described that corresponding UI controls are searched according to the positional information Part, obtaining the second lookup result includes:
The positional information that the input equipment inputs is converted to the positional information of the terminal display screen;
The positional information of the display screen is sent to the terminal, so that the terminal is according to the positional information of the display screen Search corresponding UI controls and return to second lookup result;
Receive second lookup result.
12. method as claimed in claim 8, it is characterised in that the game automated testing method also includes:Carry out initial Change.
13. method as claimed in claim 12, it is characterised in that the server is cloud server or home server, The initialization includes:
Current running environment is determined by the presence or absence of environmental variance;Wherein, cloud server is stored with environmental variance, and local Server is not stored with environmental variance;Running environment corresponding to home server is home environment;It is corresponding that server is surveyed in high in the clouds Running environment be high in the clouds environment;The automatic test script includes realizing class for different running environment;
Establish the mapping relations of the network port of local or cloud server and the network monitoring port of terminal;The local or cloud End computer games check server is communicated by the network monitoring port of the network port and terminal;
Class is realized accordingly according to current running environment selection, corresponding class is created and realizes object.
14. one kind game automatic test device, it is characterised in that the game automatic test device includes automatic test Module, the automatic test module include:
Searching unit, for searching target user interface UI controls;
First determining unit, for determining overlay area and real-time summit position of the target UI controls on terminal display screen Put;
Action Events determining unit, for according to vertex position and the overlay area in real time, being controlled it is determined that being directed to the target UI The Action Events of part;The Action Events comprise at least mode of operation and the operating position on the terminal display screen;
Communication unit, for notifying the terminal to perform the Action Events, to realize pair mesh corresponding with the operating position Mark UI controls, operated using the mode of operation, so as to simulate operation of the people to the target UI controls.
15. device as claimed in claim 14, it is characterised in that in terms of target UI controls are searched, the searching unit is used In:
The target UI controls are searched in the game corresponding node in the user interface UI control trees of picture face to face, obtain the One lookup result;First lookup result includes unique mark corresponding with the target UI controls;Wherein, the UI controls Tree includes multiple nodes, and every UI controls correspond to a node in UI control trees, the corresponding unique mark of the node.
16. device as claimed in claim 14, it is characterised in that controlled searching UI of the target UI controls in the game The aspect of node, the searching unit are used for corresponding to part tree is upper:
According to the relevant information of the target UI controls, the target UI controls corresponding section in the UI control trees is searched for Point;
Title of the relevant information including the target UI controls, the word in the target UI controls, target UI controls Picture name in part, and node corresponding to the target UI controls relative to any one in the position of father node or are appointed Meaning combination.
17. the device as described in claim any one of 14-16, it is characterised in that also check module and editor including UI controls Module, when developing the automatic test module, the UI controls check that module is used for:
The current interface of the game and the UI control trees of the game current interface are obtained, and is shown in the aobvious of the server In display screen;
Obtain the positional information of the input equipment input of the server;
Corresponding UI controls are searched according to the positional information, obtain the second lookup result, second lookup result includes Title, path, real-time vertex position and the overlay area on the terminal display screen of the UI controls found;
According to second lookup result, described look into is highlighted in the current interface shown by display screen in the server The UI controls found, meanwhile, highlight the UI controls found corresponding node in the UI control trees;
The editor module is used for:
Obtain the edit instruction of the input equipment input of the server;The edit instruction is to be based on second lookup result Generation;
According to automatic test module described in the edit instruction editor.
18. device as claimed in claim 17, it is characterised in that corresponding UI is searched according to the positional information described Control, obtains the aspect of the second lookup result, and the UI controls check that module is used for:
The positional information that the input equipment inputs is converted to the positional information of the terminal display screen;
The positional information of the display screen is sent to the terminal, so that the terminal is according to the positional information of the display screen Search corresponding UI controls and return to second lookup result;
Receive second lookup result.
19. one kind game automated testing method, it is characterised in that applied to terminal, the game automated testing method bag Include:
Receive from server or game automatic test device, instruction execution Action Events notice;The Action Events Operating position including at least mode of operation and on the terminal display screen;The mode of operation and operating position are by described What server or game automatic test device determined according to the real-time vertex position of the UI controls and overlay area;
According to the notice, the Action Events are performed, to realize pair UI controls corresponding with the operating position, using determination The mode of operation gone out is operated, so as to simulate operation of the people to the target UI controls.
20. method as claimed in claim 19, it is characterised in that receiving from server or game automatic test device , instruction perform Action Events notice before, in addition to:
Receive the search request for the target UI controls from server or hand trip automatic test device;
The target UI controls are searched in the game corresponding node in the UI control trees of picture face to face, obtain the first lookup knot Fruit;First lookup result includes unique mark corresponding with the target UI controls;Wherein, the UI control trees include more Individual node, every UI controls in game drawing face to face correspond to a node in the UI control trees, the node pair Answer a unique mark;
First lookup result is returned to the server or game automatic test device.
21. method as claimed in claim 20, it is characterised in that
The search request of the target UI controls includes the relevant information of the target UI controls, wherein, the relevant information bag Title corresponding to the target UI controls, the word in the target UI controls, the picture name in the target UI controls are included, And node corresponding to the target UI controls is relative to any one in the position of father node or any combination;
In the game, corresponding node includes the lookup target UI controls in the UI control trees of picture face to face:
According to the relevant information of the target UI controls, the target UI controls corresponding section in the UI control trees is searched for Point.
22. method as claimed in claim 21, it is characterised in that also include:
Inquiry request is received, the inquiry request includes the positional information of terminal display screen;
Corresponding UI controls are searched according to the positional information of the terminal display screen and return to the second lookup result;Described second Title, path, real-time vertex position and the UI controls found for the UI controls that lookup result includes finding are described Overlay area on terminal display screen.
23. method as claimed in claim 22, it is characterised in that described to be searched according to the positional information of the terminal display screen Corresponding UI controls include:
The positional information of the display screen is converted into the positional information under unity coordinate systems;
Corresponding UI controls are searched according to the positional information under the unity coordinate systems being converted to.
A kind of 24. terminal, it is characterised in that including:
Communication unit, for receiving from server or game automatic test device, instruction execution Action Events notice; The Action Events comprise at least mode of operation and the operating position on the terminal display screen;Wherein, the mode of operation With operating position according to the real-time vertex positions of the UI controls and covered by the server or game automatic test device What cover area determined;
Execution unit, for according to the notice, the Action Events being performed, to realize couple UI corresponding with the operating position Control, operated using the mode of operation determined.
25. one kind game automatization test system, it is characterised in that including terminal as claimed in claim 23, and, such as weigh Profit requires the server described in 14-18.
CN201610388475.1A 2016-06-02 2016-06-02 Game automated testing method and relevant apparatus Active CN106095666B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610388475.1A CN106095666B (en) 2016-06-02 2016-06-02 Game automated testing method and relevant apparatus

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610388475.1A CN106095666B (en) 2016-06-02 2016-06-02 Game automated testing method and relevant apparatus

Publications (2)

Publication Number Publication Date
CN106095666A CN106095666A (en) 2016-11-09
CN106095666B true CN106095666B (en) 2018-01-09

Family

ID=57446907

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610388475.1A Active CN106095666B (en) 2016-06-02 2016-06-02 Game automated testing method and relevant apparatus

Country Status (1)

Country Link
CN (1) CN106095666B (en)

Families Citing this family (36)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106909397A (en) * 2017-03-06 2017-06-30 北京潘达互娱科技有限公司 The method and device of input frame is generated in Unity interfaces
CN107340944B (en) * 2017-05-19 2019-03-26 腾讯科技(深圳)有限公司 The display methods and device of interface
CN107315473A (en) * 2017-06-19 2017-11-03 南京华捷艾米软件科技有限公司 A kind of method that body-sensing gesture selects Android Mission Objective UI controls
CN109101412B (en) * 2017-06-21 2021-05-11 腾讯科技(深圳)有限公司 Test file generation method, test file generation device, test file testing method, test file testing device, storage medium and computer equipment
CN107357586B (en) * 2017-07-14 2018-06-05 腾讯科技(深圳)有限公司 Control method, device and the equipment of application program
CN109284102B (en) * 2017-07-21 2022-05-27 阿里巴巴集团控股有限公司 Information acquisition method and device
CN109783343A (en) * 2017-11-13 2019-05-21 北京嘀嘀无限科技发展有限公司 Components testing method, apparatus, client device and computer readable storage medium
CN108280026B (en) 2018-01-23 2019-03-22 网易(杭州)网络有限公司 Game automated testing method and device, storage medium, electronic equipment
CN108170611B (en) 2018-01-23 2019-07-16 网易(杭州)网络有限公司 Automated testing method and device, storage medium, electronic equipment
CN108255729B (en) * 2018-01-24 2021-12-31 珠海金山网络游戏科技有限公司 Mobile phone game automatic testing method and system based on Unity platform
CN110231959A (en) * 2018-03-06 2019-09-13 优酷网络技术(北京)有限公司 A kind of synchronous method of manipulation instruction, system and control centre
CN108647198B (en) * 2018-05-17 2021-12-28 福建天晴数码有限公司 Unity-based character editing method and terminal
CN108874569B (en) * 2018-05-31 2021-07-30 北京三快在线科技有限公司 Event response and file generation method and device and electronic equipment
CN109117373A (en) * 2018-08-16 2019-01-01 杭州友声科技股份有限公司 A kind of method that rule-based guidance carries out UI traversal
CN109254923A (en) * 2018-09-19 2019-01-22 北京酷我科技有限公司 A method of it is debugged using interior UI
CN109324967A (en) * 2018-09-26 2019-02-12 深圳壹账通智能科技有限公司 The method, apparatus and terminal device of application program pop-up components testing
CN109359043B (en) * 2018-10-08 2022-03-29 北京云测信息技术有限公司 Mobile game automatic testing method based on machine learning
CN109359003B (en) * 2018-10-29 2022-05-20 网易(杭州)网络有限公司 Game server pressure testing method, device and equipment
CN109697168A (en) * 2019-01-11 2019-04-30 网易(杭州)网络有限公司 Power consumption weight testing method and device, electronic equipment, storage medium
CN109885481A (en) * 2019-01-14 2019-06-14 珠海金山网络游戏科技有限公司 A kind of the recording and playback test method and device of the game NGUI based on Unity technology
CN109783388B (en) * 2019-01-16 2022-03-01 北京金山云网络技术有限公司 UI (user interface) automatic testing method and device and electronic equipment
CN109871172B (en) * 2019-01-23 2020-09-15 广州杰赛科技股份有限公司 Mouse clicking method and device in automatic test and readable storage medium
CN109857659B (en) * 2019-01-23 2022-03-15 北京云测信息技术有限公司 Control operation method and device
CN110266748B (en) * 2019-04-24 2022-09-27 上海连尚网络科技有限公司 Game publishing method and device
CN110404256A (en) * 2019-07-26 2019-11-05 上海商汤智能科技有限公司 Data processing method and device, equipment, server, system and storage medium
CN110543416A (en) * 2019-08-02 2019-12-06 广州探迹科技有限公司 Method, device, equipment and storage medium for automatically testing terminal program
CN110794999B (en) * 2019-10-28 2021-01-15 珠海格力电器股份有限公司 Automatic control method and device based on interface segmentation and terminal
CN111127602B (en) * 2019-12-27 2023-07-04 珠海金山数字网络科技有限公司 Animation production method and device based on NGUI
CN111481937B (en) * 2020-04-09 2023-04-07 网易(杭州)网络有限公司 Game task testing method and device, testing terminal and server
CN112269746A (en) * 2020-11-10 2021-01-26 京东数科海益信息科技有限公司 Automatic testing method and related equipment
CN112732580A (en) * 2021-01-11 2021-04-30 珠海金山网络游戏科技有限公司 Automatic testing method, device and medium for hierarchy lookup based on Unity
CN112954020B (en) * 2021-01-28 2022-09-06 广州虎牙科技有限公司 Game control method, device, electronic equipment and computer-readable storage medium
CN113094257B (en) * 2021-03-08 2024-04-05 上海硬通网络科技有限公司 Application testing method and device and electronic equipment
CN112988304B (en) * 2021-03-25 2022-04-29 腾讯科技(深圳)有限公司 Recording method and device of operation mode, electronic equipment and storage medium
CN113076257A (en) * 2021-04-19 2021-07-06 西安闻泰信息技术有限公司 Test script recording method, device, medium and computer equipment
CN113630652B (en) * 2021-08-11 2024-01-30 杭州凯米科技有限公司 Game quick adaptation method based on Android set top box

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309802A (en) * 2012-03-16 2013-09-18 百度在线网络技术(北京)有限公司 Method and device for testing system stability in mobile terminal
CN104699617A (en) * 2015-03-31 2015-06-10 成都优聚软件有限责任公司 Automated testing method for games

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103309802A (en) * 2012-03-16 2013-09-18 百度在线网络技术(北京)有限公司 Method and device for testing system stability in mobile terminal
CN104699617A (en) * 2015-03-31 2015-06-10 成都优聚软件有限责任公司 Automated testing method for games

Also Published As

Publication number Publication date
CN106095666A (en) 2016-11-09

Similar Documents

Publication Publication Date Title
CN106095666B (en) Game automated testing method and relevant apparatus
CN104484273B (en) The method of testing of application program, equipment and system
CN107025165A (en) Game automated testing method and relevant apparatus
WO2020155778A1 (en) Interface automation test method, test apparatus, test device and storage medium
CN108170611A (en) Automated testing method and device, storage medium, electronic equipment
CN108280026A (en) Automated testing method and device, storage medium, electronic equipment
US8855971B2 (en) Tools for system-level design environments
CN107818162A (en) Bury a processing method, device, computer equipment and storage medium
US7881440B2 (en) Method for automatic graphical profiling of a system
CN109302522A (en) Test method, device and computer system and medium
CN110413529A (en) Applied to the test method of electronic equipment, device, calculate equipment and medium
CN103927253A (en) Multiple browser compatibility testing method and system
CN110716853A (en) Test script recording method, application program testing method and related device
CN104778121A (en) Game program test method, device and system
US10592397B2 (en) Representing a test execution of a software application using extended reality
CN104268083B (en) Automatic software test method and device
CN105955888A (en) Page debugging and previewing method and system
CN103901307A (en) Testing system and method applied to vehicle-mounted multimedia device
CN104915297B (en) A kind of automated testing method of the APP power consumption of android equipment
CN105988931B (en) Test method and device
CN111488109A (en) Method, device, terminal and storage medium for acquiring control information of user interface
CN109324857A (en) A kind of user guides implementation method, device and storage medium
CN108604256A (en) Parts information retrieves device, parts information search method and program
CN113722020A (en) Interface calling method, device and computer readable storage medium
CN112286501A (en) Method and device for embedding point in page of terminal equipment and storage medium

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant