IBM Rational Functional Tester
Version 8.1.1000
IBM Rational Functional Tester API Reference

Project Version 2.3

com.rational.test.ft.object.interfaces
Interface IScreen

All Superinterfaces:
IGraphical

public interface IScreen
extends IGraphical

Provides simple access to a Screen object. This interface is part of the native-window management system; any use of this interface is likely to be platform specific. IWindow is a wrapper that abstract the common underlying platform methods.

Since:
RFT6.1.1.1
See Also:
RootTestObject.getScreen(), IWindow

Method Summary
 IWindow getActiveWindow()
          Returns the current active window.
 java.awt.Point getMousePosition()
          Returns the current screen location of the mouse pointer.
 void inputChars(java.lang.String characters)
          Sends the characters to the current active window
 void inputKeys(java.lang.String keys)
          Sends the key events to the current active window.
 IWindow windowFromHandle(long handle)
          Returns a window object when given a native window handle.
 IWindow windowFromPoint(java.awt.Point point)
          Returns a IWindow object at the given screen point.
 
Methods inherited from interface com.rational.test.ft.object.interfaces.IGraphical
click, click, click, click, doubleClick, doubleClick, doubleClick, doubleClick, drag, drag, drag, drag, dragToScreenPoint, dragToScreenPoint, dragToScreenPoint, getChildAtPoint, getClippedScreenRectangle, getScreenPoint, getScreenPoint, getScreenRectangle, hasFocus, hover, hover, hover, hover, isEnabled, isOpaque, isPointInObject, isShowing, mouseMove, mouseMove, nClick, nClickDrag, nClickDragToScreenPoint
 

Method Detail

windowFromHandle

IWindow windowFromHandle(long handle)
Returns a window object when given a native window handle.

Parameters:
handle - The handle for the object
Returns:
IWindow the IWindow object for the handle
Detail description:
Given the handle, returns an IWindow object
Example:
Given the handle, return the equivalent IWindow


long handle = 262476; //Handle for a window

IScreen scr = getRootTestObject().getScreen();

IWindow win =scr.getwindowFromHandle(handle);

Since:
RFT6.1.1.1

windowFromPoint

IWindow windowFromPoint(java.awt.Point point)
Returns a IWindow object at the given screen point.

Parameters:
point - java.awt.Point The point on the screen
Returns:
IWindow The IWindow for the given point. The child's IWindow is given instead of the parent's IWindow
Detail description:
Return a IWindow object when given a point. If the screen point is on a child window, the child, not the parent, is returned.
Example:
Get the IWindow object located at the screen point 10,10.


java.awt.Point pt = new java.awt.Point(10,10);

IScreen scr = getRootTestObject().getScreen();

IWindow win =scr.windowFromPoint(pt);

Since:
RFT6.1.1.1

getActiveWindow

IWindow getActiveWindow()
Returns the current active window.

Returns:
IWindow
Detail description:
Provides access to the current active visible IWindow in the screen. The API can come to help in cases when the dialogs are not recognized.
Example:
Get the rectangle of the current active window
IScreen scr = getRootTestObject().getScreen();

IWindow win =scr.getActiveWindow();

java.awt.Rectangle rect = win.getScreenRectangle();
Since:
RFT6.1.1.1

getMousePosition

java.awt.Point getMousePosition()
Returns the current screen location of the mouse pointer.

Returns:
java.awt.Point The current location of the cursor in the screen.
Detail description:
Use the method to gain access to current cursor location in the screen.
Example:
Get the current cursor location in the screen
IScreen scr = getRootTestObject().getScreen();

java.awt.Point screenPt =scr.getMousePosition;
Since:
RFT6.1.1.1

inputKeys

void inputKeys(java.lang.String keys)
Sends the key events to the current active window.

Parameters:
keys - java.lang.String The keys to be sent to the current active window
Detail description:
In addition to sending characters, inputKeys helps in sending key strokes that of ALT, SHIFT, ENTER etc.. No window activation implicitly occurs. For detailed explanation of the key syntax, see inputKeys.
Example:
Send "AB" to the top window that can consume the screen key events
IScreen scr = getRootTestObject().getScreen();

scr.inputKeys("+a+b");
Since:
RFT6.1.1.1

inputChars

void inputChars(java.lang.String characters)
Sends the characters to the current active window

Parameters:
characters - java.lang.String The characters to be sent to the current active window
Detail description:
The characters to the current active window are sent as a sequence of key events. No special interpretation of the characters (such as for inputKeys) is used. No window activation implicitly occurs.
Example:
Send "AB" to the top window that can consume the screen key events
IScreen scr = getRootTestObject().getScreen();

scr.inputKeys("AB");
Since:
RFT6.1.1.1