![]() |
Maximize and Close a Browser - 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: Maximize and Close a Browser (/Thread-Maximize-and-Close-a-Browser) |
Maximize and Close a Browser - mv8167 - 01-13-2012 I have been trying the code below to Maximize and then close a Browser. But it is not working on line 4 , line 6 works Code: Browser("Browser").Page("Page").WebTable("Fax Status").Highlight(0) I also tried: Code: hWnd = Browser("Browser").GetROProperty("hwnd") But more than one Browser is open (i have 2 browsers open, only 1 called Browser) What is wrong with my logic? I see this code all over the web. thx RE: Maximize and Close a Browser - vinod123 - 01-17-2012 Browser("micclass:=Browser).Close RE: Maximize and Close a Browser - Munna.Sarfraz - 01-17-2012 This is the best way of closing Browser Code: Browser("Browser").Close For Maximize Code: hWnd=Browser("Browser").GetROProperty("hwnd") Note: Its best practice to maximize window, First get the handle of browser, then Activate then Maximize. Regards, Munna Sarfraz RE: Maximize and Close a Browser - mv8167 - 01-18-2012 thx Vinod123 and Munna Is it ok to use: Code: Window("hwnd:=" & hWnd).Close I am thinking that Browser("Browser").Close may close the wrong browser window? thx guys RE: Maximize and Close a Browser - Mike B - 03-26-2023 [quote pid='19664' dateline='1326799441'] Code: I had a General Run error when trying to get Regards, Mike [/quote] |