Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Maximize and Close a Browser
#1
Solved: 10 Years, 9 Months, 1 Week ago
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)
Browser("Browser").Page("Page").Sync
hWnd = Browser("Browser").GetROProperty("hwnd")
Window("hwnd:=" & hWnd).Maximize
Window("hwnd:=" & hWnd).Close

I also tried:
Code:
hWnd = Browser("Browser").GetROProperty("hwnd")
title= Browser("micClass:=Browser", "hwnd:=" & hWnd).GetROProperty("title")
Window("title:=" & title).Maximize

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
Reply


Messages In This Thread
Maximize and Close a Browser - by mv8167 - 01-13-2012, 08:36 PM
RE: Maximize and Close a Browser - by vinod123 - 01-17-2012, 04:12 PM
RE: Maximize and Close a Browser - by Mike B - 03-26-2023, 03:55 PM
RE: Maximize and Close a Browser - by mv8167 - 01-18-2012, 03:25 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Close popup ad windows dustwynn 1 2,758 10-25-2016, 05:57 PM
Last Post: Ankur
  [UFT] Close opened folder robertosalemi 1 3,164 02-10-2016, 07:06 PM
Last Post: robertosalemi
  Close browser code not working akilamurugesh 1 4,471 08-26-2014, 03:21 PM
Last Post: vinod123
  Close on Exit Issue in QTP 11.0 EGBELL 1 3,070 02-02-2014, 03:39 PM
Last Post: EGBELL
  Unable to close new tab pradeep singh 3 8,754 03-05-2013, 09:43 AM
Last Post: pradeep singh

Forum Jump:


Users browsing this thread: 1 Guest(s)