Maximize browser using QTP and IE8 / IE7 / Firefox


Problem : Maximize a tabbed browser (ie7/ie8/firefox)
Solution1:  hwnd=Browser("name:=myBrowser").getROProperty("hwnd")
               Window("hwnd:="&hwnd").Maximize
Disadvantage:  Does not work with tabbed browsers consistently

Solution2: hwnd=Browser("name:=myBrowser").Object.HWND
              Set objWindow=Window("hwnd:="&hwnd2)
              objWindow.Maximize
Disadvantage:  Does not work with tabbed browsers when there are multiple browsers open
 

Solution3:
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe",URL,"C:\","open","3"

The "3" at the end Activates and Maximizes the window.
Disadvantage:  Does not work when the browser is already open 


Solution4: Set WshShell = CreateObject("WScript.Shell")
               'Alt Space X - shortcut to maximize ie browser.
                WshShell.SendKeys "% x"

Hope this helps as always :)
Happy Testing!

Comments

  1. Hi,

    First of all want to Thank You for your useful post.
    This Software Testing article is very useful for me. I would like to introduce another good site which is having Software testing and QTP content, Have a look.
    QTPbook

    ReplyDelete
  2. Hi,

    Technology Specific Guide for QTP is a new book that has got great feedback from all the readers. It will get you started on the path of automation, introducing solutions, roadblocks, patches and ideas that will give you a solid foundation in the field of automation. Everyone from a novice user to an automation expert will have something they would have never heard of or used.

    http://bluemagic-automation.blogspot.in/

    Best Regards,
    Aditya.

    ReplyDelete

Post a Comment

Popular posts from this blog

Software Testing @ Microsoft

Trim / Remove spaces in Xpath?