public class RumbaObject extends TestObject implements IFocusable, IClickable, IKeyable
Modifier | Constructor and Description |
---|---|
protected |
RumbaObject(JtfObjectHandle handle,
Desktop desktop)
Creates a new RumbaObject with a JtfObjectHandle.
|
Modifier and Type | Method and Description |
---|---|
void |
click()
Clicks on the object.
|
void |
click(int button)
Clicks on the object.
|
void |
click(int button,
Point pos)
Clicks on the object.
|
void |
click(int button,
Point pos,
ModifierKey modifiers)
Clicks on the object.
|
void |
doubleClick()
Double-clicks a mouse button on the object.
|
void |
doubleClick(int button)
Double-clicks a mouse button on the object.
|
void |
doubleClick(int button,
Point pos)
Double-clicks a mouse button on the object.
|
void |
doubleClick(int button,
Point pos,
ModifierKey modifiers)
Double-clicks a mouse button on the object.
|
boolean |
isFocused()
Return whether the control has focus.
|
void |
mouseMove()
Moves the pointer to the specified location in the object.
|
void |
mouseMove(Point pos)
Moves the pointer to the specified location in the object.
|
void |
pressKeys(String keys)
Presses (but does not release) a set of keys or mouse buttons.
|
void |
pressKeys(String keys,
boolean ensureFocus)
Presses (but does not release) a set of keys or mouse buttons.
|
void |
pressMouse()
Presses (but does not release) a mouse button in the object.
|
void |
pressMouse(int button)
Presses (but does not release) a mouse button in the object.
|
void |
pressMouse(int button,
Point pos)
Presses (but does not release) a mouse button in the object.
|
void |
pressMouse(int button,
Point pos,
ModifierKey modifiers)
Presses (but does not release) a mouse button in the object.
|
void |
releaseKeys(String keys)
Releases a set of keys or mouse buttons.
|
void |
releaseKeys(String keys,
boolean ensureFocus)
Releases a set of keys or mouse buttons.
|
void |
releaseMouse()
Releases a mouse button.
|
void |
releaseMouse(int button)
Releases a mouse button.
|
void |
releaseMouse(int button,
Point pos)
Releases a mouse button.
|
void |
releaseMouse(int button,
Point pos,
ModifierKey modifiers)
Releases a mouse button.
|
void |
sendKeys(String keys)
Sends keys.
|
void |
setFocus()
Gives focus to the control.
|
void |
synchSendKeys(String keys)
Synchronously sends keys.
|
void |
synchSendKeys(String keys,
int screenUpdateWaitCount)
Synchronously sends keys.
|
void |
synchSendKeys(String keys,
int screenUpdateWaitCount,
int timeout)
Synchronously sends keys.
|
void |
typeKeys(String keys)
Sends a set of keystrokes to the object.
|
void |
typeKeys(String keys,
int delay)
Sends a set of keystrokes to the object.
|
void |
typeKeys(String keys,
int delay,
boolean ensureFocus)
Sends a set of keystrokes to the object.
|
void |
typePasswordKeys(String keys)
Types an encrypted password into an object, for example a text field.
|
void |
typePasswordKeys(String keys,
int delay)
Types an encrypted password into an object, for example a text field.
|
void |
typePasswordKeys(String keys,
int delay,
boolean ensureFocus)
Types an encrypted password into an object, for example a text field.
|
captureBitmap, captureBitmap, exists, exists, generateLocator, getChildren, getDynamicMethodList, getParent, getPropertyList, getRect, getRect, getText, getValue, highlightObject, highlightObject, highlightObject, invokeMethods, textCapture, textCapture, textClick, textClick, textClick, textClick, textClick, textClick, textExists, textExists, textExists, textExists, textExists, textRectangle, textRectangle, textRectangle, textRectangle, textRectangle, waitForChildDisappearance, waitForChildDisappearance, waitForDisappearance, waitForDisappearance, waitForObject, waitForObject, waitForProperty, waitForProperty
equals, exists, find, find, findAll, findAll, getCustomTypeName, getDesktop, getHandle, getLocator, getProperty, getTypeName, hashCode, imageClick, imageClick, imageClick, imageClick, imageClick, imageClick, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageClickFile, imageExists, imageExists, imageExists, imageExistsFile, imageExistsFile, imageExistsFile, imageRectangle, imageRectangle, imageRectangle, imageRectangleFile, imageRectangleFile, imageRectangleFile, invoke, preventFinalLocator, setProperty, toString
protected RumbaObject(JtfObjectHandle handle, Desktop desktop)
handle
- the handle that identifies the RumbaObjectdesktop
- the desktop on which this object livespublic void click()
Sample Usage
For example, in order to click on a certain position within a control, type the following:
control.click (MouseButton.LEFT, new Point(244, 16));
The following example uses the left mouse button to click in the center of the control:
control.click ();
click
in interface IClickable
public void click(int button)
Sample Usage
For example, in order to click on a certain position within a control, type the following:
control.click (MouseButton.LEFT, new Point(244, 16));
The following example uses the left mouse button to click in the center of the control:
control.click ();
click
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...public void click(int button, Point pos)
Sample Usage
For example, in order to click on a certain position within a control, type the following:
control.click (MouseButton.LEFT, new Point(244, 16));
The following example uses the left mouse button to click in the center of the control:
control.click ();
click
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to clickpublic void click(int button, Point pos, ModifierKey modifiers)
Sample Usage
For example, in order to click on a certain position within a control, type the following:
control.click (MouseButton.LEFT, new Point(244, 16));
The following example uses the left mouse button to click in the center of the control:
control.click ();
click
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to clickmodifiers
- the modifierpublic void doubleClick()
doubleClick
in interface IClickable
public void doubleClick(int button)
doubleClick
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...public void doubleClick(int button, Point pos)
doubleClick
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to clickpublic void doubleClick(int button, Point pos, ModifierKey modifiers)
doubleClick
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to clickmodifiers
- the modifierpublic boolean isFocused()
isFocused
in interface IFocusable
public void mouseMove()
mouseMove
in interface IClickable
public void mouseMove(Point pos)
mouseMove
in interface IClickable
pos
- the coordinates (relative to the window) of the new locationpublic void pressKeys(String keys)
Valid keystrokes include:
public void pressKeys(String keys, boolean ensureFocus)
Valid keystrokes include:
public void pressMouse()
pressMouse
in interface IClickable
public void pressMouse(int button)
pressMouse
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...public void pressMouse(int button, Point pos)
pressMouse
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to press the mousepublic void pressMouse(int button, Point pos, ModifierKey modifiers)
pressMouse
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to press the mousemodifiers
- the modifierpublic void releaseKeys(String keys)
Valid keystrokes include:
releaseKeys
in interface IKeyable
keys
- the keys or mouse buttons to releasepublic void releaseKeys(String keys, boolean ensureFocus)
Valid keystrokes include:
releaseKeys
in interface IKeyable
keys
- the keys or mouse buttons to releaseensureFocus
- determines whether it should be ensured that the control actually has the keyboard focus. Defaults to true
public void releaseMouse()
releaseMouse
in interface IClickable
public void releaseMouse(int button)
releaseMouse
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...public void releaseMouse(int button, Point pos)
releaseMouse
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to release the mousepublic void releaseMouse(int button, Point pos, ModifierKey modifiers)
releaseMouse
in interface IClickable
button
- the mouse button to press. Values include: 1=left, 2=right,3=center,...pos
- the coordinates (relative to the object) at which to release the mousemodifiers
- the modifierpublic void sendKeys(String keys)
Sample Usage The line
is equivalent torumbaScreen.sendKeys (RumbaKey.TAB );
RumbaKey constants can be combined with regular strings:rumbaScreen.sendKeys ("@T");
For all available constants see the class RumbaKey.rumbaScreen.sendKeys ("someone" +RumbaKey.AT + "example.com");
keys
- the keys to send. The Rumba keyboard mnemonics can be used in this string. For additional information about the Rumba keyboard mnemonics, refer to the RDE .NET Help.public void setFocus()
setFocus
in interface IFocusable
public void synchSendKeys(String keys)
Sample Usage The line
is equivalent torumbaScreen.synchSendKeys (RumbaKey.PF3 );
RumbaKey constants can be combined with regular strings:rumbaScreen.synchSendKeys ("@3");
For all available constants see the class RumbaKey.rumbaScreen.synchSendKeys ("someone" +RumbaKey.AT + "example.com" +RumbaKey.ENTER );
keys
- the keys to send. The Rumba keyboard mnemonics can be used in this string. For additional information about the Rumba keyboard mnemonics, refer to the RDE .NET Help.public void synchSendKeys(String keys, int screenUpdateWaitCount)
Sample Usage The line
is equivalent torumbaScreen.synchSendKeys (RumbaKey.PF3 );
RumbaKey constants can be combined with regular strings:rumbaScreen.synchSendKeys ("@3");
For all available constants see the class RumbaKey.rumbaScreen.synchSendKeys ("someone" +RumbaKey.AT + "example.com" +RumbaKey.ENTER );
keys
- the keys to send. The Rumba keyboard mnemonics can be used in this string. For additional information about the Rumba keyboard mnemonics, refer to the RDE .NET Help.screenUpdateWaitCount
- the number of screen updates that need to be awaited until the new screen is ready for further interactionpublic void synchSendKeys(String keys, int screenUpdateWaitCount, int timeout)
Sample Usage The line
is equivalent torumbaScreen.synchSendKeys (RumbaKey.PF3 );
RumbaKey constants can be combined with regular strings:rumbaScreen.synchSendKeys ("@3");
For all available constants see the class RumbaKey.rumbaScreen.synchSendKeys ("someone" +RumbaKey.AT + "example.com" +RumbaKey.ENTER );
keys
- the keys to send. The Rumba keyboard mnemonics can be used in this string. For additional information about the Rumba keyboard mnemonics, refer to the RDE .NET Help.screenUpdateWaitCount
- the number of screen updates that need to be awaited until the new screen is ready for further interactiontimeout
- the timeout in milliseconds. If set to 0, the Rumba APIs default timeout (currently 10000ms) is used.public void typeKeys(String keys)
Valid keystrokes include:
Sample UsageFor example, the following code copies the currently selected text into the clipboard by pressing Ctrl+C:
window.typeKeys ("<Left Ctrl+C>");
public void typeKeys(String keys, int delay)
Valid keystrokes include:
Sample UsageFor example, the following code copies the currently selected text into the clipboard by pressing Ctrl+C:
window.typeKeys ("<Left Ctrl+C>");
public void typeKeys(String keys, int delay, boolean ensureFocus)
Valid keystrokes include:
Sample UsageFor example, the following code copies the currently selected text into the clipboard by pressing Ctrl+C:
window.typeKeys ("<Left Ctrl+C>");
public void typePasswordKeys(String keys)
If the object supports the SetText method, any existing text is cleared before typing the encrypted password.
Sample Usage
Sample Usage
For example, the following code encrypts a string and prints it to the console:
String encryptedPassword = desktop.encrypt("my password"); System.out.println(encryptedPassword);
You can then copy the encrypted password from the console, in this case 6Fk+Bcm+GoXe3X0=
, and use it as follows:
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys
in interface IKeyable
keys
- the encrypted passwordpublic void typePasswordKeys(String keys, int delay)
If the object supports the SetText method, any existing text is cleared before typing the encrypted password.
Sample Usage
Sample Usage
For example, the following code encrypts a string and prints it to the console:
String encryptedPassword = desktop.encrypt("my password"); System.out.println(encryptedPassword);
You can then copy the encrypted password from the console, in this case 6Fk+Bcm+GoXe3X0=
, and use it as follows:
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys
in interface IKeyable
keys
- the encrypted passworddelay
- the delay between keystrokes in millisecondspublic void typePasswordKeys(String keys, int delay, boolean ensureFocus)
If the object supports the SetText method, any existing text is cleared before typing the encrypted password.
Sample Usage
Sample Usage
For example, the following code encrypts a string and prints it to the console:
String encryptedPassword = desktop.encrypt("my password"); System.out.println(encryptedPassword);
You can then copy the encrypted password from the console, in this case 6Fk+Bcm+GoXe3X0=
, and use it as follows:
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys
in interface IKeyable
keys
- the encrypted passworddelay
- the delay between keystrokes in millisecondsensureFocus
- determines whether it should be ensured that the control actually has the keyboard focus. Defaults to true
Copyright 2009-2012 Micro Focus. All Rights Reserved.