How to wait for a window and using regex

Oct 18, 2010 at 11:01 AM

Hello People,

          I am facing problem in using regex and waiting till the window appears. 

After I login, the window which throws up has the title format as - "ApplicationName version - ServerIP". I wanted to use only the "ApplicationName". 

Application myApp = Application.AttachOrLaunch(Path);

Window mainWindow = myApp.GetWindow(new RegEx("ApplicationName*"));

The Above like is giving the problem saying that the arguments are invalid. 

I was also suppose to wait till this window shows up. I was trying "WaitTill". Could anyone please throw some light on the same. 

 

Rohith

Oct 18, 2010 at 11:32 AM

Hi

this can't work

try

 

Window main = myApp.GetWindows().Where(p=>p.Title.Contains(ApplicationName)).First();

 

Throndorin

Oct 18, 2010 at 1:09 PM

Cool :) It works. Thanks. 

I am now able to get on to this window.

But, for me to wait till this window pops up, how can I get hold of the window object as we are using GetWindows() method.

Cos, when I run this line of code, the login screen is still loading our app :(