Nexial Automation

Test Automation Platform for everyone!

X

step.inTime » validate(prompt,responses,passResponses,waitMs)

Description

This command is same as step » validate(prompt,responses,passResponses) but it has one extra parameter for timeout duration.

This command provides manual validation with a timeout. Nexial will pause the current execution and display a prompt on the console, from which one can provide the appropriate response as validation. The maximum pause time will be waitMs milliseconds. If user provides input before the waitMs milliseconds then the pause will over immediately. The responses parameter is a comma-separated list of possible responses, and passResponses parameter presents a list of comma-separated responses that will be considered as PASS. If user provides a response that match one of the passResponses, then the corresponding test step is considered as PASS. Otherwise, Nexial will consider the corresponding step as FAIL.

The screenshot below is an example that shows the prompt and a set of possible responses:

Parameters

  • prompt - The prompt to the intended validation
  • responses - Comma-separated list of possible responses
  • passResponses - Comma-separated list of “PASS” responses. Note that these responses must be found in responses as well. If user’s response does not match one of these passResponses, the command is considered as FAIL
  • waitMs - The number of milliseconds to wait before timeout.

Example

Script:

Output:

See Also