|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectjava.awt.Robot
com.cbse.jeasy.JEAutomation
public class JEAutomation
The JEAutomation offers a script interface in XML.
See the Robot class of the jdk. Example:
<?xml version='1.0' ?>
<jeasy>
<automationScript id="test1">
<automation method="setDelayFactor" param1="1"/>
<automation method="smoothMouse" param1="true"/>
<automation method="mouseMove" param1="RB_Radio1"/>
<automation method="mouseClickLeft"/>
<automation method="mouseMove" param1="BT_Button"/>
<automation method="mouseClickLeft"/>
<automation method="mouseMove" param1="DF_Datafield"/>
<automation method="mouseClickLeft"/>
<automation method="typeString" param1="azAZ1234567890,.-;:_ß?\+*#'äöüÄÖÜ@"/>
<automation method="mouseMove" param1="CB_Combobox"/>
<automation method="mouseClickLeft"/>
<methodinvocation>
<id>MC_DB_Country1</id>
<JEObject>CB_Combobox</JEObject>
<method>setSelectedIndex(int)</method>
<param1Class>int</param1Class>
<param1Value>5</param1Value>
</methodinvocation>
</automationScript>
</jeasy>
The following methods are defined in JEasy script language:
mouseMove(param1); // moves the mouse to the center of the of the jeasy object param1
delay(param1); // milliseconds to wait
keyPress(param1); // keycode to be pressed
keyRelease(param1); // keycode to be released
mousePress(param1); // mouse button to be pressed InputEvent.BUTTON1/2/3_MASK
mouseRelease(param1); // mouse button to be released InputEvent.BUTTON1/2/3_MASK
mouseClickLeft(); // click left mouse button. Presses and releases the left button
mouseClickRight(); // click right mouse button. Presses and releases the left button
mouseMove(param1, param2); // moves the mouse to position x=param1 y=param2
mouseMove(param1; // moves the mouse to to the given JEasyId
mouseMove(param1, param2, param3); // moves the mouse to the table given by the JEasyID in row=param2 col=param3
mouseMove(param1, param2, param3, param4); // moves the mouse to the table given by the JEasyID=param1 looking in col=param2
// for string=param3 and position in col=param4
setAutoDelay(param1); // sleeps param1 milliseconds after generating an event
setAutoWaitForIdle(param1); // sets whether this Robot automatically invokes waitForIdle after generating an event
// param1 may be true or false
setDelayFactor(param1); // param1 between 0 and 10. Higher value means increasing the autoDelay
smoothMouse(param1); // setting param1 to true moves the mouse to next position
// setting param1 to false changes the mouse position
typeString(param1); // generates keyPress and keyRelease events to type the string param1
// be sure to have the cursor in an inputfield
// some special characters are definied: /t = tab /n = CRLF /u = cursor up /d = cursor down
waitForIdle(); // Waits until all events currently on the event queue have been processed
The script understands the XML tag methodinvocation. This syntax enables to invoke
each object method defined in jeasy classes.
| Constructor Summary | |
|---|---|
JEAutomation()
|
|
JEAutomation(java.lang.Object caller)
|
|
| Method Summary | |
|---|---|
void |
automate(java.lang.String xmlAutomate)
Call this method directly to perform the automation not using a thread. |
void |
automateAsThread(java.lang.String xmlAutomate)
Performs one xml automation tag as a thread Example: <automation method="mouseMove" param1="RB_Radio1"/> |
void |
doXMLScript(java.io.BufferedReader din)
Reads the automation tags out of the BufferedReader and performs them. |
void |
doXMLScriptAsThread(java.io.BufferedReader din)
Reads the automation tags out of the BufferedReader and performs them as a thread. |
void |
doXMLScriptAsThread(java.io.BufferedReader din,
java.lang.String automationScriptId)
Reads the automation tags from the XMLtag out of the BufferedReader and performs them as a thread. |
boolean |
isComponent(int x,
int y)
Chekcs if |
void |
mouseClickLeft()
Presses and releases the left mouse button with an delay of 300 ms. |
void |
mouseClickRight()
Presses and releases the righ mouse button with an delay of 300 ms. |
void |
mouseMove(int fromx,
int fromy,
int tox,
int toy)
Moves the mouse smoothly. |
void |
mouseMove(java.lang.String JEObjectId)
Move the mouse to the middle of the JEasy object. |
void |
mouseMove(java.lang.String JEObjectId,
int row,
int col)
Move the mouse to the table to row and column. |
void |
mouseMove(java.lang.String JEObjectId,
int colLookUp,
java.lang.String search,
int column)
Move the mouse to the table to row (where saerch is found in col colLookUp) and column. |
void |
run()
Call this method directly to perform the automation not as a thread. |
void |
setDelayFactor(int delayFact)
A value between 1 and 10 which is a multiplier of 10 ms for the autoDelay() |
void |
typeString(java.lang.String s)
Generates keyPress and KeyRelease events related to the given string. |
| Methods inherited from class java.awt.Robot |
|---|
createScreenCapture, delay, getAutoDelay, getPixelColor, isAutoWaitForIdle, keyPress, keyRelease, mouseMove, mousePress, mouseRelease, mouseWheel, setAutoDelay, setAutoWaitForIdle, toString, waitForIdle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JEAutomation()
throws java.awt.AWTException
java.awt.AWTException
public JEAutomation(java.lang.Object caller)
throws java.awt.AWTException
java.awt.AWTException| Method Detail |
|---|
public void automateAsThread(java.lang.String xmlAutomate)
s - xml StringJE#PropertyStringpublic void run()
run in interface java.lang.Runnable
public void automate(java.lang.String xmlAutomate)
throws java.io.IOException
java.io.IOExceptionpublic void mouseClickLeft()
public void mouseClickRight()
public void setDelayFactor(int delayFact)
public void doXMLScriptAsThread(java.io.BufferedReader din,
java.lang.String automationScriptId)
public void doXMLScriptAsThread(java.io.BufferedReader din)
public void doXMLScript(java.io.BufferedReader din)
throws java.io.IOException
java.io.IOExceptionpublic void mouseMove(java.lang.String JEObjectId)
public void mouseMove(java.lang.String JEObjectId,
int row,
int col)
public void mouseMove(java.lang.String JEObjectId,
int colLookUp,
java.lang.String search,
int column)
JEObjectId - colLookUp - search - col -
public boolean isComponent(int x,
int y)
x - y -
public void mouseMove(int fromx,
int fromy,
int tox,
int toy)
public void typeString(java.lang.String s)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||