public class GuiTestObject extends TestObject implements IFocusable, INativeWindow, IClickable, IKeyable
| 修飾子 | コンストラクタと説明 |
|---|---|
protected |
GuiTestObject(JtfObjectHandle handle,
Desktop desktop)
JtfObjectHandle を持つ新しい GuiTestObject を作成します。
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
void |
click()
オブジェクトをクリックします。
|
void |
click(int button)
オブジェクトをクリックします。
|
void |
click(int button,
Point pos)
オブジェクトをクリックします。
|
void |
click(int button,
Point pos,
ModifierKey modifiers)
オブジェクトをクリックします。
|
void |
doubleClick()
マウス ボタンをオブジェクト上でダブルクリックします。
|
void |
doubleClick(int button)
マウス ボタンをオブジェクト上でダブルクリックします。
|
void |
doubleClick(int button,
Point pos)
マウス ボタンをオブジェクト上でダブルクリックします。
|
void |
doubleClick(int button,
Point pos,
ModifierKey modifiers)
マウス ボタンをオブジェクト上でダブルクリックします。
|
Color |
getBackground()
[読み取り専用] GUI オブジェクトの背景色。
|
String |
getFont()
[読み取り専用] GUI オブジェクトのフォントの種類。
|
Color |
getForeground()
[読み取り専用] GUI オブジェクトの前景色。
|
int |
getNativeHandle()
[読み取り専用] オブジェクトのネイティブ ウィンドウ ハンドル。
|
boolean |
isEnabled()
[読み取り専用] GUI オブジェクトが有効かどうか。
|
boolean |
isFocused()
コントロールがフォーカスを持つかどうかを返します。
|
boolean |
isVisible()
[読み取り専用] オブジェクトが表示されるかどうかを指定します。
|
void |
mouseMove()
オブジェクト上の指定した場所にポインターを移動します。
|
void |
mouseMove(Point pos)
オブジェクト上の指定した場所にポインターを移動します。
|
void |
pressKeys(String keys)
一連のキーまたはマウス ボタンを押します(離しません)。
|
void |
pressKeys(String keys,
boolean ensureFocus)
一連のキーまたはマウス ボタンを押します(離しません)。
|
void |
pressMouse()
オブジェクト上でマウス ボタンを押します(離しません)。
|
void |
pressMouse(int button)
オブジェクト上でマウス ボタンを押します(離しません)。
|
void |
pressMouse(int button,
Point pos)
オブジェクト上でマウス ボタンを押します(離しません)。
|
void |
pressMouse(int button,
Point pos,
ModifierKey modifiers)
オブジェクト上でマウス ボタンを押します(離しません)。
|
void |
releaseKeys(String keys)
一連のキーまたはマウス ボタンを離します。
|
void |
releaseKeys(String keys,
boolean ensureFocus)
一連のキーまたはマウス ボタンを離します。
|
void |
releaseMouse()
マウス ボタンを離します。
|
void |
releaseMouse(int button)
マウス ボタンを離します。
|
void |
releaseMouse(int button,
Point pos)
マウス ボタンを離します。
|
void |
releaseMouse(int button,
Point pos,
ModifierKey modifiers)
マウス ボタンを離します。
|
void |
setBackground(Color background)
[書き込み専用] GUI オブジェクトの背景色。
|
void |
setEnabled(boolean enabled)
[書き込み専用] GUI オブジェクトが有効かどうか。
|
void |
setFocus()
コントロールにフォーカスを与えます。
|
void |
setFont(String font)
[書き込み専用] GUI オブジェクトのフォントの種類。
|
void |
setForeground(Color foreground)
[書き込み専用] GUI オブジェクトの前景色。
|
void |
setVisible(boolean visible)
[書き込み専用] オブジェクトが表示されるかどうかを指定します。
|
void |
typeKeys(String keys)
一連のキーストロークをオブジェクトに送信します。
|
void |
typeKeys(String keys,
int delay)
一連のキーストロークをオブジェクトに送信します。
|
void |
typeKeys(String keys,
int delay,
boolean ensureFocus)
一連のキーストロークをオブジェクトに送信します。
|
void |
typePasswordKeys(String keys)
暗号化されたパスワードをテキスト フィールドなどのオブジェクトに入力します。
|
void |
typePasswordKeys(String keys,
int delay)
暗号化されたパスワードをテキスト フィールドなどのオブジェクトに入力します。
|
void |
typePasswordKeys(String keys,
int delay,
boolean ensureFocus)
暗号化されたパスワードをテキスト フィールドなどのオブジェクトに入力します。
|
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, waitForPropertyequals, 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, toStringprotected GuiTestObject(JtfObjectHandle handle, Desktop desktop)
handle - GuiTestObject を識別するハンドルdesktop - このオブジェクトが存在するデスクトップpublic void click()
使用例
たとえば、コントロール内のある位置をクリックする場合は、次のように入力します。
control.click (MouseButton.LEFT, new Point(244, 16));
次の例では、コントロールの中央でマウスの左ボタンがクリックされます。
control.click ();
click インタフェース内 IClickablepublic void click(int button)
使用例
たとえば、コントロール内のある位置をクリックする場合は、次のように入力します。
control.click (MouseButton.LEFT, new Point(244, 16));
次の例では、コントロールの中央でマウスの左ボタンがクリックされます。
control.click ();
click インタフェース内 IClickablebutton - 押下するマウス ボタン。 値は、1=左、2=右、3=中央,.. になります。public void click(int button,
Point pos)
使用例
たとえば、コントロール内のある位置をクリックする場合は、次のように入力します。
control.click (MouseButton.LEFT, new Point(244, 16));
次の例では、コントロールの中央でマウスの左ボタンがクリックされます。
control.click ();
click インタフェース内 IClickablebutton - 押下するマウス ボタン。 値は、1=左、2=右、3=中央,.. になります。pos - クリックする座標(オブジェクトに相対)public void click(int button,
Point pos,
ModifierKey modifiers)
使用例
たとえば、コントロール内のある位置をクリックする場合は、次のように入力します。
control.click (MouseButton.LEFT, new Point(244, 16));
次の例では、コントロールの中央でマウスの左ボタンがクリックされます。
control.click ();
click インタフェース内 IClickablebutton - 押下するマウス ボタン。 値は、1=左、2=右、3=中央,.. になります。pos - クリックする座標(オブジェクトに相対)modifiers - 修飾キーpublic void doubleClick()
doubleClick インタフェース内 IClickablepublic void doubleClick(int button)
doubleClick インタフェース内 IClickablebutton - 押下するマウス ボタン。 値は、1=左、2=右、3=中央,.. になります。public void doubleClick(int button,
Point pos)
doubleClick インタフェース内 IClickablebutton - 押下するマウス ボタン。 値は、1=左、2=右、3=中央,.. になります。pos - クリックする座標(オブジェクトに相対)public void doubleClick(int button,
Point pos,
ModifierKey modifiers)
doubleClick インタフェース内 IClickablebutton - 押下するマウス ボタン。 値は、1=左、2=右、3=中央,.. になります。pos - クリックする座標(オブジェクトに相対)modifiers - 修飾キーpublic boolean isFocused()
isFocused インタフェース内 IFocusablepublic void mouseMove()
mouseMove インタフェース内 IClickablepublic void mouseMove(Point pos)
mouseMove インタフェース内 IClickablepos - 新しいロケーションの座標(ウィンドウに相対)public void pressKeys(String keys)
有効なキーストロークは次のとおりです。
public void pressKeys(String keys, boolean ensureFocus)
有効なキーストロークは次のとおりです。
public void pressMouse()
pressMouse インタフェース内 IClickablepublic void pressMouse(int button)
pressMouse インタフェース内 IClickablebutton - 押下するマウス ボタン。 値は、1=左、2=右、3=中央,.. になります。public void pressMouse(int button,
Point pos)
pressMouse インタフェース内 IClickablebutton - 押下するマウス ボタン。 値は、1=左、2=右、3=中央,.. になります。pos - マウスを押下する座標(オブジェクトに相対)public void pressMouse(int button,
Point pos,
ModifierKey modifiers)
pressMouse インタフェース内 IClickablebutton - 押下するマウス ボタン。 値は、1=左、2=右、3=中央,.. になります。pos - マウスを押下する座標(オブジェクトに相対)modifiers - 修飾キーpublic void releaseKeys(String keys)
有効なキーストロークは次のとおりです。
releaseKeys インタフェース内 IKeyablekeys - 離すキー、またはマウス ボタンpublic void releaseKeys(String keys, boolean ensureFocus)
有効なキーストロークは次のとおりです。
releaseKeys インタフェース内 IKeyablekeys - 離すキー、またはマウス ボタンensureFocus - コントロールが実際にキーボード フォーカスを持つことを保証するかどうかを決定します。 デフォルトは true です。public void releaseMouse()
releaseMouse インタフェース内 IClickablepublic void releaseMouse(int button)
releaseMouse インタフェース内 IClickablebutton - 押下するマウス ボタン。 値は、1=左、2=右、3=中央,.. になります。public void releaseMouse(int button,
Point pos)
releaseMouse インタフェース内 IClickablebutton - 押下するマウス ボタン。 値は、1=左、2=右、3=中央,.. になります。pos - マウスを離す座標(オブジェクトに相対)public void releaseMouse(int button,
Point pos,
ModifierKey modifiers)
releaseMouse インタフェース内 IClickablebutton - 押下するマウス ボタン。 値は、1=左、2=右、3=中央,.. になります。pos - マウスを離す座標(オブジェクトに相対)modifiers - 修飾キーpublic void setFocus()
setFocus インタフェース内 IFocusablepublic void typeKeys(String keys)
有効なキーストロークは次のとおりです。
使用例たとえば、現在選択されているテキストを Ctrl+C を押してクリップボードにコピーするコードは次のようになります。
window.typeKeys ("<Left Ctrl+C>");
public void typeKeys(String keys, int delay)
有効なキーストロークは次のとおりです。
使用例たとえば、現在選択されているテキストを Ctrl+C を押してクリップボードにコピーするコードは次のようになります。
window.typeKeys ("<Left Ctrl+C>");
public void typeKeys(String keys, int delay, boolean ensureFocus)
有効なキーストロークは次のとおりです。
使用例たとえば、現在選択されているテキストを Ctrl+C を押してクリップボードにコピーするコードは次のようになります。
window.typeKeys ("<Left Ctrl+C>");
public void typePasswordKeys(String keys)
オブジェクトが SetText メソッドをサポートする場合、暗号化されたパスワードを入力する前に、既存のテキストはクリアされます。
使用例
使用例
たとえば、文字列を暗号化し、コンソールに出力する場合は、次のコードを使用できます。
String encryptedPassword = desktop.encrypt("my password");
System.out.println(encryptedPassword);
そして、コンソールから暗号化したパスワード (この場合は、6Fk+Bcm+GoXe3X0=) をコピーし、次のように使用できます。
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys インタフェース内 IKeyablekeys - 暗号化されたパスワードpublic void typePasswordKeys(String keys, int delay)
オブジェクトが SetText メソッドをサポートする場合、暗号化されたパスワードを入力する前に、既存のテキストはクリアされます。
使用例
使用例
たとえば、文字列を暗号化し、コンソールに出力する場合は、次のコードを使用できます。
String encryptedPassword = desktop.encrypt("my password");
System.out.println(encryptedPassword);
そして、コンソールから暗号化したパスワード (この場合は、6Fk+Bcm+GoXe3X0=) をコピーし、次のように使用できます。
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys インタフェース内 IKeyablekeys - 暗号化されたパスワードdelay - キーストローク間の遅延(ミリ秒)public void typePasswordKeys(String keys, int delay, boolean ensureFocus)
オブジェクトが SetText メソッドをサポートする場合、暗号化されたパスワードを入力する前に、既存のテキストはクリアされます。
使用例
使用例
たとえば、文字列を暗号化し、コンソールに出力する場合は、次のコードを使用できます。
String encryptedPassword = desktop.encrypt("my password");
System.out.println(encryptedPassword);
そして、コンソールから暗号化したパスワード (この場合は、6Fk+Bcm+GoXe3X0=) をコピーし、次のように使用できます。
textField.typePasswordKeys("6Fk+Bcm+GoXe3X0=");
typePasswordKeys インタフェース内 IKeyablekeys - 暗号化されたパスワードdelay - キーストローク間の遅延(ミリ秒)ensureFocus - コントロールが実際にキーボード フォーカスを持つことを保証するかどうかを決定します。 デフォルトは true です。public Color getBackground()
public void setBackground(Color background)
background - GUI オブジェクトの背景色public boolean isEnabled()
public void setEnabled(boolean enabled)
enabled - GUI オブジェクトが有効かどうかpublic String getFont()
public void setFont(String font)
font - GUI オブジェクトのフォントの種類public Color getForeground()
public void setForeground(Color foreground)
foreground - GUI オブジェクトの前景色public int getNativeHandle()
getNativeHandle インタフェース内 INativeWindowpublic boolean isVisible()
true です。 ただし、テスト対象アプリケーションですでに検索したオブジェクトが再生中に非表示になった場合に、このプロパティが必要になる場合があります。public void setVisible(boolean visible)
true です。 ただし、テスト対象アプリケーションですでに検索したオブジェクトが再生中に非表示になった場合に、このプロパティが必要になる場合があります。visible - オブジェクトが表示されるかどうかを指定します。 表示可能なオブジェクトのみ検索できます。デフォルトでは値は常に true です。 ただし、テスト対象アプリケーションですでに検索したオブジェクトが再生中に非表示になった場合に、このプロパティが必要になる場合があります。Copyright 2009-2012 Micro Focus. All Rights Reserved.