Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE

What approaches can be used to over come "Window not found" errors in SilkTest?

What approaches can be used to over come "Window not found" errors in SilkTest?

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.

Timing
========

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.

Tagging
===============

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).

For Example:

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).

Old KB# 22740

DISCLAIMER:

Some content on Community Tips & Information pages is not officially supported by Micro Focus. Please refer to our Terms of Use for more detail.
Top Contributors
Version history
Revision #:
1 of 1
Last update:
‎2013-02-15 19:33
Updated by:
 
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.