First consider the following SilkTest Open Agent Code Testcase MainWinClosure()
            
 [ ] Fn_Login(nTimerCounter, Userid, Password)
                [ ] Desktop.Find("//Shell[@caption='Service Parts Optimization']").Find("//DropDownToolItem[@caption='Menu']").Open()
                [ ] Desktop.Find("//Shell[@caption=' Service Parts Optimization']").Find("//MenuItem[@caption='Sort...']").Pick()
                [ ] Desktop.Find("//Shell[@caption='Service Parts Optimization']").Find("//Shell[@caption='Multiple Sort']").Find("//ListBox").Select("Low Stock Replenishment Plans")
                [ ] Desktop.Find("//Shell[@caption='Service Parts Optimization']").Find("//Control[75]").Find("//Control[@windowClassName='SunAwtCanvas']").Click(1, 10, 81)
                [ ] sleep(60)
                [ ]
                [ ] Desktop.Find("//Shell[@caption='Service Parts Optimization']") // Fails at this step It returns the following error:                 [ ] Could not find object '//Shell[@caption='Service Parts Optimization']'.
                [ ] Occurred in Find
                [ ] Called from Desktop.Find at winclass.inc(3465)
                [ ] Called from MainWinRecognition at ServicePartsOptimiz.t(715)

The above error indicates a typical timeout problem, if the window timeout expires (default 5 sec) then it raises an error similar to the one above. Therefore in this case to prevent the error you have two choices:

1) Increase the Window Timeout in SilkTest via “Options | Agent | Timing” for the whole test
2) Add the find option argument to the Find() method to use a different timeout for this find() call only.

For example the code below sets a timeout of 120 seconds:

Desktop.WaitForObject("//Shell[@caption='Service Parts Optimization']", 120)