Apart from SendKeys option, DeviceReplay is another alternative way to take control on objects which are not getting recognized.
The Device Replay feature is used to perform mouse and keyboard actions against screen coordinates that are provided. The Device Replay functions are not automatically recorded, but must be programmed manually in the Expert View.
1. Create the Device Replay Object.
Example:
Set DeviceReplay = CreateObject(“Mercury.DeviceReplay”)
2. Call the desired Device Replay function.
Example:
DeviceReplay.SendString(“Hello, Automation Testing World”)
3. When done with the Device Replay object, release it.
Example:
Set DeviceReplay = Nothing
The functions that can be used with the Device Replay object are (all coordinates are relative to the top left corner of the screen)
The functions that can be used with the Device Replay object are (all coordinates are relative to the top left corner of the screen):
The Device Replay feature is used to perform mouse and keyboard actions against screen coordinates that are provided. The Device Replay functions are not automatically recorded, but must be programmed manually in the Expert View.
1. Create the Device Replay Object.
Example:
Set DeviceReplay = CreateObject(“Mercury.DeviceReplay”)
2. Call the desired Device Replay function.
Example:
DeviceReplay.SendString(“Hello, Automation Testing World”)
3. When done with the Device Replay object, release it.
Example:
Set DeviceReplay = Nothing
The functions that can be used with the Device Replay object are (all coordinates are relative to the top left corner of the screen)
The functions that can be used with the Device Replay object are (all coordinates are relative to the top left corner of the screen):
Function | Description |
MouseMove x, y | Move the mouse to the screen coordinate (x,y). |
MouseClick x, y, button | Move the mouse to the screen coordinate (x,y) and click the button (0=left; 1=middle; 2=right). |
MouseDblClick x, y, button | Move the mouse to the screen coordinate (x,y) and double-click the button (0=left; 1=middle; 2=right). |
DragAndDrop x, y, dropx, dropy, button | Drag the mouse from screen coordinate (x,y) to (dropx,dropy) with the button (0=left; 1=middle; 2=right) pressed. |
PressKey key | Press a key using the ASCII code of the key. For example, Chr(13), vbCR and vbTab. |
MouseDown x, y, button | Press the mouse button on screen coordinate (x,y). |
MouseUp x, y, button | Release the mouse button on screen coordinate (x,y). |
KeyDown key | Press a key using the ASCII code of the key. For example, Chr(13), vbCR and vbTab. |
KeyUp key | Release a key using the ASCII code of the key. For example, Chr(13), vbCR and vbTab. |
SendString string | Type a string. |
No comments:
Post a Comment