Ask a Question

Object recognition hint fired in wrong place

NisHera
Valued Contributor

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.....Capture1.PNG

mapping for both dialog boxes are same but different Windcaption.

 

anybody got a simple solution rather than writing new event?

 

2 REPLIES 2
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
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".


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: