08-15-2013 01:01 PM - edited 03-14-2019 12:15 PM
Hi, I have a script that has a large Time of Day/Day of Week block and, without changing the system clock, how do I go about testing the script at various days and times? How can I simulate 2AM on a Wednesday without actually waking up at 2 in the morning and calling in?
Thanks for any help that you can provide.
08-15-2013 01:09 PM
I would advise against changing the time on the server, which would mean in most cases changing the time on your NTP server.
If you don't trust the time functions of UCCX and you need to prove that they work, you can do so very easily in a non production script with business hours like: 11:15am - 12:00pm.
If however you need to test logic for different time periods, without the need to vet the time functions in UCCX, this is very easy. You put a label where you want the logic to flow, and then a goto step before the DoW/ToD steps to bypass it.
Example:
Start
Accept (--Triggering Contact--)
Goto TestWeekdayClosed
Day of Week
Weekdays (Mon- Fri)
Time of Day
Open (8:00am - 5:00pm)
Goto Open
Closed
TestWeekdayClosed:
Goto Closed
Weekends (Sat & Sun)
Goto Closed
Open:
...your open logic here...
Closed:
...your closed logic here...
End
If you wanted to test this in a live production script, then you can target your calling phone like this (assume you call from 2001):
Start
Accept (--Triggering Contact--)
calling_number = Get Call Contact Info (--Triggering Contact--, Calling Number)
If (calling_number == "2001")
True
/* Special test routing for Anthony */
Goto TestWeekdayClosed
False
/* Normal routing for everyone else */
Day of Week
Weekdays (Mon- Fri)
Time of Day
Open (8:00am - 5:00pm)
Goto Open
Closed
TestWeekdayClosed:
Goto Closed
Weekends (Sat & Sun)
Goto Closed
Open:
...your open logic here...
Closed:
...your closed logic here...
End
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
08-15-2013 01:19 PM
Thanks for the reply, Anthony. This will definitely help me in testing the logic that hangs off the end of the various DoW/ToD blocks, however it doesn't actually test the DoW/ToD blocks themselves.
The script I'm working on has a fairly convolouted and not well named/documented block of DoW/ToD steps. I'm not able to, at a glance, determine which label would even get called at 2AM on a Wednesday (to continue using that example). Is there any way I can pass in false information to the DoW and ToD functions that would let me simulate calls at various odd times?
08-15-2013 02:08 PM
No there is not. Sorry to say.
I like to use the day and time values in my connections so I can tell at a glance which branches have which values. This is something I picked up from ICM Routing Scripts.
Anthony Holloway
Please use the star ratings to help drive great content to the top of searches.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide