Forum Discussion

stega's avatar
stega
Contributor
12 years ago

Wait object

Hi All,

I have a problem, with waiting objects.

I want to test an export function. When i click to export button it opens ms excel and when the export is complete it swithches back to the main app and a pop-up window appears with the message, the export was successfull.

I tried the WaitVCLObject method, but nothing happens.



...

panel.btnExcel.ClickButton();

                

myapp.WaitVCLObject("TMessageForm");

                

button.ClickButton();

excel = Aliases.EXCEL;

wndXLMAIN = excel.wndXLMAIN;

wndXLMAIN.XLDESK.wndBook1.Keys("^s");

...



I want to avoid delay, because the different kind of exports need different delay times.

Thanks.
  • Hi Gabor



    You have forget to mention timeout in your statement.



    myapp.WaitVCLObject("TMessageForm", 10000);


    Timeout




    The number of milliseconds to wait until the specified object becomes available. If Timeout is 0, the method returns immediately. If Timeout is -1, the wait time is infinite...



  • Hi Gabor



    You have forget to mention timeout in your statement.



    myapp.WaitVCLObject("TMessageForm", 10000);


    Timeout




    The number of milliseconds to wait until the specified object becomes available. If Timeout is 0, the method returns immediately. If Timeout is -1, the wait time is infinite...



  • Thanks for te reply.

    I will try it, but what is the difference between the two methods:

    Delay(10000);

    and

    myapp.WaitVCLObject("TMessageForm", 10000);