Wait for keystroke


I am new at this and was wondering if it was possible to wait for a keystroke, before continuing the code.


Click “start”
Pause script until I press Spacebar
Click “Internet Explorer”

Sorry if this was already posted, but I didn’t find it anywhere. Thanks in advanced!

The SenseTalk “answer” command will display an alert panel to the user on the Eggplant machine and wait for them to click a button or press return before proceeding with the script (see Chapter 17 of the SenseTalk Reference manual). In its simplest form it looks like this:

answer "Press Return to continue"

Thank you very much for the quick response and I will definitely take a look at Chapter 17. Thanks again!

I’m looking to put up an alert box on the client machine (not the Eggplant machine but the machine Eggplant has VNCed into). Any ideas how to do this?

Putting up an alert panel on the SUT seems like an odd thing to do. Will there be someone sitting at that machine while Eggplant is automating it? Are you expecting them to interact with Eggplant somehow?

In any case, to put up an alert there, you’ll need some piece of software that can display an alert. If the SUT is a Mac, this could be as simple as an AppleScript script that contains a “display dialog” command. Then your Eggplant script could run that script on the SUT, wait for the dialog to appear, then wait for it to go away (assuming a human operator will dismiss it).

Is this what you had in mind?

I’m just realizing that it really is silly to put an alert up on the SUT. The original idea was to put up an alert reminding the user to empty cache and cookies on the SUT before the script proceeds. But even that is better done on the eggplant machine. Thanks.

Yes, that might be the better route. I just wanted to mention that it’s also a pretty simple procedure to have Eggplant itself empty the brower’s cache and cookies at the beginning of the script; it is an automation tool after all :wink: