Forum Discussion

NisHera's avatar
NisHera
Valued Contributor
9 years ago

Object recognition hint fired in wrong place

In my application if I had error dialog box  appears test fails.

But warning dialog box comes test ok and con be continue..

  if (Aliases....dlgError.WaitProperty("Exists",true,1500)){
      return false;
    }
  Else  (Aliases.....dlgWarning.WaitProperty("Exists",true,300)){
      Aliases....dlgWarning.OK.ClickButton();
       return true; }

 

in TC 11.3 it worked nicely but TC12.1 gives me warning.....

mapping for both dialog boxes are same but different Windcaption.

 

anybody got a simple solution rather than writing new event?

 

  • Bobik's avatar
    Bobik
    Frequent Contributor

    I recommend you change 

      Aliases....dlgError.WaitProperty("Exists",true,1500)

    line to 

    Aliases....WaitAliasChild("dlgError",1500).Exists

     

    In this case you won't wait for project 'playback timeout' if the error doesn't exist. By default it's 10000ms and may slowdown your test.

    • tristaanogre's avatar
      tristaanogre
      Esteemed Contributor

      Just as a general note:

      You can't test for the values of the "Exists" property of an object if the object does not actually exist. If it doesn't exist, there is no way to look at the property.  This is why functions like WaitAliasChild were created... they look for the object in question... if it is present within the given timeout, then it returns the object. If it is not present, it returns an empty "stub" object with an Exists property with the value of "false".