title: TestComplete, how to check if pop up window exists
body: <p>So I want to create a check for if a pop up window withing a web page exists through JScript in testcomplete, but am running into problems with the window check. Here's what I have so far:</p>
  
  <pre><code>var MyPage = Sys.Browser("*").Page(MyURL);
  var PopUp = MyPage.Panel(20);
  
  while (PopUp.Exists == false)
  {
      //do nothing
  }
  </code></pre>
  
  <p>But the program crashes, saying "unable to find the object PopUp, because it hasn't appeared yet. Is there a way to determine weather or not a pop up window exists without crashing the program?</p>