IMPORTANT NOTICE: As of 21 February, anything posted in this community WILL NOT BE MIGRATED to our new community site. We have pulled all user information and data from this site and are now in an approximately week long process of importing users, roles, and data to our new site. We are leaving this site open and active so you can post and hopefully get a response until the migration is complete. Once complete, the URL that currently takes you to this site will take you to our new site so your bookmarks will work as always. Please read the information on a New Login Process
This error occurs when the window that Silk Test is trying to perform the action on is not on the desktop. If you are watching the script run, and at the time the error occurs you can see the window on the screen, it usually means the tag that was generated is not a correct tag. This could happen if the application changed from the time the script or include file was originally created.
Another possibility is that the window is taking more than the number of seconds specified for the window timeout.
The window timeout setting is on the Timing tab in the Agent Options dialog (select Options/Agent). The window timeout is the number of seconds Silk Test will wait for a window to appear. If the window does not appear within that period, the Window not found error is raised. If you suspect the problem is that Silk Test is not waiting long enough, you can increase the window timeout in one of two ways.
- You can change the setting in the Agent Options dialog.
- You can add this line to the script: Agent.SetOption (OPT_WINDOW_TIMEOUT, numberOfSeconds)
If the window is on the screen within the amount of time specified in the window timeout, the problem is the tag for the object.
One technique to troubleshoot a tagging problem is the following.
1. Go to the Runtime Options dialog (select Options/Runtime) and check both options in the Debugging section (Print agent calls and Print tags with agent calls).
2. Rerun the script to reproduce the error.
3. Select Record/Window Identifier and point to the window. Note the tag or identifier.
4. Compare the tag/identifier with what is listed in the results file. What you should see is a mismatch of what is in the results file versus what you get in the Record Window Identifier dialog (which is how SilkTest is identifying the window).
What is in the script:
MainWin("Test Application").DialogBox("CheckBox").SetActive ()
What is in the results file:
MainWin("Test Application").DialogBox("CheckBox").SetActive () tag="/[MainWin]Test Application/[DialogBox]CheckBox" *** Error: Window "[DialogBox]CheckBox" was not found
What is in the Record Window Identifier dialog:
MainWin("Test Application").DialogBox("Check Box")
If you look closely, you can see that the Record Window Identifier dialog is telling us the actual tag for the DialogBox is Check Box (note the space between Check and Box). But if you look at the results file, the tag does not show the space. This is the problem.
To correct this problem, change your tag in the frame file (or in the script if you are not using a frame file).