Micro Focus QTP (UFT) Forums
how to maximize a browser in QTP - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: how to maximize a browser in QTP (/Thread-how-to-maximize-a-browser-in-QTP)



how to maximize a browser in QTP - reejais - 09-17-2010

Hi All,

I have written a code like the below

Code:
Dim objIE
Set objIE= CreateObject("InternetExplorer.Application")
objIE.visible = True
objIE.navigate "........."
objIE.statusbar=1
wait(3)

now when I run it the browser does not open in maximized mode.

Could anybody tell me what can I add in this code to open it in maximized mode?
I dont want it to be in Full Screen but maximized mode.

Thanks in advance.

Regards,
Reema.


RE: how to maximize a browser in QTP - supputuri - 09-17-2010

Hi Reema,

Include the below line of code after "objIE.visible = True".
Code:
Window("hwnd:=" & objIE.HWND).Maximize

It will solve your requirement.

Let me know if you need any more information or have any questions on this.


RE: how to maximize a browser in QTP - reejais - 09-30-2010

Thanks.. It worked.

Regards,
Reema.


RE: how to maximize a browser in QTP - cdesserich - 10-01-2010

You can also launch the browser with SystemUtil or a WScript.Shell and specify the window state when opened (along with the startup URL). 3 = maximized.

Quote:SystemUtil.Run "iexplore.exe", "www.google.com", , , 3
Browser("micclass:=Browser").Sync

Quote:Dim wsh
Set wsh = CreateObject("WScript.Shell")
wsh.Run "iexplore.exe about:blank", 3, False
Browser("micclass:=Browser").Sync
Set wsh = Nothing