03-16-2010 01:13 PM
I have a Message Popup with one button. This button is also set up to be the Timeout Button. If I press the button, RunState.Sequence….Result.ButtonHit is set to 1. Alternately, if I allow the timeout to be reached, Result.ButtonHit is also set to 1. Is there a way to determine whether the timeout was reached or if the user pressed the button?
03-17-2010 01:59 AM
Hi Christine,
I have just played with Message Popup's timeout and i also do not see a way to check if a timeout has been occured.
The only way is to use a new button for timeout but you can not hide it ! Only changing the colour stuff and this is looking
terrible. And if the user is pressing this button you will not determine a timeout, too!
I think the "blue ones" should add this feature in next TS release.
Or they have some other suggestions.
Sorry that i have no solution.
Juergen
03-17-2010 09:31 AM - edited 03-17-2010 09:32 AM
workaround pseudocode:
MessageBox Pre Expression: Locals.PopupTime = Seconds()
MessageBox Post Expression: Locals.PopupTime = Seconds() - Locals.PopupTime
if (buttonHit == timeoutButton && Locals.PopupTime >= timeoutPeriod)
{
// message box timed out
}
03-17-2010 09:41 AM
Probably not the best solution, but you could measure the time it takes for the step to complete and determine if a timeout occurred. There is a very small chance a user could click the button at the very end and have it show up as a timeout.
In the 'Expressions' for the message popup step enter the following:
Pre-Expression: Locals.StartTime = Seconds()
Post-Expression: Locals.TimeOut = (Seconds() - Locals.StartTime) > 4.9 //Set this as .1 less than the time interval for time to wait. 5 seconds in this case.
Jim
03-18-2010 07:02 AM
Many thanks to all of you for your help and suggestions. I'll try them out and see what works best for my application.
Christine
03-18-2010 11:46 AM
03-19-2010 09:30 AM
If you modify the step type, please create a copy of it and rename it to something specific to your company. Also, put the modified copy of the source code and dll under <TestStand Public>\Components\StepTypes\ and your modified step type in your own type palette file or MyTypes.ini. Doing these things will ensure that your modifications aren't lost when you upgrade to a newer version of TestStand in the future as well as making it easier to build a deployment for your system.
-Doug
03-19-2010 11:24 AM