Window is not exposed

Problem

You run a script and get the following error: Error: Window 'name' is not exposed.

Sometimes, applications are written such that windows are hidden to the operating system, even though they are fully exposed to the user. A running script might generate an error such as Window not exposed, even though you can see the window as the script runs.

Solution

While it might be tempting to simply turn off the checks for these verifications from the Agent Options > Verification dialog box, the best course of action is to take such errors on a case by case basis, and only turn off the verification in cases where the window is genuinely viewable, but Silk Test Classic is getting information from the operating system saying the object is not visible.

  1. Add the following statement to the script, just before the line causing the error: Agent.SetOption(OPT_VERIFY_EXPOSED, FALSE).

  2. Then add the following line just after the line causing the error: Agent.SetOption(OPT_VERIFY_EXPOSED, TRUE).

This means Silk Test Classic will execute the action regardless of whether it thinks the window is exposed.