Forum Discussion

sindhu10's avatar
sindhu10
Contributor
7 years ago

How to give a delay or wait to winformsobject for 5 mins for the window to get popped up

Hi,

 

Tried the below code :

1.clicking the text box :

  var textbox = Sys.Process().WinFormsObject("").WinFormsObject("").WinFormsObject("TextBoxMaskBox", "");

  textbox.Click();

 

2. var MI = Sys.Process("").WaitWinFormsObject("GenericSelect", 25000);
if(MI.Exists)
{

  do the action

}

else 

{

  Log.Message(Window not popping up );

}

 

 The window takes exactly 5 mins to get popped up in the screen after the click , desktop application automatically closes after the delay or wait don't know why 

 

Pls help me in the above code how can i give wait or delay for the same.

 

 

Thanks,

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor

    5 minutes is 300000 milliseconds.  so, replae the 25000 with 300000 and try again.

    • sindhu10's avatar
      sindhu10
      Contributor

      Hi,

       

      Thanks yes replaced with 300000 ms but the desktop application which am testing get closed automatically and test complete results in waiting for application.

       

       

      • Marsha_R's avatar
        Marsha_R
        Moderator

        Okay, it's not really clear here what you're trying to accomplish.  

        Is this right?

        in 1) you are clicking a text box

        in 2) you want to wait exactly 5 mins for a window to pop up but your application closes before that time is up

         

        Questions

        a) What happens when you try this manually?  Does the window pop up in 5 mins or does the application still close?

        b) What do you need to do with the window once it pops up?