ask / answer timeout?

I have scripts that generally run as unattended processes. Sometimes I want to run them interactively in Eggplant to see what's going on.

If a certain variable has not been set, I want to 'ask' or 'answer' the user for input on what the variable should be. The reasoning is that if the program has not picked up the variable from the runtime environment, then either the user is running the script interactively (the environment is different in that case) or something has gone terribly wrong in the test.

If something has gone wrong in the test, I don't want my script to sit forever on an 'ask' or 'answer' when there's nobody to respond.

I don't see a timeout on the ask and answer functions. How do you suggest that I get the behavior of:

- Ask the user a question
- If there is no response within a minute, log a test failure.

Thanks!
-edj

Comments

  • Of course, this can all be avoided if there is something my script can look at that tells it if the script is running interactively inside the Eggplant environment or non-interactively from runscript.

    I could pass a parameter to my script, but I don't want to rely on having to remember to pass a param to flag this condition all the time.
    -edj
  • ToddTodd Member
    Since release 3.31 we have added the feature of detecting if a script is run from CLI...

    RunningFromCommandLine()

    Please upgrade to 3.31 if you are entitled per your license agreement with Redstone Software, or pass parameters to your scripts.
  • Great! I didn't look in the Release Notes where I would have found this info. I'll try it out.
    Thanks!
    -edj
  • ToddTodd Member
    Yep, if we could just get folks to read the release notes, maybe deactivate the software until they actually supply word N of paragraph M of the release notes :) it would save us a lot of time on the boards and emails.
  • Works like a charm!
    -edj
Sign In or Register to comment.