CN107562611B - Method and device for realizing simulation test - Google Patents

Method and device for realizing simulation test Download PDF

Info

Publication number
CN107562611B
CN107562611B CN201610511181.3A CN201610511181A CN107562611B CN 107562611 B CN107562611 B CN 107562611B CN 201610511181 A CN201610511181 A CN 201610511181A CN 107562611 B CN107562611 B CN 107562611B
Authority
CN
China
Prior art keywords
event
page
processing
test environment
processing event
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
CN201610511181.3A
Other languages
Chinese (zh)
Other versions
CN107562611A (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.)
Alibaba Group Holding Ltd
Original Assignee
Alibaba Group Holding 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 Alibaba Group Holding Ltd filed Critical Alibaba Group Holding Ltd
Priority to CN201610511181.3A priority Critical patent/CN107562611B/en
Publication of CN107562611A publication Critical patent/CN107562611A/en
Application granted granted Critical
Publication of CN107562611B publication Critical patent/CN107562611B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Debugging And Monitoring (AREA)

Abstract

The application discloses a method and a device for realizing simulation test, comprising the following steps: hit the preset processing event; and executing the hit processing event according to the current test environment and the pre-judging condition corresponding to the processing event. By optimizing the simulation test process, the method and the device increase the pre-judgment processing of the preset processing event, and only when the current test environment meets the pre-judgment condition corresponding to the processing event, the hit processing event is continuously executed after the pre-processing. Therefore, the event is strengthened through the simulation test, the capability of discovering program abnormity through the simulation test is improved, the time for discovering the problem is shorter and more efficient, and the cost of testing and verifying the problem is saved.

Description

Method and device for realizing simulation test
Technical Field
The present application relates to automated testing technologies, and in particular, to a method and an apparatus for implementing a simulation test.
Background
Xcode is an integrated development tool (IDE) developed by apple Inc. that runs on the operating system Mac OS X, the fastest way to develop OS X and iOS applications. The Xcode has a uniform user interface design, and the encoding, the testing and the debugging are completed in a simple window. The Xcode self-contained tools (instruments) mainly perform performance specific analysis, such as a tool set for detecting memory, CPU, network, frame rate, and performing iOS automation.
Simulation tests such as Monkey tests are a means of automated tests, Monkey tests are very simple, namely key input, touch screen input, gesture input and the like of a user are simulated, and abnormity occurs for a long time after the user watches equipment. The IOS Monkey test is characterized in that on Xcode which is a development software carried by apple, Monkey is run through instruments, and when an IOS Monkey program runs on a simulator or an IOS device, a user is simulated to trigger random events such as clicking, dragging, gestures or system levels, so that stability of App can be tested for a long time.
The native Monkey script random test of the existing iOS has the following problems:
the native Monkey technology of the existing iOS does not have login capability, if the quit login button is not carefully clicked in the random process or the App does not log in, the program stays on the login page and cannot enter, namely, the program is blocked on the login page and cannot log in, at the moment, the page operation of some login states cannot be achieved due to the fact that the login cannot be achieved, and therefore the probability of being randomly tested by the Monkey is reduced;
in the existing native Monkey technology of iOS, a click (tap) event and a drag (drag) event are all random events performed based on the whole App screen, and the native Monkey technology does not have the intensive operation of a local area of the screen. For some areas occupying large positions of the screen, the screen is easy to randomly operate, so that the screen is easy to fall into the functions or pages, and the probability that the Monkey tests other pages is reduced;
the native Monkey technology of the existing iOS only verifies the functions of some app plug-ins, but not the full functions of the whole app, and does not have the capability of staying in a certain fixed page.
That is to say, in the native Monkey technology of the existing iOS, when the native Monkey script is tested randomly, all test items can not be tested due to the uneven random test of Monkey, and the reliability of the whole test is reduced.
Disclosure of Invention
In order to solve the technical problem, the application provides a method and a device for realizing Monkey testing, which can improve the ability of Monkey to find program abnormity.
In order to achieve the object of the present application, the present application provides a method for implementing a simulation test, comprising:
hit the preset processing event;
and executing the hit processing event according to the current test environment and the pre-judging condition corresponding to the processing event.
Optionally, the processing event includes any combination of the following: a login event, a click event, an animation event, a scroll event, a fixed page event.
Optionally, the processing event is a login event; the pre-judging condition comprises the following steps: whether a page reference point exists in a page of the current testing environment or not is judged;
the executing the hit processing event according to the pre-judging condition corresponding to the current test environment and the processing event includes: a page reference point exists on the page where the current test environment is located; and clicking a page needing login to execute login.
Optionally, the processing event is a click event; the pre-judging condition comprises the following steps: whether a page reference point exists in a page of the current testing environment or not is judged;
the executing the hit processing event according to the pre-judging condition corresponding to the current test environment and the processing event includes: a page reference point exists on the page where the current test environment is located; and clicking a page needing login to execute login.
Optionally, the processing event is a fixed region reinforcement event; the pre-judging condition comprises the following steps: whether a page of the current testing environment has a big picture mode or not;
the executing the hit processing event according to the pre-judging condition corresponding to the current test environment and the processing event includes: a big picture mode exists in the page where the current test environment is located; and clicking the large graph area, and executing the upper N-level page where the large graph mode is located, wherein N is an integer greater than or equal to 1.
Optionally, the processing event is an animation event; the pre-judging condition comprises the following steps: whether the animation in the current test environment falls in a preset first area or not;
the executing the hit processing event according to the pre-judging condition corresponding to the current test environment and the processing event includes: the animation in the current test environment falls into a preset first area; a test of an animation or gesture is triggered.
Optionally, the processing event is a scroll event; the pre-judging condition comprises the following steps: whether an interactive object needing to display the structured data exists in the current test environment or not;
the executing the hit processing event according to the pre-judging condition corresponding to the current test environment and the processing event includes: an interactive object needing to display the structured data exists in the current test environment; and circularly executing the pull-down page turning operation.
Optionally, the processing event is a fixed page event; the pre-judging condition comprises the following steps: whether a page reference point exists in a page of the current testing environment or not is judged;
the executing the hit processing event according to the pre-judging condition corresponding to the current test environment and the processing event includes: a page reference point exists on the page where the current test environment is located; clicking a preset fixed menu.
Optionally, if the current test environment does not satisfy the predetermined condition corresponding to the processing event, the method further includes:
and exiting the hit processing event and returning to continue executing the simulation test.
Optionally, the method further comprises: hitting a page return event, and falling the random click operation in the simulation test into a preset interval range; wherein the content of the first and second substances,
the interval range is an area of the screen for returning to a previous page.
The application also provides a device for realizing the simulation test, which comprises a first processing module and a second processing module, wherein,
the first processing module is used for executing the simulation test and informing the second processing module when a preset processing event is hit;
and the second processing module is used for executing the hit processing event according to the current test environment and the prejudgment condition corresponding to the processing event.
Optionally, when the processing event is a login event or a click event, the anticipation condition includes: whether a page reference point exists in a page of the current testing environment or not is judged;
the second processing module is specifically configured to: judging that a page reference point exists in the page of the current test environment; clicking a page needing login and executing login;
when the processing event is a fixed area strengthening event, the pre-judging condition includes: whether a page of the current testing environment has a big picture mode or not;
the second processing module is specifically configured to: judging that a page in which the current test environment is located has a big picture mode; clicking the large graph area, and executing the upper N-level page where the large graph mode is located, wherein N is an integer greater than or equal to 1;
when the processing event is an animation event, the prejudging condition comprises: whether the animation in the current test environment falls in a preset first area or not;
the second processing module is specifically configured to: judging whether the animation in the current test environment falls into a preset first area, and triggering the test of the animation or the gesture;
when the processing event is a scroll event, the pre-judging condition includes: whether an interactive object needing to display the structured data exists in the current test environment or not;
the second processing module is specifically configured to: judging that an interactive object needing to display the structured data exists in the current test environment; and circularly executing the pull-down page turning operation.
When the processing event is a fixed page event, the pre-judging condition includes: whether a page reference point exists in a page of the current testing environment or not is judged;
the second processing module is specifically configured to: judging that a page reference point exists in a page where the current test environment is located; clicking a preset fixed menu.
Optionally, the second processing module is further configured to: judging that the current test environment does not meet the pre-judgment condition corresponding to the processing event, exiting the hit processing event and informing the first processing module to continue executing the simulation test.
The scheme provided by the application comprises the steps of hitting preset processing events; and executing the hit processing event according to the current test environment and the pre-judging condition corresponding to the processing event. By optimizing the simulation test process, the method and the device increase the pre-judgment processing of the preset processing event, and only when the current test environment meets the pre-judgment condition corresponding to the processing event, the hit processing event is continuously executed after the pre-processing. Therefore, the event is strengthened through the simulation test, the capability of discovering program abnormity through the simulation test is improved, the time for discovering the problem is shorter and more efficient, and the cost of testing and verifying the problem is saved.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings are included to provide a further understanding of the claimed subject matter and are incorporated in and constitute a part of this specification, illustrate embodiments of the subject matter and together with the description serve to explain the principles of the subject matter and not to limit the subject matter.
FIG. 1 is a flow chart of a method for implementing simulation testing according to the present application;
FIG. 2 is a schematic flowchart of a method for implementing Monkey testing according to a first embodiment of the present application;
FIG. 3 is a schematic flowchart of a method for implementing Monkey testing according to a second embodiment of the present application;
FIG. 4(a) is a schematic diagram of a third embodiment of the method for implementing Monkey testing according to the present application;
FIG. 4(b) is a schematic diagram of a fourth embodiment of the method for implementing Monkey testing according to the present application;
FIG. 5 is a schematic flow chart illustrating a fifth embodiment of a method for implementing Monkey testing according to the present application;
fig. 6 is a schematic structural diagram of a device for implementing simulation test according to the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more apparent, embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that the embodiments and features of the embodiments in the present application may be arbitrarily combined with each other without conflict.
In one exemplary configuration of the present application, a computing device includes one or more processors (CPUs), input/output interfaces, a network interface, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device. As defined herein, computer readable media does not include non-transitory computer readable media (transient media), such as modulated data signals and carrier waves.
The steps illustrated in the flow charts of the figures may be performed in a computer system such as a set of computer-executable instructions. Also, while a logical order is shown in the flow diagrams, in some cases, the steps shown or described may be performed in an order different than here.
Fig. 1 is a flowchart of a method for implementing a simulation test according to the present application, where in the simulation test, as shown in fig. 1, the method includes:
step 100: hit a pre-set processing event.
In this step, the preset processing event may include, but is not limited to: a login event, a tap event, an animation event (also referred to as a gesture event), a scroll (page flip) event, a fixed page event, and the like. A hit is a successful click and a hit handling event may also be referred to as a click handling event.
Step 101: and executing the hit processing event according to the current test environment and the pre-judging condition corresponding to the processing event.
In this step, if the current test environment does not satisfy the pre-judgment condition corresponding to the processing event, the hit processing event is exited and the simulation test is returned to be continuously executed.
Wherein, the simulation test includes but is not limited to Monkey test.
The prejudged condition is a condition for determining whether the hit processing event satisfies the execution under the current test environment. Such as:
for the case that the processing event is a login event, the anticipation condition may include: whether a page reference point such as a menu exists in the page of the current test environment or not is tested. If the page reference point such as a menu exists, the prejudgment condition is considered to be met; at this time, the processing event of performing the hit includes: and clicking a page needing login, and executing login. It should be noted that, because the simulation test is completely random, and it is unclear which page the App stays at the current time, the login operation of the specific path is completed to return the simulation test to the fixed point (e.g., App home page), and therefore, at this time, the simulation test needs to find a page reference point such as a menu to return to the App home page.
For the case that the processing event is a tap event, the anticipation condition may include: whether a page reference point such as a menu exists in the page of the current test environment or not is tested. If the page reference point such as a menu exists, the prejudgment condition is considered to be met; in this case, the processing event of continuing to execute the hit after the preprocessing includes: and clicking a page needing login, and executing login.
For the case that the processing event is a fixed-area reinforcement event (also referred to as an anti-trapping event in this case), the pre-judging condition may also include: whether a large graph mode such as a product detail (detail) page exists in a page where the current test environment is located. If a large graph mode such as a product detail (detail) page exists, the prejudgment condition is considered to be met; in this case, the processing event of continuing to execute the hit after the preprocessing includes: clicking a big picture area in a big picture mode such as a product detail (detail) page, and executing an upper N-level page returning to the big picture mode such as the product detail (detail) page, wherein N is an integer greater than or equal to 1.
For the case where the processing event is an animation event, the anticipation condition may include: whether the animation in the current test environment falls within a preset first area or not is judged. If the area falls into a preset first area, the judgment condition is considered to be met; in this case, the processing event of continuing to execute the hit after the preprocessing includes: tests are performed that trigger animations or gestures, such as sliding left to right in iOS gestures, simulating gestures in Monkey.
For the case that the processing event is a scroll (page-turning) event, the anticipation condition may include: whether an interactive object needing to show structured data exists in the current test environment or not, namely, a scroll event can be triggered as long as a page can slide, for example, whether a Table views object exists or not. If so, determining that the prejudgment condition is met; in this case, the processing event of continuing to execute the hit after the preprocessing includes: and circularly executing the pull-down page turning operation.
For the case that the processing event is a fixed page event, the prejudging condition comprises the following steps: whether a page reference point such as a tabBar menu exists in the page where the current test environment is located or not is judged. If a page reference point such as a tabBar menu exists, the prejudgment condition is considered to be met; in this case, the processing event of continuing to execute the hit after the preprocessing includes: clicking a preset fixed menu.
The method of the present application further comprises: once the self-defined page return (back) event is hit, the random clicking operation in the simulation test is within the preset interval range of the screen for realizing the page before returning. The preset area range is mainly a < "> button area at the upper left corner of the page, and the function of returning to the previous page can be realized by clicking the button.
By optimizing the simulation test process, the method and the device increase the pre-judgment processing of the preset processing event, and only when the current test environment meets the pre-judgment condition corresponding to the processing event, the hit processing event is continuously executed after the pre-processing. Therefore, the event is strengthened through the simulation test, the capability of discovering program abnormity through the simulation test is improved, the time for discovering the problem is shorter and more efficient, and the cost of testing and verifying the problem is saved.
The following describes the present application in detail with reference to specific embodiments, taking the simulation test as the Monkey test as an example.
Fig. 2 is a schematic flowchart of a first embodiment of a method for implementing Monkey testing according to the present application, where a processing event is taken as a login event in the first embodiment, as shown in fig. 2, the method includes:
step 200 to step 201: judging whether the login event is hit or not in the Monkey random operation process, and entering step 202 once the login event is hit; otherwise, returning to the Monkey random operation process.
Step 202: judging whether a menu exists in the current Monkey test environment, and if so, entering step 203; if there is no menu, step 207 is entered.
Step 203: clicking a module needing login, and assuming that a page can be entered if login is needed in the first embodiment: a user management backend (myAE) module.
Step 204: judging whether the current log-out state is the log-out state, and if so, entering the step 205; if not, step 206 is entered.
Step 205: a login operation is performed and step 207 is entered after the login is correct.
Step 206: checking whether the login state is correct, and if so, entering step 207; if not, return to step 205.
Step 207: and completing the login event and returning to the step 200 to continue executing the Monkey random operation process.
In the iOS Monkey test, the event with the highest percentage of occupation is a tap event, and the login event pre-judging process shown in fig. 2 of the present application may be added to the tap click event, that is, the preset processing event at this time is the tap event, so as to improve the execution probability of the login event pre-judging process shown in fig. 2 of the present application.
The login event pre-judging process shown in fig. 2 is mainly applicable to an application (App) that needs to login, and if the App to be tested does not need to login, the login event ratio may be adjusted to zero. However, the way of adding the login event anticipation process shown in fig. 2 of the present application to the tap event is not suitable for the Monkey test process of the non-login App.
For the case that the processing event is a login event, the login event needs to be hit, and the probability of the hit of the login event can be controlled by the event scale of Monkey, taking the example that all the event scales are defined as 1000 events, and the login event is defined as 50, then the probability of the login event being randomly executed is 20%. However, in the case where the processing event is a tap click event, that is, if the anticipation process is set in the tap event, the tap event is generally set to about 800, that is, 80% of the probability is that the tap operation will be hit, and once the tap operation is hit, the login determination will be performed. It can be seen that, in the two pre-judging methods, the probability of judging whether to need to log in is obviously different.
The Monkey has very high requirement on the execution frequency, generally 20-30 times of random operation occur per second, and for the mode of increasing the login event pre-judging process in the tap event, the accuracy of judging timeout needs to be solved. It should be noted that if the page determination timeout period is not set, the system will give a default timeout of, for example, 0.05s, that is, even if it is determined that the system has already timed out, the system will wait for 0.05 s.
In the process of Monkey random test in the related art, the function of clicking the overlay screen, such as a product detail page, is easy to hit because the product drawing occupies two thirds of the space of the screen, once hit, the product big drawing mode page is entered, the task page is clicked again and returned, and the process is repeated, so that the product big drawing mode page and the product big drawing page always stay, the Monkey test is trapped in the page, and the Monkey execution efficiency is reduced once hit is easy to trap. Fig. 3 is a schematic flowchart of a second embodiment of the method for implementing Monkey testing according to the present application, where the second embodiment takes a processing event as a tap event, as shown in fig. 3, including:
step 300 to step 301: judging whether a tap event is hit in the Monkey random operation process, and entering step 302 once the tap event is hit; otherwise, returning to the Monkey random operation process.
Step 302: judging whether a product large image exists in the current Monkey test environment, and entering step 303 if the product large image exists; if no product big picture exists, go to step 307.
In this step, a decision function of the big picture page, such as this. is _ bigPhoto (), can be used to determine whether the current Monkey test environment is in the product big picture page.
Step 303: click on the big map area.
In this step, the page control where the large map is located can be uniquely determined by the mark, for example, the scrollViews () [ "fullscreen _ image" ] to realize the clicking of the large map area, where the scrollViews has been marked as fullscreen _ image by the access capability.
Step 304: judging whether to return to a detail page, if not, returning to the step 303; if it is determined that a detail page needs to be returned, step 305 is entered.
Step 305: click on detail page return.
And returning to the product detail page after clicking the product large graph mode, wherein the product detail page can be judged through a return function of the product detail page, such as this.
Step 306: and clicking to return to the last page of the detail page.
In this step, the previous page of detail can be returned by clicking a return button of the large graph, such as buttons () [ "ic Back White" ].
Step 307: and completing the anti-trapping event, namely, the Monkey test is far away from the product large graph and the product detail page. Returning to the step 300 to continue executing the Monkey random operation process.
Through the flow shown in fig. 3, when a tap event is hit and a product large graph exists in the current Monkey test environment, for example, a product graph occupying two thirds of the space of the screen exists, the previous level page of the detail page is returned, so that the product large graph and the product detail page are far away, and the Monkey test is free from the problem that the Monkey test stays on the detail page and the product large graph page but cannot come. Therefore, the Monkey test can be carried out, and the reliability of the whole test is improved.
Fig. 4(a) is a schematic diagram of a third embodiment of the method for implementing Monkey testing according to the present application, in which a processing event is an animation and a gesture, such as a customized animation _ drag event, and a region of drag (drag) is defined, such as a region of about 30 pixels on each of the left side and the right side of the screen framed by a thick frame shown in fig. 4 (a).
When the Monkey random operation drag hits the left and right side regions shown in fig. 4(a), the animation & gesture function is triggered, and the main purpose is to find out program crash (crash) caused by gesture failure and collision problem in different operating systems.
The custom animation _ drag event is: for dragFromToForDuration on the X-axis, the Y-axis defines a random value within a relative interval: x is this. randomnimationTapX (), and y startY.
The Monkey's attribute method randomnimationTapX mainly controls 0-30 pixels of the X axis randomly falling on the left side, i.e. 0< X <30 pixels.
In the third embodiment shown in fig. 4(a), the dragging event of the Monkey is processed twice, and the dragged area is defined, such as the fixed areas on the left side and the right side of the screen framed by the thick line frame identified in fig. 4(a), to increase the probability of the occurrence of the gesture, so as to realize the purpose of checking whether the bug of the program is caused by the failure of animation or gesture during the Monkey random test.
Fig. 4(b) is a schematic diagram of a fourth embodiment of the method for implementing Monkey test according to the present application, in the fourth embodiment, a processing event is taken as a page back event, which is a self-defined page back event, so as to enhance the problem of crash caused by back-and-forth switching of Monkey test on different pages. The area is mainly the approximate area range of the < "> button at the upper left corner of the page, and the Monkey clicks the small area to click the <" > button in the page and return to the previous page.
During Monkey random test, once the user-defined page back event is hit, the random clicking operation is dropped into the range of the user-defined X axis and Y axis of the screen: preferably, after all iOS handset resolutions are adapted, the custom range of X-axis can be 15< X < 30; the custom range for the Y-axis may be 15< Y < 30.
If the occurrence probability of the page back event needs to be increased, the page back event can be realized by increasing the proportionality coefficient of the current back TapEvent, and the specific implementation belongs to the conventional technical means of a person skilled in the art, and is not used for limiting the protection scope of the present application, and is not described herein again. The page back event is generally used in combination with other events, and the possibility of the App switching back and forth between different pages can be increased by setting the events.
In addition, for the event that the processing event is a self-defined scroll (page turning) event, the stability performance of the random Monkey when the screen is pulled down to trigger the network to request for page turning is mainly solved, and pages such as a product search list, a favorite list, an order list and the like can be checked through the self-defined scroll (page turning) event.
In the application, whether an interactive object needing to display structured data exists in a current page or not can be judged through a self-defined scroll _ drag random event, namely, a scrolling event can be triggered as long as the page can slide, for example, whether a tableViews object exists or not, and if the interactive object exists, a loop pull-down screen flipping flickFromTo operation is performed. Likewise, if it is desired to increase the probability of occurrence of such an event, the current scroll _ drag scaling factor may be increased.
The scrolling event of the application emphasizes checking some list pages, requests network resources and renders the pages by continuously loading data of the next page through the scrolling screen, and meanwhile, increases the activity range of Monkey testing on the pages, and also can increase the setting of the event proportion to check whether the pages have problems.
Because the iOS cannot open a certain page in an adb shell start XX activity mode like an android system, once the iOS instruments start to execute a Monkey test process, the iOS instruments start to start from the starting page, and therefore, in the random Monkey execution process, the method and the device can limit by finding a reference point which can be referred to on the App, such as a tabBar menu, and clicking a tabBar menu event. Fig. 5 is a schematic flowchart of a fifth embodiment of the method for implementing Monkey testing according to the present application, where the fifth embodiment takes a processing event as a fixed page event, as shown in fig. 5, including:
step 500 to step 501: judging whether a fixed page event is hit in the Monkey random operation process, and entering step 502 once the fixed page event is hit; otherwise, returning to the Monkey random operation process.
Step 502: judging whether a tabBar menu exists in the current Monkey testing environment, namely the current page, and if so, entering step 503; if not, go to step 504.
Step 503: the directional guide Monkey turns to a preset fixed menu, mainWindow (). tabBars () [0]. buttons () [ tabbar _ index ]. tap ().
Step 504: and completing the fixed page event, and returning to the step 500 to continue executing the Monkey random operation process.
In the embodiment, the probability of turning to a specific page by clicking a fixed menu is increased by adjusting the proportion of the tabBarTap () event, and the proportion of fixedly clicking a certain menu event is continuously increased, so that the probability of turning to the fixed page by the App can be improved.
In this embodiment, App with a bottom tabBar menu needs to be supported. If not App in the manner of the tabBar bottom menu. The page reference point can be found through other methods, and then a specific path is set through judgment of the page reference point to reach the designated page, and the specific implementation belongs to the technical scheme provided by the application, and is easy to implement by a person skilled in the art, and is not used for limiting the protection scope of the application, and is not described herein again.
At present, for example, some apps such as mobile phone panning and the like manage a plurality of sub apps included therein in a plug-in mode, each sub App is integrated through a BundleID, and when only some function pages of the sub apps are verified, it is only necessary to adopt the mode of the embodiment to enable a Monkey to stay on a fixed page for a long time to perform stability test.
It should be noted that the ratio of tabBar menu click events cannot be increased infinitely, and when the ratio is greater than the tap event, the iOS monkey cannot stay on a certain page completely. When the current fixed page is dissociated in random operation, the current App can be redirected to the fixed page as long as the next tabBar menu click event is hit.
Fig. 6 is a schematic structural diagram of a device for implementing simulation test according to the present application, as shown in fig. 6, which at least includes a first processing module and a second processing module, wherein,
the first processing module is used for executing the simulation test and informing the second processing module when a preset processing event is hit;
and the second processing module is used for executing the hit processing event according to the condition that the current test environment meets the prejudgment condition corresponding to the processing event.
Further, the second processing module is further configured to: judging that the current test environment does not meet the pre-judgment condition corresponding to the processing event, quitting the hit processing event and informing the first processing module to continue to execute the simulation test.
In particular, the amount of the solvent to be used,
when the processing event is a login event, the prejudging condition comprises the following steps: whether a page reference point such as a menu exists in the page of the current test environment or not is tested. If the page reference point such as a menu exists, the prejudgment condition is considered to be met; at this time, the second processing module is specifically configured to: judging that the page reference point such as a menu exists in the page of the current test environment, clicking the page needing to be logged in, and executing the login.
When the processing event is a tap event, the prejudging condition comprises the following steps: whether a page reference point such as a menu exists in the page of the current test environment or not is tested. If the page reference point such as a menu exists, the prejudgment condition is considered to be met; the second processing module is specifically configured to: judging that the page reference point such as a menu exists in the page of the current test environment, clicking the page needing to be logged in, and executing the login.
When the processing event is a fixed area reinforcement event (also referred to as an anti-trapping event in this case), the anticipation condition includes: whether a large graph mode such as a product detail (detail) page exists in a page where the current test environment is located. If a large graph mode such as a product detail (detail) page exists, the prejudgment condition is considered to be met; the second processing module is specifically configured to: judging that a page of the current test environment has a big picture mode, clicking the big picture mode such as a big picture area in a product detail (detail) page, and executing the return to the big picture mode such as an upper N-level page of the product detail (detail) page, wherein N is an integer greater than or equal to 1.
When the processing event is an animation event, the prejudging condition comprises the following steps: whether the animation in the current test environment falls within a preset first area or not is judged. If so, the judgment condition is considered to be met; the second processing module is specifically configured to: and judging that the animation in the current test environment falls in a preset first area, and triggering the test of the animation or the gesture.
When the processing event is a scroll (page turning) event, the prejudging condition comprises the following steps: whether an interactive object needing to show structured data exists in the current test environment or not, namely, a scroll event can be triggered as long as a page can slide, for example, whether a Table views object exists or not. If so, determining that the prejudgment condition is met; the second processing module is specifically configured to: and judging that the interactive object needing to display the structured data exists in the current test environment, and circularly executing the pull-down page turning operation.
When the processing event is a fixed page event, the prejudging condition comprises the following steps: whether a page reference point such as a tabBar menu exists in the page where the current test environment is located or not is judged. If a page reference point such as a tabBar menu exists, the prejudgment condition is considered to be met; the second processing module is specifically configured to: judging that the page reference point exists in the page of the current test environment, and clicking a preset fixed menu.
Alternatively,
the second processing module is further configured to: and once the self-defined page return (back) event is hit, the random click operation in the simulation test is within the preset interval range. The preset area range is an area which is preset on a screen and used for realizing the page before returning, mainly is a < "> button area at the upper left corner of the page, and the function of returning the page before returning can be realized by simulating a test and clicking the button.
The present application further provides an apparatus for implementing simulation testing, comprising at least a memory and a processor, wherein,
the memory has stored therein the following executable instructions: hit the preset processing event; and executing the hit processing event according to the current test environment and the pre-judging condition corresponding to the processing event.
The processor is configured to execute executable instructions stored in the memory.
It will be appreciated by those skilled in the art that the components of the apparatus and steps of the method provided in the embodiments of the present application described above may be centralized on a single computing device or distributed across a network of multiple computing devices. Alternatively, they may be implemented in program code executable by a computing device. Thus, they may be stored in a memory device for execution by a computing device, or they may be separately fabricated as individual integrated circuit modules, or multiple modules or steps thereof may be fabricated as a single integrated circuit module for implementation. Thus, the present application is not limited to any specific combination of hardware and software.
Although the embodiments disclosed in the present application are described above, the descriptions are only for the convenience of understanding the present application, and are not intended to limit the present application. It will be understood by those skilled in the art that various changes in form and details may be made therein without departing from the spirit and scope of the disclosure as defined by the appended claims.

Claims (13)

1. A method of implementing a simulation test, comprising:
hit the preset processing event;
executing the hit processing event according to the current test environment and the pre-judging condition corresponding to the processing event;
the prejudgment condition is used for determining whether the hit processing event meets the execution condition under the current test environment.
2. The method of claim 1, wherein the processing event comprises any combination of: a login event, a click event, an animation event, a scroll event, a fixed page event.
3. The method of claim 1, wherein the processing event is a login event; the pre-judging condition comprises the following steps: whether a page reference point exists in a page of the current testing environment or not is judged;
the executing the hit processing event according to the pre-judging condition corresponding to the current test environment and the processing event includes: a page reference point exists on the page where the current test environment is located; and clicking a page needing login to execute login.
4. The method of claim 1, wherein the processing event is a click event; the pre-judging condition comprises the following steps: whether a page reference point exists in a page of the current testing environment or not is judged;
the executing the hit processing event according to the pre-judging condition corresponding to the current test environment and the processing event includes: a page reference point exists on the page where the current test environment is located; and clicking a page needing login to execute login.
5. The method of claim 1, wherein the processing event is a fixed-area reinforcement event; the pre-judging condition comprises the following steps: whether a page of the current testing environment has a big picture mode or not;
the executing the hit processing event according to the pre-judging condition corresponding to the current test environment and the processing event includes: a big picture mode exists in the page where the current test environment is located; and clicking the large graph area, and executing the upper N-level page where the large graph mode is located, wherein N is an integer greater than or equal to 1.
6. The method of claim 1, wherein the processing event is an animation event; the pre-judging condition comprises the following steps: whether the animation in the current test environment falls in a preset first area or not;
the executing the hit processing event according to the pre-judging condition corresponding to the current test environment and the processing event includes: the animation in the current test environment falls into a preset first area; a test of an animation or gesture is triggered.
7. The method of claim 1, wherein the processing event is a scroll event; the pre-judging condition comprises the following steps: whether an interactive object needing to display the structured data exists in the current test environment or not;
the executing the hit processing event according to the pre-judging condition corresponding to the current test environment and the processing event includes: an interactive object needing to display the structured data exists in the current test environment; and circularly executing the pull-down page turning operation.
8. The method of claim 1, wherein the processing event is a FixedPage event; the pre-judging condition comprises the following steps: whether a page reference point exists in a page of the current testing environment or not is judged;
the executing the hit processing event according to the pre-judging condition corresponding to the current test environment and the processing event includes: a page reference point exists on the page where the current test environment is located; clicking a preset fixed menu.
9. The method of claim 1, wherein if the current test environment does not satisfy the predetermined condition corresponding to the processing event, the method further comprises:
and exiting the hit processing event and returning to continue executing the simulation test.
10. The method according to any one of claims 1 to 9, further comprising: hitting a page return event, and falling the random click operation in the simulation test into a preset interval range; wherein the content of the first and second substances,
the interval range is an area of the screen for returning to a previous page.
11. The device for realizing the simulation test is characterized by comprising a first processing module and a second processing module, wherein,
the first processing module is used for executing the simulation test and informing the second processing module when a preset processing event is hit;
the second processing module is used for executing the hit processing event according to the current test environment and the prejudgment condition corresponding to the processing event;
the prejudgment condition is used for determining whether the hit processing event meets the execution condition under the current test environment.
12. The apparatus of claim 11, wherein when the processing event is a login event or a click event, the anticipation condition comprises: whether a page reference point exists in a page of the current testing environment or not is judged;
the second processing module is specifically configured to: judging that a page reference point exists in the page of the current test environment; clicking a page needing login and executing login;
when the processing event is a fixed area strengthening event, the pre-judging condition includes: whether a page of the current testing environment has a big picture mode or not;
the second processing module is specifically configured to: judging that a page in which the current test environment is located has a big picture mode; clicking the large graph area, and executing the upper N-level page where the large graph mode is located, wherein N is an integer greater than or equal to 1;
when the processing event is an animation event, the prejudging condition comprises: whether the animation in the current test environment falls in a preset first area or not;
the second processing module is specifically configured to: judging whether the animation in the current test environment falls into a preset first area, and triggering the test of the animation or the gesture;
when the processing event is a scroll event, the pre-judging condition includes: whether an interactive object needing to display the structured data exists in the current test environment or not;
the second processing module is specifically configured to: judging that an interactive object needing to display the structured data exists in the current test environment; circularly executing the pull-down page turning operation;
when the processing event is a fixed page event, the pre-judging condition includes: whether a page reference point exists in a page of the current testing environment or not is judged;
the second processing module is specifically configured to: judging that a page reference point exists in a page where the current test environment is located; clicking a preset fixed menu.
13. The apparatus of claim 11, wherein the second processing module is further configured to: judging that the current test environment does not meet the pre-judgment condition corresponding to the processing event, exiting the hit processing event and informing the first processing module to continue executing the simulation test.
CN201610511181.3A 2016-06-30 2016-06-30 Method and device for realizing simulation test Active CN107562611B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610511181.3A CN107562611B (en) 2016-06-30 2016-06-30 Method and device for realizing simulation test

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610511181.3A CN107562611B (en) 2016-06-30 2016-06-30 Method and device for realizing simulation test

Publications (2)

Publication Number Publication Date
CN107562611A CN107562611A (en) 2018-01-09
CN107562611B true CN107562611B (en) 2021-07-06

Family

ID=60968541

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610511181.3A Active CN107562611B (en) 2016-06-30 2016-06-30 Method and device for realizing simulation test

Country Status (1)

Country Link
CN (1) CN107562611B (en)

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102681832B (en) * 2011-03-17 2017-02-08 新奥特(北京)视频技术有限公司 Extensible markup language (XML) based interaction method and interaction device
CN102902458A (en) * 2011-07-25 2013-01-30 康佳集团股份有限公司 Page turning method for E-books
CN103019923B (en) * 2011-09-22 2015-10-21 腾讯科技(深圳)有限公司 The method and system of simulation hit testing
CN102681935A (en) * 2012-04-21 2012-09-19 北京迈凯互动网络科技有限公司 Mobile application testing method and mobile application testing system
CN104978266B (en) * 2014-04-11 2019-01-01 腾讯科技(深圳)有限公司 A kind of application testing method and device
CN105512023B (en) * 2014-09-26 2019-02-19 腾讯科技(深圳)有限公司 A kind of Monkey test method and device

Also Published As

Publication number Publication date
CN107562611A (en) 2018-01-09

Similar Documents

Publication Publication Date Title
KR102323333B1 (en) Application data processing method and apparatus, and storage medium
US9756140B2 (en) Tracking user behavior relative to a network page
WO2015039566A1 (en) Method and system for facilitating automated web page testing
US20210397535A1 (en) Automated Determination of Web Page Rendering Performance
CN110764986B (en) Page fluency detection method and device
CN109901881B (en) Plug-in loading method and device of application program, computer equipment and storage medium
CN107608609B (en) Event object sending method and device
CN109684573B (en) Target picture display method and device, storage medium and electronic equipment
CN111143200A (en) Method and device for recording and playing back touch event, storage medium and equipment
CN105279431B (en) Method, device and system for recording operation information in mobile equipment
US20200136988A1 (en) Resource optimization and update method, server, and device
EP4121877A1 (en) Detection of high-risk blobs based on an analysis of associated graphical elements
CN107391534B (en) Page display method, page file return method, page display device, page file return device and computer storage medium
CN111639018B (en) Memory leakage detection method and device
CN104809054A (en) Method and system for realizing program testing
CN110781427A (en) Method, device, equipment and storage medium for calculating first screen time
CN107250979B (en) Application event tracking
CN106708705B (en) Terminal background process monitoring method and system
CN107562611B (en) Method and device for realizing simulation test
CN110708270B (en) Abnormal link detection method and device
WO2015039585A1 (en) Method and device for testing software reliability
CN108268298B (en) Desktop icon generation method and device, storage medium and electronic equipment
CN110968513B (en) Recording method and device of test script
WO2019153986A1 (en) Application display method, application, storage medium, and electronic device
CN113010416A (en) Bank counter transaction automatic testing method and device

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