CN109753425A - Pop-up processing method and processing device - Google Patents

Pop-up processing method and processing device Download PDF

Info

Publication number
CN109753425A
CN109753425A CN201711077207.9A CN201711077207A CN109753425A CN 109753425 A CN109753425 A CN 109753425A CN 201711077207 A CN201711077207 A CN 201711077207A CN 109753425 A CN109753425 A CN 109753425A
Authority
CN
China
Prior art keywords
window
address
destination application
pop
subprocess
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.)
Granted
Application number
CN201711077207.9A
Other languages
Chinese (zh)
Other versions
CN109753425B (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 CN201711077207.9A priority Critical patent/CN109753425B/en
Publication of CN109753425A publication Critical patent/CN109753425A/en
Application granted granted Critical
Publication of CN109753425B publication Critical patent/CN109753425B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The present invention relates to a kind of pop-up processing method and processing devices.This method comprises: when testing destination application, the host process address and subprocess address of the available destination application, the window events in the destination application are monitored by host process address, when first attribute information indication window of the window corresponding to the window events listened to is pop-up, predetermined process is executed to the window.I.e. when testing a destination application, currently whether window can be being handled according to the automatic monitoring objective application program of process address of destination application, further obtain the attribute for the window that destination application is presently processing, and whether the window being presently processing according to the determined property of window is pop-up, the attribute templates that tester adds pop-up in test script in advance are not needed, to improve the development efficiency of test script and the testing efficiency to application program.

Description

Pop-up processing method and processing device
Technical field
The present invention relates to software testing technology field, in particular to a kind of pop-up processing method and processing device.
Background technique
The window of automatic spring when pop-up refers to opening operation system interface or application interface.In software automated testing In the process, in order to enable automatic test course can be gone on smoothly, test script usually requires to identify bullet during the test Window event is simultaneously correspondingly processed.
In the related art, tester can manually determine the pop-up being likely to occur in application program to be tested, and Addition is to the identification of these pop-ups and the code of processing in test script, so that test script in the process of running can be in bullet It is identified in time when window pops up and it is handled.Specifically, tester manually presets to go out in test script The attribute templates of existing pop-up, during the test, the attribute information for the object that detection is currently shown and pre-set pop-up Attribute templates whether match, if the attribute templates of the attribute information of the object currently shown and pre-set pop-up Match, it is determined that the object currently shown is pop-up, and carries out predetermined process to pop-up.
In the related art, tester is needed manually to determine the pop-up being likely to occur in application program, and in test foot The attribute templates that pop-up is added in this, influence the development efficiency of test script and the testing efficiency to application program.
Summary of the invention
The embodiment of the invention provides a kind of pop-up processing method and processing devices, can solve and need tester in the related technology Member is artificial to determine the pop-up being likely to occur in application program, and the template of pop-up is added in test script, influences test script Development efficiency and the problem of to the testing efficiency of application program, technical solution is as follows:
On the one hand, a kind of pop-up processing method is provided, which comprises
When testing destination application, with obtaining host process address and the subprocess of the destination application Location, the host process address are the code block address for realizing the host process of the destination application, the subprocess Location is the code block address for realizing the subprocess of the destination application;
The window events in the destination application are monitored by the host process address, the window events indicate institute It states destination application and is handling window object;
Obtain the first attribute information of window corresponding to the window object by the subprocess address, described first Attribute information indicates whether the window is pop-up;
When first attribute information indicates that the window is pop-up, predetermined process is executed to the window.
On the other hand, a kind of pop-up processing unit is provided, described device includes:
Address acquisition module, for when testing destination application, obtaining the master of the destination application Process address and subprocess address, the host process address are for realizing the code block of the host process of the destination application Address, the subprocess address are the code block address for realizing the subprocess of the destination application;
Event monitoring module, for monitoring the window events in the destination application by the host process address, The window events indicate that the destination application is handling window object;
First attribute obtains module, for obtaining window corresponding to the window object by the subprocess address First attribute information, first attribute information indicate whether the window is pop-up;
Processing module, for being executed to the window pre- when first attribute information indicates that the window is pop-up Fixed processing.
Optionally, the address acquisition module, comprising:
First address acquisition unit, for obtaining the program example object of the destination application, and it is pre- by calling If interface obtains the corresponding host process address of described program instance objects;
Second address acquisition unit, for obtaining the element instance object of the destination application, and by calling institute It states preset interface and obtains the corresponding subprocess address of the element instance object.
Optionally, the event monitoring module, comprising:
Attribute acquiring unit, for obtaining the object that the destination application is being handled according to the host process address The second attribute information, second attribute information indicates whether the object that the destination application is being handled is window pair As;
Event determination unit, for indicating the object that the destination application is being handled when second attribute information When for window object, determination listens to the window events.
Optionally, described device further include:
Second attribute obtains module, for obtaining institute before the processing module executes predetermined process to the window The visual attribute of window is stated, the visual attribute indicates whether corresponding window is visible;
The processing module, for when the visual attribute of the window indicates that the window is visible, it to be described right to execute The window executes the step of predetermined process.
Optionally, the processing module, comprising:
Button determination unit determines the pass in each button for traversing each button for including in the window Close window button;
Unit is clicked in simulation, clicks the close window button for simulating.
Optionally, described device further include:
Data obtaining module, for obtained in the address acquisition module destination application host process address and Before subprocess address, the host process information of the destination application is obtained, includes operating system in the host process information Version information;
The address acquisition module indicates the version of the operating system not for the version information when the operating system When lower than default version, the step of executing the host process address and subprocess address for obtaining the destination application.
Another aspect provides a kind of computer equipment, and the computer equipment includes processor and memory, described to deposit Be stored at least one instruction, at least a Duan Chengxu, code set or instruction set in reservoir, at least one instruction, it is described extremely A few Duan Chengxu, the code set or instruction set are loaded as the processor and are executed to realize as described in above-mentioned first aspect Pop-up processing method.
In another aspect, providing a kind of computer readable storage medium, at least one finger is stored in the storage medium Enable, at least a Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the code set or Instruction set is as processor loads and executes to realize the pop-up processing method as described in above-mentioned first aspect.
Technical solution provided by the invention can include the following benefits:
When testing a destination application, can be monitored automatically according to the process address of destination application Whether destination application is currently handling window, further obtains the category for the window that destination application is presently processing Property, and whether the window being presently processing according to the determined property of window is pop-up, does not need tester and is testing in advance The attribute templates of pop-up are added in script, to improve the development efficiency of test script and imitate to the test of application program Rate.
Detailed description of the invention
The drawings herein are incorporated into the specification and forms part of this specification, and shows and meets implementation of the invention Example, and be used to explain the principle of the present invention together with specification.
Fig. 1 is a kind of basic flow chart of pop-up processing shown in an exemplary embodiment of the invention;
Fig. 2 is the pop-up process flow diagram in the iOS system that embodiment illustrated in fig. 1 is related to;
Fig. 3 is a kind of flow chart of pop-up processing method shown in an exemplary embodiment of the invention;
Fig. 4 is the flow chart of the pop-up processing method in the iOS system shown in an exemplary embodiment of the invention;
Fig. 5 is a kind of structural block diagram of pop-up processing unit shown according to an exemplary embodiment;
Fig. 6 is a kind of structural schematic diagram of computer equipment shown according to an exemplary embodiment;
Fig. 7 is a kind of structural schematic diagram of computer equipment shown according to an exemplary embodiment.
Specific embodiment
Example embodiments are described in detail here, and the example is illustrated in the accompanying drawings.
Method shown in the embodiment of the present invention can be applied in various test terminals, wherein the test terminal can be Operation has the terminal of test script, which is used for the operating system in test terminal or is based on operating system Application program carry out automatic test.Wherein, which can be smart phone, tablet computer or e-book reading The mobile terminals such as device, alternatively, the test terminal is also possible to the intelligent wearable device such as smartwatch or intelligent glasses, or Person, the test terminal are also possible to the computer equipments such as laptop, desktop computer or personal workstation.
Method shown in the embodiment of the present invention, can be used in test terminal operating test script when, be to what is currently tested The pop-up popped up in system or application is identified and is handled.Specifically, method shown in the embodiment of the present invention can be by test eventually End runs test script to realize, alternatively, method shown in the embodiment of the present invention can also be by test terminal operating test script Except other application, plug-in unit or system component realize.
Fig. 1 is a kind of basic flow chart of pop-up processing shown according to an exemplary embodiment.As shown in Figure 1, at this In inventive embodiments, test terminal when operation test script tests destination application, answer by the available target With the host process address and subprocess address of program, the window events in the destination application are monitored by host process address, When the window events listened to, the first attribute information of window corresponding to window events is obtained by subprocess address, when When first attribute information indicates that the window is pop-up, predetermined process is executed to the window.I.e. in embodiments of the present invention, right It, can be according to the automatic monitoring objective application program of process address of destination application when one destination application is tested Currently whether window is being handled, is further obtaining the attribute for the window that destination application is presently processing, and according to window Whether the window that the determined property of mouth is presently processing is pop-up, does not need tester and adds bullet in test script in advance The attribute templates of window, to improve the development efficiency of test script and the testing efficiency to application program.
In one possible implementation, the embodiment of the present invention can based in iOS system automatic test course, Fast automatic identifies pop-up event, then accurately handles the pop-up, to will not influence the execution etc. of automated procedures Work.
Specifically for example, to be applied in iOS system, for carrying out automatic test to certain app, referring to FIG. 2, it shows The present embodiments relate to iOS system in pop-up process flow diagram, as shown in Fig. 2, the pop-up processing stream in iOS system Journey is as follows:
1) test terminal obtains the UIATarget and UIElement of the app currently tested.Wherein, UIATarget is fixed Application Instance object in justice iOS system, UIElement define the element instance of the application program in iOS system Object, for example, UIATarget is integrally carried out to the browser application so that app is some browser application as an example The instance objects of definition, and UIElement is to the specific element in browser application (for example, the specific element can be with It is the button etc. in a page or the page) instance objects that are defined, corresponding is the UI (User in app Interface, user interface) element carrier.Wherein, the corresponding UIElement of an app, the i.e. UIElement processing UI element be it is variable, the UI element of different moments processing can be different.
2) test terminal obtains the address IMP (being denoted as IMP_A, corresponding above-mentioned host process address) of UIATarget, and obtains The address IMP (being denoted as IMP_U, corresponding above-mentioned subprocess address) of UIElement.Wherein, IMP is the application journey in iOS system The method of the programming language Object-C of sequence realizes the address of code block, and IMP can be called directly as C language function, leads to It can be disappeared by way of [object method:parameter] or objc_msgSend () to object transmission in normal situation Breath finds the IMP for matching this message and calls the IMP, alternatively, Objective-C can also be with when then Objective-C is run It directly acquires IMP and is called.
3) when test terminal listens to app currently processed window events by IMP_A, current place is obtained by IMP_U The window events of reason correspond to the first attribute information of window, and judge whether it is pop-up according to the first attribute information of window.
4) when test terminal determines that the window is pop-up according to the first attribute information of window, book office is executed to the pop-up Reason.
Subsequent embodiment of the present invention will be introduced scheme shown in FIG. 1 so that operating system is iOS system as an example.
Fig. 3 is a kind of flow chart of pop-up processing method shown according to an exemplary embodiment, and this method can be used for It tests in terminal.The pop-up processing method may include the following steps:
Step 301, terminal operating test script is tested, to carry out automatic test to destination application.
When testing the app in iOS system, test terminal can run the automatic test foot for the app This, which is destination application.
Step 302, test terminal obtain destination application host process information, and according to host process acquisition of information arrive this The subprocess information of destination application.
Test the progress information of terminal host process of the available app currently tested when running automatic test script M, and obtain according to progress information M the subprocess information U of the app.
Wherein, may include in progress information M the ID (identity, identity recognition number) of host process, subprocess ID, it is main into Journey memory address and the entrance function of host process etc..It may include the ID of subprocess, the memory of subprocess in subprocess information U Address and the entrance function of subprocess etc..
When obtaining the host process information and subprocess information of destination application, test terminal can be according to current test The program name of app obtain progress information M, and according to progress information M (specifically can be according to the subprocess ID in progress information M) Obtain above-mentioned subprocess information U.
Step 303, terminal is tested according to the version information of host process information acquiring operation system.
It, can also be directly comprising the current version information of iOS system, i.e. test terminal in progress information M in iOS system The version information of iOS can be directly extracted from progress information M.
Step 304, when the version of the version information of operating system instruction operating system is not less than default version, test is eventually End obtains the host process address and subprocess address of destination application.
Wherein, host process address is the code block address of the host process for realizing destination application, subprocess address It is the code block address of the subprocess for realizing destination application.
In practical applications, for the same operating system, possible not all operating system version can be propped up Above-mentioned method shown in FIG. 1 is held, it therefore, in embodiments of the present invention, first can be with when testing destination application Judge current operation system version whether be above-mentioned method shown in FIG. 1 version.Wherein, default version can be by exploit person Member/tester is configured in test script in advance.
In embodiments of the present invention, for iOS system, which can be 9.0 versions of iOS, that is, work as behaviour Make system version be 9.0 and 9.0 or more when, execute step 304.
Wherein, when obtaining host process address, the program example object of the available destination application of terminal is tested, and By calling preset interface to obtain the corresponding host process address of the program example object.
In embodiments of the present invention, the journey for the app that test terminal can currently be tested according to above-mentioned host process acquisition of information Sequence instance objects, and according to the program example object, it calls directly preset system interface and gets the program example object pair The host process address answered.Wherein, which is that operating system provides, relevant to instance objects for obtaining The interface of information, for example, the preset system interface can be method_getImplementation and connect in iOS system Mouthful.
Specifically, test terminal can be obtained according to above-mentioned progress information M by taking iOS systems more than 9.0 versions as an example The program example object UIATarget of app, for example, test terminal can be according to the ID or master of the host process in progress information M The entrance function of process obtains the program example object UIATarget of app.After getting UIATarge, test terminal can To obtain the UIATarge by the preset system interface method_getImplementation of calling according to the UIATarge IMP address information IMP_A, the IMP_A be above-mentioned host process address.
When obtaining subprocess address, the element instance object of the available destination application of terminal is tested, and is passed through The preset interface is called to obtain the corresponding subprocess address of the element instance object.
In embodiments of the present invention, the member for the app that test terminal can currently be tested according to above-mentioned subprocess acquisition of information Plain instance objects, and according to the element instance object, it calls directly preset system interface and gets the element instance object pair The subprocess address answered.
Specifically, test terminal can be obtained according to above-mentioned subprocess information U by taking iOS systems more than 9.0 versions as an example The element instance object UIElement of app, for example, test terminal can according to the ID of the subprocess in subprocess information U or The entrance function of subprocess obtains the element instance object UIElement of app.After getting UIElement, terminal is tested Can be according to the UIElement, it should by calling preset system interface method_getImplementation to obtain IMP the address information IMP_U, the IMP_U of UIElement is above-mentioned subprocess address.
Step 305, test terminal monitors host process address and subprocess address.
In embodiments of the present invention, after test terminal gets host process address and subprocess address, hook can be passed through (such as Hook) program monitors host process address and subprocess address.Wherein, Hook is that one kind is believed by exchanger address It ceases to carry out the technology of monitoring or intercept process to program.
It is specific for example, test terminal can be lived in by automated process hook in iOS system more than 9.0 versions State IMP_A, the entrance of the two address informations of IMP_U, to realize that two address informations of IMP_U are registered to above-mentioned IMP_A It monitors.
Step 306, test terminal monitors the window events in destination application by host process address.
Wherein, test terminal can obtain the second of the object that destination application is being handled according to host process address and belong to Property information, whether the object that is handling of second attribute information instruction destination application is window object;Work as target application When the object that the second attribute information instruction destination application for the object that program is being handled is being handled is window object, really Surely window events are listened to.Wherein, it is window pair that window events, which are used to indicate the object that destination application is presently processing, As.
It is specific for example, test terminal can be supervised by Hook program automatic cycle in iOS system more than 9.0 versions Above-mentioned IMP_A is listened, when the object listened in UIATarge changes, for example new object occurs, test terminal can be with By the second attribute information of the object in calling method_getImplementation acquisition UIATarge, and according to Second attribute information of the object in UIATarge determines whether is object (i.e. app currently processed object) in UIATarge For window object, if so, explanation listens to the window events in app.
Step 307, when listening to window events, test terminal is obtained corresponding to window object by subprocess address First attribute information of window, first attribute information indicate whether the window is pop-up.
Wherein, when listening to window events, test terminal can be obtained in element instance object by subprocess address Element (i.e. above-mentioned window events corresponding window) the first attribute information, comprising being used in the first attribute information of the window Indication window whether be pop-up instruction information.
It, can be by upper when testing terminal monitoring to window events specifically, in iOS system more than 9.0 versions IMP_U is stated, the accessibilityLabel of the window in UIElement is obtained, includes in the accessibilityLabel The properties level of window, the properties level can indicate whether the window is pop-up.
Step 308, test terminal judges whether the window is pop-up according to the first attribute information of window, if so, into Step 309, otherwise, return step 305.
Specifically, in iOS system more than 9.0 versions, test terminal may determine that the window properties level whether For Alert, if so, entering step 309, otherwise, return step 305 continues to monitor.Wherein, Alert is window in iOS system A kind of properties level of mouth indicates that current window is prompt/alert type dialog box of pop-up, that is, pop-up.
Step 309, whether test terminal judges the window as it can be seen that if so, entering step 310, otherwise, return step 305。
In practical applications, having part pop-up may be the sightless pop-up of user, and pop-up sightless for user, The process that usually will not influence automatic test, for such sightless pop-up, it can not be handled by testing terminal. In this regard, test terminal judges that the window is the visual attribute of the available window after pop-up, visual attribute instruction Whether corresponding window is visible;When the visual attribute of the window indicates that the window is visible, test terminal executes step 312, Otherwise, return step 307.
Specifically, in iOS system more than 9.0 versions, if test terminal judges that the window is pop-up, further The visibility isVisible attribute of the window is obtained, if isVisible attribute indicates that the window is visible window, is entered Step 310, otherwise return step 305 continues to monitor.
Step 310, test terminal carries out predetermined process, and return step 305 to the window.
It in embodiments of the present invention, can be certainly when test terminal determines that the currently processed window of app is visible pop-up It is dynamic to close the window.For example, test terminal can determine the pass in each button with each button for including in cycling among windows Window button is closed, and simulates and clicks the close window button.
Since the close window button in window is usually the last one button in window, more than 9.0 versions IOS system in, if test terminal determine that the currently processed window of app is visible pop-up, the institute of the window can be traversed After having button, the last one button of automatically clicking, to destroy current window.Step 305 is then returned to continue to monitor.
In conclusion pop-up processing method provided in an embodiment of the present invention, is tested to a destination application When, whether window currently can handled according to the automatic monitoring objective application program of process address of destination application, into One step obtains the attribute for the window that destination application is presently processing, and is presently processing according to the determined property of window Window whether be pop-up, do not need tester in advance in test script add pop-up attribute templates, to improve The development efficiency of test script and testing efficiency to application program;
In addition, pop-up processing method provided in an embodiment of the present invention, is identifying the currently processed window of destination application When mouth is pop-up, further identify the pop-up whether as it can be seen that if pop-up avoids not as it can be seen that just to pop-up progress predetermined process Necessary treatment process has saved the unnecessary processing time, to improve automatic test efficiency.
In embodiments of the present invention, for not supporting the system version of above-mentioned Fig. 1 or pop-up processing method shown in Fig. 3, The attribute templates that pop-up can be arranged in test script in advance can be with when carrying out automatic test to destination application The third attribute information of the currently processed object of destination application is obtained, and by the third of the currently processed object of destination application Attribute information is compared with the attribute templates of pop-up, to determine whether the currently processed object of destination application is pop-up, if The third attribute information of the currently processed object of destination application is matched with the attribute templates of pop-up, it is determined that destination application Currently processed object is pop-up, and carries out predetermined process to the pop-up.
Fig. 4 is the flow chart of the pop-up processing method in a kind of iOS system shown according to an exemplary embodiment.With right For certain app carries out automatic test, referring to FIG. 4, the pop-up processing method can be such that
Test host process information M and subprocess information U that terminal obtains app.And it is extracted from host process information M current The version information of iOS system judges whether current iOS system is iOS9.0 or 9.0 according to the version information of current iOS system The system of the above version.
If current iOS system is the system of iOS 9.0 or 9.0 or more version, tests terminal and believed according to host process Breath M obtains the program example object UIATarge of the app, then obtains the address IMP of program example object UIATarge: IMP_A, also, the element instance object UIElement that terminal obtains the app also according to subprocess information U is tested, then obtain The address IMP of element instance object UIElement: IMP_U.It tests after endpoint to register monitoring address IMP_A and IMP_U, IMP_A and IMP_U is monitored by Hook program, when listening to window events by IMP_A, it is current that app is obtained by IMP_U The properties level of the window of processing, and judge whether the properties level of the window is Alert, if the properties level of the window is not Alert is then returned and is continued to monitor, if the properties level of the window is Alert, continues to judge that the isVisible of the window belongs to Whether property indicates that the window is visible;If the window as it can be seen that if test all buttons in terminal traversal current window, and simulate a little The last one button is hit to close window;If the window is invisible, return continues to monitor.
If current iOS system is the system of 9.0 or less version of iOS, tests terminal and obtain currently processed pair of app The AccessibilityElement attribute of elephant, specifically, the automator journey that test terminal can be carried by iOS system Sequence obtains the AccessibilityElement attribute of the currently processed object of app.Test the terminal object that app is currently processed AccessibilityElement attribute be compared with pre-set AccessibilityElement attribute templates;Its In, AccessibilityElement attribute templates can be developer/tester according to the pop-up being likely to occur AccessibilityElement attribute, the pre-set template in test terminal.When test terminal is determined by comparing The AccessibilityElement attribute of app currently processed object and AccessibilityElement attribute templates phase Timing can determine that the currently processed object of app is pop-up, and carry out closing processing to the object (i.e. pop-up), return after processing Return the AccessibilityElement attribute for obtaining the object of the next processing of app.
Fig. 5 is a kind of structural block diagram of pop-up processing unit shown according to an exemplary embodiment.Pop-up processing Device can be embodied as testing all or part of of terminal by way of software or soft or hard combination, to execute Fig. 1 to Fig. 4 The all or part of step of method in any embodiment.The pop-up processing unit may include:
Address acquisition module 501, for when testing destination application, obtaining the destination application Host process address and subprocess address, the host process address are for realizing the code of the host process of the destination application Block address, the subprocess address are the code block address for realizing the subprocess of the destination application;
Event monitoring module 502, for monitoring the window thing in the destination application by the host process address Part, the window events indicate that the destination application is handling window object;
First attribute obtains module 503, for obtaining window corresponding to the window object by the subprocess address First attribute information of mouth, first attribute information indicate whether the window is pop-up;
Processing module 504, for being executed to the window when first attribute information indicates that the window is pop-up Predetermined process.
Optionally, the address acquisition module, comprising:
First address acquisition unit, for obtaining the program example object of the destination application, and it is pre- by calling If interface obtains the corresponding host process address of described program instance objects;
Second address acquisition unit, for obtaining the element instance object of the destination application, and by calling institute It states preset interface and obtains the corresponding subprocess address of the element instance object.
Optionally, the event monitoring module, comprising:
Attribute acquiring unit, for obtaining the object that the destination application is being handled according to the host process address The second attribute information, second attribute information indicates whether the object that the destination application is being handled is window pair As;
Event determination unit, for indicating the object that the destination application is being handled when second attribute information When for window object, determination listens to the window events.
Optionally, described device further include:
Second attribute obtains module, for obtaining institute before the processing module executes predetermined process to the window The visual attribute of window is stated, the visual attribute indicates whether corresponding window is visible;
The processing module, for when the visual attribute of the window indicates that the window is visible, it to be described right to execute The window executes the step of predetermined process.
Optionally, the processing module, comprising:
Button determination unit determines the pass in each button for traversing each button for including in the window Close window button;
Unit is clicked in simulation, clicks the close window button for simulating.
Optionally, described device further include:
Data obtaining module, for obtained in the address acquisition module destination application host process address and Before subprocess address, the host process information of the destination application is obtained, includes operating system in the host process information Version information;
The address acquisition module indicates the version of the operating system not for the version information when the operating system When lower than default version, the step of executing the host process address and subprocess address for obtaining the destination application.
In conclusion pop-up processing unit provided in an embodiment of the present invention, is tested to a destination application When, whether window currently can handled according to the automatic monitoring objective application program of process address of destination application, into One step obtains the attribute for the window that destination application is presently processing, and is presently processing according to the determined property of window Window whether be pop-up, do not need tester in advance in test script add pop-up attribute templates, to improve The development efficiency of test script and testing efficiency to application program;
In addition, pop-up processing unit provided in an embodiment of the present invention, is identifying the currently processed window of destination application When mouth is pop-up, further identify the pop-up whether as it can be seen that if pop-up avoids not as it can be seen that just to pop-up progress predetermined process Necessary treatment process has saved the unnecessary processing time, to improve automatic test efficiency.
Fig. 6 is a kind of structural schematic diagram of computer equipment shown according to an exemplary embodiment.The computer is set It is standby to can be implemented as test terminal.The computer equipment 600 includes that central processing unit (CPU) 601 including arbitrary access are deposited The system storage 604 of reservoir (RAM) 602 and read-only memory (ROM) 603, and connection system storage 604 and centre Manage the system bus 605 of unit 601.The computer equipment 600 further includes transmitting between each device helped in computer The basic input/output (I/O system) 606 of information, and it is used for storage program area 613, application program 614 and other journeys The mass-memory unit 607 of sequence module 615.
The basic input/output 606 includes display 608 for showing information and inputs letter for user The input equipment 609 of such as mouse, keyboard etc of breath.Wherein the display 608 and input equipment 609 are all by being connected to The input and output controller 610 of system bus 605 is connected to central processing unit 601.The basic input/output 606 Can also include input and output controller 610 with for receive and handle from keyboard, mouse or electronic touch pen etc. it is multiple its The input of his equipment.Similarly, input and output controller 610 also provides output to display screen, printer or other kinds of defeated Equipment out.
The mass-memory unit 607 is by being connected to the bulk memory controller (not shown) of system bus 605 It is connected to central processing unit 601.The mass-memory unit 607 and its associated computer-readable medium are computer Equipment 600 provides non-volatile memories.That is, the mass-memory unit 607 may include such as hard disk or CD- The computer-readable medium (not shown) of ROM drive etc.
Without loss of generality, the computer-readable medium may include computer storage media and communication media.Computer Storage medium includes information such as computer readable instructions, data structure, program module or other data for storage The volatile and non-volatile of any method or technique realization, removable and irremovable medium.Computer storage medium includes RAM, ROM, EPROM, EEPROM, flash memory or other solid-state storages its technologies, CD-ROM, DVD or other optical storages, tape Box, tape, disk storage or other magnetic storage devices.Certainly, skilled person will appreciate that the computer storage medium It is not limited to above-mentioned several.Above-mentioned system storage 604 and mass-memory unit 607 may be collectively referred to as memory.
Computer equipment 600 can be connected to mutually by the Network Interface Unit 611 being connected on the system bus 605 Networking or other network equipments.
The memory further includes at least one instruction, at least a Duan Chengxu, code set or instruction set, and above-mentioned at least one Instruction, an at least Duan Chengxu, code set or instruction set are loaded by processor and are executed to realize such as any institute of above-mentioned Fig. 1 to Fig. 4 Show all or part of step in method.
Fig. 7 is a kind of structural schematic diagram of computer equipment 700 shown according to an exemplary embodiment.The computer is set Standby 700 can be implemented as the test terminal in above-mentioned embodiment illustrated in fig. 1.Computer equipment 700 in the embodiment of the present invention can To include one or more following component parts: completing the processing of various processes and method for executing computer program instructions Device, for information and storage program instruction random access memory (RAM) and read-only memory (ROM), for storing data with The memory of information, I/O equipment, interface, antenna etc..Specifically:
Computer equipment 700 may include RF (Radio Frequency, radio frequency) circuit 710, memory 720, input list First 730, display unit 740, sensor 750, voicefrequency circuit 760, WiFi (wireless fidelity, Wireless Fidelity) module 770, the components such as processor 780, power supply 782, camera 790.It will be understood by those skilled in the art that being calculated shown in Fig. 7 Machine equipment structure does not constitute the restriction to computer equipment, may include than illustrating more or fewer components, or combination Certain components or different component layouts.
It is specifically introduced below with reference to each component parts of the Fig. 7 to computer equipment 700:
RF circuit 710 can be used for receiving and sending messages or communication process in, signal sends and receivees, particularly, by base station After downlink information receives, handled to processor 780;In addition, the data for designing uplink are sent to base station.In general, RF circuit packet Include but be not limited to antenna, at least one amplifier, transceiver, coupler, LNA (Low Noise Amplifier, low noise Amplifier), duplexer etc..In addition, RF circuit 710 can also be communicated with network and other equipment by wireless communication.The nothing Any communication standard or agreement, including but not limited to GSM (Global System of Mobile can be used in line communication Communication, global system for mobile communications), GPRS (General Packet Radio Service, general packet without Line service), CDMA (Code Division Multiple Access, CDMA), WCDMA (Wideband Code Division Multiple Access, wideband code division multiple access), LTE (Long Term Evolution, long term evolution), electronics Mail etc..
Memory 720 can be used for storing software program and module, and processor 780 is stored in memory 720 by operation Software program and module, thereby executing the various function application and data processing of computer equipment 700.Memory 720 It can mainly include storing program area and storage data area, wherein storing program area can storage program area, at least one function institute The application program (such as sound-playing function, image player function etc.) etc. needed;Storage data area can store and be set according to computer Standby 700 use created data (such as audio data, phone directory etc.) etc..In addition, memory 720 may include high speed with Machine access memory, can also include nonvolatile memory, a for example, at least disk memory, flush memory device or its His volatile solid-state part.
Input unit 730 can be used for receiving the number or character information of input, and generate the use with computer equipment 700 Family setting and the related key signals input of function control.Specifically, input unit 730 may include touch panel 731 and its His input equipment 732.Touch panel 731, also referred to as touch screen, collect user on it or nearby touch operation (such as User uses the behaviour of any suitable object or attachment on touch panel 731 or near touch panel 731 such as finger, stylus Make), and corresponding attachment device is driven according to preset formula.Optionally, touch panel 731 may include touch detection dress It sets and two parts of touch controller.Wherein, the touch orientation of touch detecting apparatus detection user, and detect touch operation and bring Signal, transmit a signal to touch controller;Touch controller receives touch information from touch detecting apparatus, and it is turned It changes contact coordinate into, then gives processor 780, and order that processor 780 is sent can be received and executed.Furthermore, it is possible to Touch panel 731 is realized using multiple types such as resistance-type, condenser type, infrared ray and surface acoustic waves.In addition to touch panel 731, input unit 730 can also include other input equipments 732.Specifically, other input equipments 732 may include but unlimited In one of physical keyboard, function key (such as volume control button, switch key etc.), trace ball, mouse, operating stick etc. or It is a variety of.
Display unit 740 can be used for showing information input by user or the information and computer equipment that are supplied to user 700 various menus.Display unit 740 may include display panel 741, optionally, can use LCD (Liquid Crystal Display, liquid crystal display), the forms such as OLED (Organic Light-Emitting Diode, Organic Light Emitting Diode) come Configure display panel 741.Further, touch panel 731 covers display panel 741, when touch panel 731 detects on it Or after neighbouring touch operation, processor 780 is sent to determine the type of touch event, is followed by subsequent processing device 780 according to touch The type of event provides corresponding visual output on display panel 741.Although in Fig. 7, touch panel 731 and display panel 741 be the input and input function for realizing computer equipment 700 as two independent components, but in some embodiments In, can be integrated by touch panel 731 and display panel 741 and that realizes computer equipment 700 output and input function.
Computer equipment 700 may also include at least one sensor 750, for example, gyro sensor, magnetic induction sensor, Optical sensor, motion sensor and other sensors.Specifically, optical sensor may include ambient light sensor and close sensing Device, wherein ambient light sensor can adjust the brightness of display panel 741 according to the light and shade of ambient light, and proximity sensor can When computer equipment 700 is moved in one's ear, display panel 741 and/or backlight are closed.As a kind of motion sensor, add Velocity sensor can detect all directions on (generally three axis) acceleration size, can detect that when static gravity size and Direction, can be used to identify computer equipment posture application (such as horizontal/vertical screen switching, dependent game, magnetometer pose calibrating), Vibration identification correlation function (such as pedometer, percussion) etc.;The barometer that can also configure as computer equipment 700, hygrometer, The other sensors such as thermometer, infrared sensor, details are not described herein.
Voicefrequency circuit 760, loudspeaker 781, the audio that microphone 762 can provide between user and computer equipment 700 connect Mouthful.Electric signal after the audio data received conversion can be transferred to loudspeaker 761, by loudspeaker 761 by voicefrequency circuit 760 Be converted to voice signal output;On the other hand, the voice signal of collection is converted to electric signal by microphone 762, by voicefrequency circuit 760 receive after be converted to audio data, then by after the processing of audio data output processor 780, through RF circuit 710 to be sent to ratio Such as another computer equipment, or audio data is exported to memory 720 to be further processed.
WiFi belongs to short range wireless transmission technology, and computer equipment 700 can help user to receive by WiFi module 770 It sends e-mails, browse webpage and access streaming video etc., it provides wireless broadband internet access for user.Although figure 7 show WiFi module 770, but it is understood that, and it is not belonging to must be configured into for computer equipment 700, completely may be used To be omitted in the range for not changing disclosed essence as needed.
Processor 780 is the control centre of computer equipment 700, is set using various interfaces and the entire computer of connection Standby various pieces, by running or executing the software program and/or module that are stored in memory 720, and calling storage Data in memory 720, execute computer equipment 700 various functions and processing data, thus to computer equipment into Row integral monitoring.Optionally, processor 780 may include one or more processing units;Preferably, processor 780 can be integrated and be answered With processor and modem processor, wherein the main processing operation system of application processor, user interface and application program Deng modem processor mainly handles wireless communication.It is understood that above-mentioned modem processor can not also integrate Into processor 780.
Computer equipment 700 further includes the power supply 782 (such as battery) powered to all parts, it is preferred that power supply can be with It is logically contiguous by power-supply management system and processor 780, thus by power-supply management system realize management charging, electric discharge, with And the functions such as power managed.
Camera 790 is generally by groups such as camera lens, imaging sensor, interface, digital signal processor, CPU, display screens At.Wherein, camera lens is fixed on the top of imaging sensor, can change focusing by manually adjusting camera lens;Imaging sensor It is equivalent to " film " of traditional camera, is the heart of camera collection image;Interface is used for camera using winding displacement, plate to plate Connector, spring connection type are connect with computer equipment mainboard, and the image of acquisition is sent to the memory 720;Number Word signal processor is handled by image of the mathematical operation to acquisition, and the analog image of acquisition is converted to digital picture simultaneously Memory 720 is sent to by interface.
Although being not shown, computer equipment 700 can also be including bluetooth module etc., and details are not described herein.
Computer equipment 700 further includes having memory, in the memory in addition to including one or more processor 780 Be stored at least one instruction, at least a Duan Chengxu, code set or instruction set, above-mentioned at least one instruction, an at least Duan Chengxu, Code set or instruction set loaded by processor and executed with realize as above-mentioned Fig. 1 to Fig. 4 it is any shown in whole in method or Part steps.
In the exemplary embodiment, a kind of non-transitorycomputer readable storage medium including instruction, example are additionally provided It such as include the memory of at least one instruction, at least a Duan Chengxu, code set or instruction set, above-mentioned at least one instructs, at least One Duan Chengxu, code set or instruction set can be executed by processor to complete in any illustrated embodiment of Fig. 1 to Fig. 4 of the present invention, by Test all or part of step performed by terminal.For example, the non-transitorycomputer readable storage medium can be ROM, random access memory (RAM), CD-ROM, tape, floppy disk and optical data storage devices etc..

Claims (10)

1. a kind of pop-up processing method, which is characterized in that the described method includes:
When testing destination application, the host process address and subprocess address of the destination application are obtained, The host process address is the code block address for realizing the host process of the destination application, and the subprocess address is For realizing the code block address of the subprocess of the destination application;
The window events in the destination application are monitored by the host process address, the window events indicate the mesh Mark application program is handling window object;
The first attribute information of window corresponding to the window object, first attribute are obtained by the subprocess address Information indicates whether the window is pop-up;
When first attribute information indicates that the window is pop-up, predetermined process is executed to the window.
2. the method according to claim 1, wherein the host process address for obtaining the destination application With subprocess address, comprising:
The program example object of the destination application is obtained, and by calling preset interface to obtain described program instance objects The corresponding host process address;
The element instance object of the destination application is obtained, and by calling the preset interface to obtain the element instance The corresponding subprocess address of object.
3. the method according to claim 1, wherein described answered by the host process address monitoring target With the window events in program, comprising:
Obtain the second attribute information of the object that the destination application is being handled according to the host process address, described Two attribute informations indicate whether the object that the destination application is being handled is window object;
When the object that second attribute information indicates that the destination application is being handled is window object, determines and monitor To the window events.
4. the method according to claim 1, wherein also being wrapped before the execution predetermined process to the window It includes:
The visual attribute of the window is obtained, the visual attribute indicates whether corresponding window is visible;
When the visual attribute of the window indicates that the window is visible, execution is described to execute predetermined process to the window Step.
5. the method according to claim 1, wherein described execute predetermined process mouth to the window, comprising:
The each button for including in the window is traversed, determines the close window button in each button;
The close window button is clicked in simulation.
6. method according to any one of claims 1 to 5, which is characterized in that the master for obtaining the destination application Before process address and subprocess address, further includes:
The host process information of the destination application is obtained, includes the version information of operating system in the host process information;
The host process address and subprocess address for obtaining the destination application, comprising:
When the version information of the operating system indicates the version of the operating system not less than default version, obtained described in execution The step of taking the host process address and subprocess address of the destination application.
7. method according to any one of claims 1 to 5, which is characterized in that the destination application is based on iOS system The application program of operation.
8. a kind of pop-up processing unit, which is characterized in that described device includes:
Address acquisition module, for when testing destination application, obtaining the host process of the destination application Address and subprocess address, the host process address are for realizing the code block of the host process of the destination application Location, the subprocess address are the code block address for realizing the subprocess of the destination application;
Event monitoring module, it is described for monitoring the window events in the destination application by the host process address Window events indicate that the destination application is handling window object;
First attribute obtains module, for obtaining first of window corresponding to the window object by the subprocess address Attribute information, first attribute information indicate whether the window is pop-up;
Processing module, for executing book office to the window when first attribute information indicates that the window is pop-up Reason.
9. a kind of computer equipment, which is characterized in that the computer equipment includes processor and memory, in the memory It is stored at least one instruction, at least a Duan Chengxu, code set or instruction set, described at least one instructs, is at least one section described Program, the code set or instruction set are loaded by the processor and are executed to realize the bullet as described in claim 1 to 7 is any Window processing method.
10. a kind of computer readable storage medium, which is characterized in that be stored at least one instruction, extremely in the storage medium A few Duan Chengxu, code set or instruction set, at least one instruction, an at least Duan Chengxu, the code set or instruction Collection is loaded by processor and is executed to realize the pop-up processing method as described in claim 1 to 7 is any.
CN201711077207.9A 2017-11-06 2017-11-06 Popup window processing method and device Active CN109753425B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201711077207.9A CN109753425B (en) 2017-11-06 2017-11-06 Popup window processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201711077207.9A CN109753425B (en) 2017-11-06 2017-11-06 Popup window processing method and device

Publications (2)

Publication Number Publication Date
CN109753425A true CN109753425A (en) 2019-05-14
CN109753425B CN109753425B (en) 2021-04-02

Family

ID=66401087

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201711077207.9A Active CN109753425B (en) 2017-11-06 2017-11-06 Popup window processing method and device

Country Status (1)

Country Link
CN (1) CN109753425B (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111818375A (en) * 2020-06-09 2020-10-23 深圳市天威视讯股份有限公司 Popup window detection method and device for intelligent set top box and intelligent set top box
CN111966562A (en) * 2020-07-21 2020-11-20 北京视博云信息技术有限公司 Monitoring method and device of cloud platform and readable storage medium
CN112199284A (en) * 2020-10-10 2021-01-08 广州华多网络科技有限公司 Program automation testing method and corresponding device, equipment and medium
CN112286781A (en) * 2019-07-23 2021-01-29 百度时代网络技术(北京)有限公司 Automatic testing method, device, equipment and storage medium
CN113282361A (en) * 2021-04-21 2021-08-20 荣耀终端有限公司 Window processing method and electronic equipment
CN113448668A (en) * 2021-06-22 2021-09-28 北京百度网讯科技有限公司 Method and device for skipping popup window and electronic equipment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104123226A (en) * 2014-07-30 2014-10-29 深圳市共进电子股份有限公司 Processing method for popup form in automatic testing
US20150161283A1 (en) * 2013-12-05 2015-06-11 Lg Electronics Inc. Mobile terminal and controlling method thereof
CN105487758A (en) * 2015-12-11 2016-04-13 小米科技有限责任公司 Method and device for popup control of application software, and terminal equipment
CN105573911A (en) * 2015-12-10 2016-05-11 北京奇虎科技有限公司 Application popup window processing method and apparatus
CN106599246A (en) * 2016-12-20 2017-04-26 维沃移动通信有限公司 Display content interception method, mobile terminal and control server
CN106941568A (en) * 2017-03-30 2017-07-11 努比亚技术有限公司 A kind of Toast pop-ups optimization display methods, device and Toast pop-ups dispatching method and device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150161283A1 (en) * 2013-12-05 2015-06-11 Lg Electronics Inc. Mobile terminal and controlling method thereof
CN104123226A (en) * 2014-07-30 2014-10-29 深圳市共进电子股份有限公司 Processing method for popup form in automatic testing
CN105573911A (en) * 2015-12-10 2016-05-11 北京奇虎科技有限公司 Application popup window processing method and apparatus
CN105487758A (en) * 2015-12-11 2016-04-13 小米科技有限责任公司 Method and device for popup control of application software, and terminal equipment
CN106599246A (en) * 2016-12-20 2017-04-26 维沃移动通信有限公司 Display content interception method, mobile terminal and control server
CN106941568A (en) * 2017-03-30 2017-07-11 努比亚技术有限公司 A kind of Toast pop-ups optimization display methods, device and Toast pop-ups dispatching method and device

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
CLOSE_MARTY: "基于instruments-Automation的iOS应用UI自动化测试图文攻略", 《CSDN,HTTPS://BLOG.CSDN.NET/CLOSE_MARTY/ARTICLE/DETAILS/34527821》 *
李馨雨: "探究腾讯新闻弹窗品质如何提升——基于成都地区大学生网民调查", 《新闻研究导刊》 *

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112286781A (en) * 2019-07-23 2021-01-29 百度时代网络技术(北京)有限公司 Automatic testing method, device, equipment and storage medium
CN111818375A (en) * 2020-06-09 2020-10-23 深圳市天威视讯股份有限公司 Popup window detection method and device for intelligent set top box and intelligent set top box
CN111966562A (en) * 2020-07-21 2020-11-20 北京视博云信息技术有限公司 Monitoring method and device of cloud platform and readable storage medium
CN112199284A (en) * 2020-10-10 2021-01-08 广州华多网络科技有限公司 Program automation testing method and corresponding device, equipment and medium
CN113282361A (en) * 2021-04-21 2021-08-20 荣耀终端有限公司 Window processing method and electronic equipment
CN113282361B (en) * 2021-04-21 2022-09-23 荣耀终端有限公司 Window processing method and electronic equipment
CN113448668A (en) * 2021-06-22 2021-09-28 北京百度网讯科技有限公司 Method and device for skipping popup window and electronic equipment
CN113448668B (en) * 2021-06-22 2023-09-29 北京百度网讯科技有限公司 Method and device for skipping popup window and electronic equipment

Also Published As

Publication number Publication date
CN109753425B (en) 2021-04-02

Similar Documents

Publication Publication Date Title
CN109753425A (en) Pop-up processing method and processing device
CN106126411B (en) The method and apparatus that a kind of pair of tested program code is tested
CN105740145B (en) The method and device of element in orient control
CN108052412A (en) Restart Fault Locating Method, mobile terminal and computer readable storage medium
CN112148579B (en) User interface testing method and device
CN106776301B (en) Subelement testing method and device
CN108920306A (en) What is managed based on memory restarts localization method, mobile terminal and readable storage medium storing program for executing
CN108121613A (en) Localization method, mobile terminal and readable storage medium storing program for executing are restarted based on page
CN109582565A (en) Prevent the method, terminal and computer storage medium of application crashes
CN112199246A (en) Terminal testing method and device, storage medium and mobile terminal
CN105807908B (en) A kind of method and apparatus of switching working mode
CN108196968A (en) Mobile terminal restarts localization method, mobile terminal and computer readable storage medium
CN110069407B (en) Function test method and device for application program
CN108052430A (en) Mobile terminal restarts localization method, mobile terminal and computer readable storage medium
CN108012031A (en) Mobile terminal restarts localization method, mobile terminal and computer-readable recording medium
CN109688611A (en) A kind of configuration method, device, terminal and the storage medium of frequency range parameter
CN109165110A (en) Mobile terminal restarts localization method, mobile terminal and computer readable storage medium
CN109451295A (en) A kind of method and system obtaining virtual information
CN108182123A (en) Mobile terminal restarts localization method, mobile terminal and computer readable storage medium
CN108255631A (en) Mobile terminal restarts localization method, mobile terminal and computer readable storage medium
CN108052437A (en) Restart localization method, mobile terminal and computer readable storage medium
CN108196969A (en) Restart monitoring and localization method, mobile terminal and computer readable storage medium
CN109298964A (en) Mobile terminal restarts localization method, mobile terminal and computer readable storage medium
CN108268335A (en) Localization method, mobile terminal and readable storage medium storing program for executing are restarted based on system service
CN108900696A (en) A kind of data processing method, terminal and computer readable 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
GR01 Patent grant
GR01 Patent grant