Ask a Question

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

sindhu10
Contributor

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,

5 REPLIES 5
tristaanogre
Esteemed Contributor

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


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

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.

 

 

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?

Thanks!

Yes you are right

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

    Ans : If i do manually the window pop up in 5 mins but the application is open .

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

    Ans :Once the window pops up i need to select some options from that window.

Have you tried putting a breakpoint in and stepping through the code?  That would let you see exactly when the application is closing.

 

https://support.smartbear.com/testcomplete/docs/testing-with/debugging/breakpoints/using.html

cancel
Showing results for 
Search instead for 
Did you mean: