Spy Popup-Control
There is one type of control that you don't know how to spy during the spying process - popup controls (also called derived controls), such as menu bars, right-click menus, dropdown boxes, popup alert messages. Because these controls usually need to be clicked before they appear and will disappear once the mouse is clicked elsewhere.
When the control you want to add is not directly visible on the interface and needs to be displayed after several clicks, you can do it in several ways as follows
- Hold down the
Ctrl
key during spy to revert to normal clicks, and release theCtrl
key after completing the click to spy. Details Click to view. - Use the "delay execution" function to delay the spy state. For details, click View.
Use Ctrl key to spy pop-up/derived controls
During the spying process, you can temporarily revert to normal click when you hold down the CTRL
key and click the mouse. That means this click will not trigger the pickup behavior of the object.
So for the above problem, the solution can be to hold down the Ctrl key to finish the first few clicks, and finally when the control you need to add appears, release Ctrl and click the left mouse button to add it.
Here is an example of Menu control, when identifying a menu item control in a pop-up menu:
- Click the
Spy
button to start spying. - Hold down the
CTRL
key and click on the menu bar to expand the menu. - Release the
CTRL
key and click on the target item to complete the recognition.You can hold down the left mouse button when clicking the target item until the spy window pops up, so that the whole menu item can be recognized. Otherwise, sometimes it may cause errors because the menu is collapsed during recognition.
Using the "delayed execution" function
The "Delay Execution" button on the Model Manager toolbar! button on the Model Manager toolbar allows you to delay the execution of a subsequent operation.
You can.
- Click the "Delay Execute" button, which will highlight several buttons on the toolbar, indicating that they will have a delayed execution effect when clicked.
- Click on one of the "Spy Objects" buttons. The countdown will start.
- Before the countdown ends, click on the application under test to make the target control appear on the interface. For example, expand the pop-up menu.
- After the countdown is over, the actual detection starts and the target control can be picked up by clicking on it.