You may encounter timeout errors or other execution failures during load test execution. Here are some tips for avoiding, finding, and fixing such errors.
Test runs often fail due to the appearance of unexpected dialogs, causing scripts to lose focus on the windows they are working on. It is therefore recommended that you enable the TrueLog On Error feature in Silk Performer before you execute tests. Then, if an error occurs, you will be able to visually track it down in TrueLog Explorer.
After a failed test execution, ensure that you reset all terminal server sessions before you execute the test again, otherwise your script will likely fail.
During tests, your application is likely to throw errors due to generated load. Adding event handlers to your script that can handle and report such errors is very helpful.
Here is an example of an event handler that continuously watches for a window with the name Program Error Intercepted and executes an ALT-C to close any such window that appears. The event handler also generates an error message whenever such an error occurs.
dclevent handler Handler1 <EVENT_CITRIXINTERRUPT> var nInterrupt, nWindow : number; nStyle : number; sWindowCaption : string; begin CitrixGetActInterrupt(nInterrupt, nWindow); ErrorAdd(FACILITY_CITRIXENGINE, 47, SEVERITY_INFORMATIONAL); print(string(nWindow)); CitrixGetWindowCaption(nWindow, sWindowCaption); if sWindowCaption = "Program Error Intercepted" then CitrixKey(67, MOD_Alt); // 'c' end; ErrorRemove(FACILITY_CITRIXENGINE, 47); end Handler1;
While it may be tempting to use Wait() or ThinkTime statements to avoid having scripts overrun applications under test, this practice is not recommended for two reasons:
The solution is to use synchronizations.
Sometimes changes in application behavior result in portions of a recorded script becoming obsolete. Re-recording a portion of a use case is an option, but beware that the recorder may not be able to track the handles of the existing windows, resulting in incorrect window handle numbers. These issues can make the process of integrating newly recorded script with an original script quite tedious. When a use case is small, it is recommended that you re-record the entire use case. Otherwise, follow the process outlined below to integrate a new script with an outdated script: