Java: how to wait specific time after each type

Asked by jerome

I just have multiple action , i need to wait some interval of time for every action.

And also Wait function, Waitvanish is not properly wait for the image in Eclipse, then moved to the next action.

Code:

                        s.type(descripion);
   robot.keyPress(KeyEvent.VK_TAB);
   s.wait((double) 0.2);
   robot.keyPress(KeyEvent.VK_TAB);
   s.wait((double) 0.2);
   String version = "1.0";
   s.type(version);
   s.wait((double) 0.2);
   robot.keyPress(KeyEvent.VK_TAB);
   s.wait((double) 0.2);
   String fileDisposition = row.getCell(7).toString();
   s.type(fileDisposition);
   robot.keyPress(KeyEvent.VK_TAB);
   s.wait((double) 0.2);
                        .
                        .
                        . . . . .etc

Question information

Language:
English Edit question
Status:
Answered
For:
SikuliX Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
RaiMan (raimund-hocke) said :
#1

There is no general feature "wait x after each action".

--- question:
why do you use
robot.keyPress(KeyEvent.VK_TAB);
instead of
type(Key.TAB)
???

You could just create a new class extending the class Region and add a typeAndWait() method, that types and waits.

Can you help with this problem?

Provide an answer of your own, or ask jerome for more information if necessary.

To post a message you must log in.