Forum Discussion

NisHera's avatar
NisHera
Valued Contributor
10 years ago

WaitProperty waits till expire

I have written following code 

 

var prop=['Exists','VisibleOnScreen'],valu=[true,true];
           Log.Message("Now:" + aqDateTime.Now());
           Log.Message(MyWindow.Exists+"..........."+MyWindow.VisibleOnScreen );

          Log.Message("Now:" + aqDateTime.Now());
MyWindow.WaitProperty(prop,valu,12500);
           Log.Message("Now:" + aqDateTime.Now());

 

 

I was supposed to get MyWindow as soon as Exists and VisibleOn Screen isn't so?

But waite porpert stay untill time expires ...what could be the problem?

Pl look at my results attached

  • NisHera's avatar
    NisHera
    10 years ago

     

    Found out that you can not wait for multiple properties but a single property only

    hence WaitProperty  is useless in that senario

  • If I understood:

    When you go expect property, you must first reset the TimeOut value. Ie would the delay of the "project".
    Playback through the project configuration. Or Options.Run.Timeout through the script: = 1000 (represents 1 second);

    If you are expecting a display window. I would use this code:

    //App = Application tested;

    while not(Alises.App.WaitWindows ('WNDCLASS', 'wndCaption'). Exists) do // The wnd properties for you to catch use the tool checkproperty
      begin
    Delay (500);
    end;


    Detail: There are several methods to expect something ...

    • NisHera's avatar
      NisHera
      Valued Contributor

       

      Found out that you can not wait for multiple properties but a single property only

      hence WaitProperty  is useless in that senario