|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface JavaComponent
JavaComponent is created to represent any java component This is the base element for any Java element. Should be used for creating an element whose class name is known and corresponding element for same is not present in the standard elements list supported by default.
The following code fragment illustrates how to create an
JavaComponent
element for a java class component SampleTree.
var element = engine.createJavaComponent(1, "SampleTree", 5);where engine is object of
IScriptEngine
Method Summary | |
---|---|
boolean |
activate()
To activate or bring window to focus |
void |
addAttribute(java.lang.String sAttributeName,
java.lang.String sAttributeValue,
boolean bIgnore,
boolean bValidate,
java.lang.String testParameterName)
Each Window or Java Element has a set of attributes, which are used to find the desired element during execution This method is used to add a attribute to the event |
void |
captureImage(java.lang.String imageFilePath,
boolean overrideExisting)
To capture the component's image |
boolean |
click(int x,
int y)
To simulate click on JavaComponent |
boolean |
close()
To close window |
boolean |
dblClick(int x,
int y)
To simulate double click on JavaComponent |
boolean |
drag(int x,
int y)
To simulate drag on JavaComponent |
boolean |
drop(int x,
int y)
To simulate drop on JavaComponent |
java.lang.String |
getName()
To get name of the component |
java.lang.String |
getText()
To get text associated with this component, like title, label, button text etc. |
java.lang.String |
getToolTipText()
To get tool tip text associated with this component |
boolean |
maximize()
To maximise window |
boolean |
minimize()
To minimise window to an icon |
boolean |
mouseMove(int x,
int y)
To simulate mouse move on JavaComponent |
boolean |
restore()
To restore window to previous size |
boolean |
rightClick(int x,
int y)
To simulate right click on JavaComponent |
boolean |
set(java.lang.String text)
To set text for this component, like title, label, button text etc. |
void |
setBreakPoint(boolean bBreakPoint)
This method should be called to set a breakpoint before executing task. |
void |
setIgnored(boolean bIgnore)
This method should be called to ignore a task during execution. |
void |
setImagePath(java.lang.String sImagePath)
This is used to set the event's image path. |
boolean |
setName(java.lang.String name)
To set name of the component |
void |
setThinkTime(int iThinkTime)
Delay in seconds before the task is actually executed. |
void |
setTitle(java.lang.String sTitle)
This method is used to set the element's title |
boolean |
type(java.lang.String keyBoardInput,
boolean isAlphaNumeric)
Types the specified string in the object |
Methods inherited from interface com.appperfect.devcommon.script.IScript |
---|
getReasonForFailure, isIgnored, isTaskSuccessful, isTaskTimedOut, setReasonForFailure, setTaskSuccessful, setTaskTimedout, setTimeout |
Method Detail |
---|
boolean activate()
void addAttribute(java.lang.String sAttributeName, java.lang.String sAttributeValue, boolean bIgnore, boolean bValidate, java.lang.String testParameterName)
sAttributeName
- name of the attributesAttributeValue
- value of the attributebIgnore
- true
if this attribute should be ignored;
false
otherwise.bValidate
- true
if this attribute should be validated;
false
otherwise.testParameterName
- name of the TestParameter if the attribute value is parameterizedvoid captureImage(java.lang.String imageFilePath, boolean overrideExisting)
imageFilePath
- file path where the image should be saved.overrideExisting
- to decide whether image should be overridden if it already
exists.boolean click(int x, int y)
x
- x coordinate relative to component's client recty
- y coordinate relative to component's client rect
boolean close()
boolean dblClick(int x, int y)
x
- x coordinate relative to component's client recty
- y coordinate relative to component's client rect
boolean drag(int x, int y)
x
- x coordinate relative to component's client recty
- y coordinate relative to component's client rect
boolean drop(int x, int y)
x
- x coordinate relative to component's client recty
- y coordinate relative to component's client rect
java.lang.String getName()
java.lang.String getText()
java.lang.String getToolTipText()
boolean maximize()
boolean minimize()
boolean mouseMove(int x, int y)
x
- x coordinate relative to component's client recty
- y coordinate relative to component's client rect
boolean restore()
boolean rightClick(int x, int y)
x
- x coordinate relative to component's client recty
- y coordinate relative to component's client rect
boolean set(java.lang.String text)
void setBreakPoint(boolean bBreakPoint)
bBreakPoint
- true
if breakpoint should be set;
false
otherwise.void setIgnored(boolean bIgnore)
setIgnored
in interface IScript
bIgnore
- true
if this task should be executed;
false
otherwise.void setImagePath(java.lang.String sImagePath)
sImagePath
- file path of the event's image saved on disk.boolean setName(java.lang.String name)
void setThinkTime(int iThinkTime)
setThinkTime
in interface IScript
iThinkTime
- no of seconds the engine waits before the task is actually
executed.void setTitle(java.lang.String sTitle)
sTitle
- title of the elementboolean type(java.lang.String keyBoardInput, boolean isAlphaNumeric)
keyBoardInput
- A String value. The text string to type.isAlphaNumeric
- is true if text string represents a alphanumeric key, false
otherwise
|
|||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |