I have a script that goes through every menu item in our application and verifies the caption. However, I have two menu items that lock up my workstation when executed by Silk Test. I can execute these menu items with no problem manually. There does not appear to be anything unique about these two menu items such a displaying a large amount of data.
Try and simulate what SilkTest does. SilkTest doesn't move the mouse pointer and click on the menu. I believe it uses key strokes to accomplish this. If you put in a .5 second delay in the Keyboard event delay on the Timing tab of the Agent Options dialog and then watch it. You can see exactly what it does. Then try it manually and see if it locks up.
I tried this out and it still worked manually. I did notice that if I put the menu item at the top of my list the test will run fine until completed. But if I put it back in the order I started with it will lock up. I thought it could be a memory error but the memory is fine on my workstation and nothing locks up when I execute this menu item at the beginning of the test. It doesn't seem to make sense to me.
I can't override it to use the keyboard because my code reads from an excel file to determine which menu item to pick. It does this until all of the items in the spreadsheet have been executed. For now I just put the menu item at the top of my execution list but I am just trying to make sense of what has happened in this situation.
1. Try toggling the Option/Agent/Other setting for "Pick menus before getting...".
2. Positional sensitivity is aways a curious symptom worth exploring. Could it be that the application is busy finalizing processing of the preceeding selection?
3. Check application, menu and menuitem IsEnabled() states at the point of failure.
4. Don't avoid the problem (other than as a temporary measure) by substituting an alternate method until you've gotten to the bottom of it. To do otherwise can bite you hard later.
5. Why write independent tests to verify access when doing so is already implied within the functional tests of the item being invoked? Label verification of menus and menuitems (and all other static controls) is also duplicated and unnecessary effort.
6. If an inserted delay (somewhere) solves the problem, replace it with handshake code instead. Otherwise, test environment changes will cause you to revisit that delay value again and again.