Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to maximize a browser in QTP
#1
Solved: 11 Years, 4 Months ago
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.
Reply
#2
Solved: 11 Years, 4 Months ago
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.
Thanks,
SUpputuri
Reply
#3
Solved: 11 Years, 4 Months ago
Thanks.. It worked.

Regards,
Reema.
Reply
#4
Solved: 11 Years, 4 Months ago
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
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Maximize and Close a Browser mv8167 4 16,664 03-26-2023, 03:55 PM
Last Post: Mike B
  error object disabled on line 9 where it says " Browser("Browser").CloseAllTabs" kp_usa 1 3,363 12-20-2012, 12:20 AM
Last Post: adityapant27
  My IE Browser Recognizing as Window instead of Browser. sivakrishna 4 9,109 02-11-2012, 12:19 AM
Last Post: ravi.gajul
  Clicking an item in the context menu opens up browser(IE6) but in same browser of QC pjavvaru 2 4,414 04-10-2010, 02:16 AM
Last Post: jsknight1969
  Maximize browser? 1981.madhu@gmail.com 2 8,976 12-29-2009, 12:14 PM
Last Post: 1981.madhu@gmail.com

Forum Jump:


Users browsing this thread: 1 Guest(s)