cancel
Showing results for 
Search instead for 
Did you mean: 

How to make TC to wait till an un known window open

siddhu
Contributor

How to make TC to wait till an un known window open

Hi

   After clicking a button, there may come any one of below windows



Sys.Process("CDS").VBObject("frmStartup")

Sys.Process("CDS").VBObject("frmOpenOrDelete")



I dont know which window will come.But any one of these two will come depending on the situation.

I want to wait TestComplete to wait till any one of these window opens.

It takes some time to open the window.It is a windows application.It is not a web application



How to do this


5 REPLIES 5
kashikar_harsh
Contributor

RE: How to make TC to wait till an un known window open

Try using while (!Sys.Process("CDS").VBObject("frmStartup").Exists || !Sys.Process("CDS").VBObject("frmOpenOrDelete").exists) off course with some timeout. So your function may look like



var timeout = 0;

While (timeout < 100)

{

     if ( !Sys.Process("CDS").VBObject("frmStartup").Exists || !Sys.Process("CDS").VBObject("frmOpenOrDelete").exists)

          break;

   timeout++

}

if ( timeout == 100 )

{

      Log.Error ("No window exists");

}
kashikar_harsh
Contributor

RE: How to make TC to wait till an un known window open

Please read

if ( Sys.Process("CDS").VBObject("frmStartup").Exists || Sys.Process("CDS").VBObject("frmOpenOrDelete").exists)

          break;



in the above comment
siddhu
Contributor

RE: How to make TC to wait till an un known window open

Hi Harshad

        Thanks For immediate Response

        

        Can we do it using Wait Object?
kashikar_harsh
Contributor

RE: How to make TC to wait till an un known window open

I could not understand what do you mean by Wait object. But every control has wait property that can be accessed exactly as I mentioned in the code.



Regards,

Harshad

RE: How to make TC to wait till an un known window open


Hi Siddhardha,





You can use the WaitVBObject method to accomplish your task. Read the "WaitVBObject Method" article for more information.
--
Dmitry Nikolaev

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors