Forum Discussion

redsgt's avatar
redsgt
Occasional Contributor
14 years ago

Another WaitWindow/Exists thread

As far as I know from searching around here, the following should work:


var x;

  x = Aliases["BLAH32"]["dlgBlah"]["WaitWindow"]("Static", "blah blah blah.", 2, 1000);

  if (!x["Exists"]) 


{


//Do whatever


}


The line with WaitWindow always gives a "the object does not exist" error.  It also seems to wait longer than 1000 before it fails.

4 Replies

  • WaitWindow doesn't raise an error if it fails to find the desired object. That implies that the error is coming from this part:

    Aliases["BLAH32"]["dlgBlah"]



    That's the object that doesn't exist. TC is taking some time to find it (the "Auto-wait timeout" defined in your project properties), failing to find it, then because you are trying to call a method of the missing object, you get the error.
  • Hi,



    Try using WaitAliaChild to obtain 'BLAH32' and 'dlgBlah'. If this doesn't help, check by what properties they're mapped in Name Mapping. Perhaps, you use some unreliable properties such as Index, and their actual values don't match the stored ones.
  • redsgt's avatar
    redsgt
    Occasional Contributor

    Thanks for the replies.  WaitAliasChild didn't work for me.  Probably because I was messing something up. :)


    Here's what did work for me:


    var x;

      x = Aliases["Blah32"]["WaitWindow"]("#32770", "Blah", 1, 1000);

    if (!x["Exists"])

    {


    //Do something


    }

  • Hi,



    It looks like the recognition parameters in Name Mapping are incorrect. Try checking the 'dlgBlah' dialog's properties in Name Mapping and see what values they have.