Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Browser Activate
#1
Solved: 11 Years, 4 Months ago
Hi

could anybdy let me know how to ativate the browser window/Page through the code.
(As we do for Window("Name").Activate)

Thanks
Ramesh
Reply
#2
Solved: 11 Years, 4 Months ago
Its not required when you are using QTP to activate the browser before working on it. can you please explain the issue?
anyway you can do this using handle of the browser
Code:
hwnd=Browser("Login").GetROProperty("HWND")
Window("HWND:=" & hwnd).Activate
I doubt it will not work in QTP 9.2 and later

Reply
#3
Solved: 11 Years, 4 Months ago
Hi Activate,

I had some task of taking bitmaps for the objects but when i say the command to capture bitmap (browser("title:=Find a Flight: Mercury Tours:").page("title:=Find a Flight: Mercury Tours:").webtable("name:=Home").CaptureBitmap "C:\123.png",1 ) then at that time my focus was not on the Page (it was on QtP). So instead of taking the bitmap for webtable it was capturing somrthing else

Now I tried ur which worked fine for me

Code:
hwnd_FindFlight = browser("title:=Find a Flight: Mercury Tours:").page("title:=Find a Flight: Mercury Tours:").GetROProperty("hwnd")
Window("hwnd:="+cstr(hwnd_FindFlight)).Activate
browser("title:=Find a Flight: Mercury Tours:").page("title:=Find a Flight: Mercury Tours:").webtable("name:=Home").CaptureBitmap "C:\123.png",1

Thanks
Ramesh Tahiliani
Reply
#4
Solved: 11 Years, 4 Months ago
OK... thats great man.
Activate??? Smile

Always wrap your code with proper tags to make your post much readable.

Reply
#5
Solved: 11 Years, 4 Months ago
I had some task of taking bitmaps for the objects but when i say the command to capture bitmap (browser("title:=Find a Flight: Mercury Tours:").page("title:=Find a Flight: Mercury Tours:").webtable("name:=Home").CaptureBitmap "C:\123.png",1 ) then at that time my focus was not on the Page (it was on QtP). So instead of taking the bitmap for webtable it was capturing somrthing else

Now when I tried ur code and it worked fine for me

Code:
hwnd_FindFlight = browser("title:=Find a Flight: Mercury Tours:").page("title:=Find a Flight: Mercury Tours:").GetROProperty("hwnd")
Window("hwnd:="+cstr(hwnd_FindFlight)).Activate
browser("title:=Find a Flight: Mercury Tours:").page("title:=Find a Flight: Mercury Tours:").webtable("name:=Home").CaptureBitmap "C:\123.png",1

Thanks
Ramesh Tahiliani


sorry by mistake i wrote Activate instead of your name
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  error object disabled on line 9 where it says " Browser("Browser").CloseAllTabs" kp_usa 1 3,343 12-20-2012, 12:20 AM
Last Post: adityapant27
  Working with SAPGuiTree - Search and Activate Node Ankesh 0 6,359 10-15-2012, 05:15 PM
Last Post: Ankesh
  My IE Browser Recognizing as Window instead of Browser. sivakrishna 4 9,094 02-11-2012, 12:19 AM
Last Post: ravi.gajul
  Script not getting for Notepad activate pupuns2 2 3,670 04-13-2011, 10:37 AM
Last Post: Dhruvaljoshi
  Clicking an item in the context menu opens up browser(IE6) but in same browser of QC pjavvaru 2 4,386 04-10-2010, 02:16 AM
Last Post: jsknight1969

Forum Jump:


Users browsing this thread: 1 Guest(s)