How to get/set Windows properties

Feb 24, 2009 at 10:13 PM
Hello,

how to get/set form property like Left, Top, Width....
I am trying to set window in specific position during my UI test.
I can get may window however how to access its properties?
-----------------------------------------------------

 

'RUN APP

 

 

Dim app As Core.Application = Core.Application.Launch(process)

 

app.WaitWhileBusy()

ICDApplication = app

 

'get main window

 

 

Dim winMain As UIItems.WindowItems.Window = app.GetWindow(mainWindowTitle, Factory.InitializeOption.NoCache.AndIdentifiedBy("ICDShell"))

 

winMain.WaitWhileBusy()

ICDShellWinInstance = winMain

-------------------------------------------------------

Thanks.
Zoran.
Feb 25, 2009 at 7:34 AM

Hi Zoran,

We can get the Location / Size from the properties winMain.Location / winMain.Bounds.

But I've no idea how to change the location / size :-(

Regards,
Kannan

 

Feb 25, 2009 at 10:15 AM

But we can do using control patterns like below,

 

TransformPattern pattern = winMain.AutomationElement.GetCurrentPattern(TransformPattern.Pattern) as TransformPattern;

 

pattern.Move(300, 300);

 

pattern.Resize(100, 100);

 

If it is possible through White, please let us know . . .

Thanks & Regards,

Kannan

Feb 25, 2009 at 9:06 PM
Hello Kannan,

it helped. Thank you.

However how we can get/set any window's or control's properties by using either UIAutomation or White?

Thanks.
Zoran.