Many a times you would have noticed that if you open a new browser window using QTP (or otherwise also) the browser is not in maximized mode by default. And in certain cases, you would really need the browser to be in maximized state (like for better readability). In this article, we’ll see how you can maximize and minimize your browser windows using QTP. Unfortunately, there is no direct method to achieve this task as the Browser object does not support Maximize/Minimize actions. The only way to go about this task is to follow some workaround to achieve the desired results. This article is about these indirect methods.
Using Browser Handle with Window Object. Even though Browser object doesn’t provide any methods to maximize/minimize browsers, you have the maximize/minimize functions available with standard Windows object. Hence, you can retrieve the Handle from your Browser object & use the same Handle with the Window object to maximize/minimize your browser. Let’s see few examples for the same –
Sample Script 1: Maximizing a Browser This example maximizes a browser if it is already not maximized and is maximizable.
Using Browser Handle with Window Object. Even though Browser object doesn’t provide any methods to maximize/minimize browsers, you have the maximize/minimize functions available with standard Windows object. Hence, you can retrieve the Handle from your Browser object & use the same Handle with the Window object to maximize/minimize your browser. Let’s see few examples for the same –
Sample Script 1: Maximizing a Browser This example maximizes a browser if it is already not maximized and is maximizable.
Please note that this example fetches the value of hwnd using
hwnd = Browser(“CreationTime:=0”).Object.HWND
rather than using
hwnd = Browser(“CreationTime:=0”).GetROProperty(“hwnd”).
This is because you would find 2 hwnd values for the browser using Object Spy – One available in Identification Properties & one in Native Properties, and both the hwnd properties would have different values. And we should be using the Native HWND Property. Vivitar image manager for mac. Refer the below image for hwnd values.
hwnd = Browser(“CreationTime:=0”).Object.HWND
rather than using
hwnd = Browser(“CreationTime:=0”).GetROProperty(“hwnd”).
This is because you would find 2 hwnd values for the browser using Object Spy – One available in Identification Properties & one in Native Properties, and both the hwnd properties would have different values. And we should be using the Native HWND Property. Vivitar image manager for mac. Refer the below image for hwnd values.
1 Starting and closing Firefox. Mozilla Firefox, or Firefox, is a modern web browser. The generic term 'web browser' simply means a program that is made for a particular purpose, e.g. Surfing the Web. This chapter demonstrates the difference between opening and closing. A) the web browser named Firefox,. B) a new web page in Firefox. On Windows, use Alt-spacebar-N to minimize Firefox (or any active window). Close current tab or window. This shortcut saves you from needing to click the little X to close a tab. Instead, use.
Start Firefox in Safe Mode to check if one of the extensions (Firefox/Tools Add-ons Extensions). I now have the familiar symbols which enable me to Minimize, Maximize, and Close the page.in the upper right corner of the page. Without these symbols, I felt like the hero from Robert Heinlein's 'Stranger in a Strange Land.' Mozilla Suite and Mozilla Seamonkey Keyboard Shortcuts for Navigator, Mail & Newsgroups, Composer, Address Book and Help window: the keyboard shortcuts are provided for Windows, Mac and Linux operating systems.
Hwnd values from Native & Identification Properties
![Firefox Firefox](https://user-media-prod-cdn.itsre-sumo.mozilla.net/uploads/images/2013-11-13-06-32-22-e6f60b.png)
Sample Script 2: Minimizing a Browser This example minimizes a browser if it already not minimized and is minimizable.
Kaspersky endpoint security 10 databases are corrupted.
Sample Script 3: Use HWND with Descriptive Programming for Maximizing/Minimizing a Browser In this example, the browser properties are not stored in Object Repository, but are taken using Descriptive Programming.
Sample Script 3: Use HWND with Descriptive Programming for Maximizing/Minimizing a Browser In this example, the browser properties are not stored in Object Repository, but are taken using Descriptive Programming.
Maximizing/Minimizing a Browser while Opening. Here you can make sure that whenever you open a browser using SystemUtil.Run method, it is always opened in Maximized/Minimized mode. Let’s see how this can be done.
Sample Script 4: Use of SystemUtil.Run In this example, the browser will be opened in maximized/minimized mode.
Sample Script 5: Use of WScript.Shell RunThis example uses WScript.Shell to open a new browser in maximized/minimized mode.
Minimize On Start And Close For Firefox Free
This was all about this article where you saw various methods to minimize/maximize a browser using QTP. Do you know of any other method that has not been mentioned here? Share your thoughts using the Comments section. Happy Reading. :->
If you enjoyed this article, you can join our blog to get free email updates directly in your inbox.
Minimize On Start And Close For Firefox Chrome
Related posts: