Code for Maximizing/Minimizing Browsers

There is no Browser.Maximize method in QTP. However, we can use the following workaraound to maximize a browser :-

hwnd = Browser(“CreationTime:=0”).Object.HWND    ‘getting the Handle 

Window(“hwnd:=” & hwnd).Maximize     ‘Using the maximize method of Window object to maximize it

Window(“hwnd:=” & hwnd).Minimize     ‘Using the minimize method of Window object to minimize it

Happy Automating !

Harshit Kohli

 

Advertisements

Eat, Sleep, Automate. REPEAT !

Tagged with: , , , , , , , ,
Posted in Code Vault
2 comments on “Code for Maximizing/Minimizing Browsers
  1. Eeshan says:

    Short and sweet solution! I like it! 🙂

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Blog Stats
  • 168,130 hits
Categories

Enter your email address to follow this blog and receive notifications of new posts by email.

Join 796 other followers

%d bloggers like this: