Browser(”A”).Object.FullScreen always returns false IE8 and QTP 10

  • Questions
  • Browser(''A'').Object.FullScreen always returns false IE8 and QTP 10
Question ID: 104326
2
0

I am trying to determine whether the current open browser is full screen before sending the full screen command. Browser("A").Object.FullScreen always returns false whether the browser is set to Full Screen View or not. I have tried to get this to work in IE7 and IE8 using QTP 10. Anyone seen this problem before? Do I really need to use browser size to figure this out?

Thanks in advance…

Marked as spam
Posted by (Questions: 2, Answers: 0)
Asked on February 21, 2011 8:46 pm
24 views
Answers (3)
8
Private answer

You have to look at the ''Maximized property of the Window object instead.

wHandle = Window(''regexpwndtitle:=Windows Internet Explorer'', ''nativeclass:=IEFrame'').GetROProperty(''hwnd'')
If Window(''regexpwndtitle:=Windows Internet Explorer'', 
        ''nativeclass:=IEFrame'').GetROProperty(''maximized'')=''False'' Then 
Msgbox ''Browser is minimized''
 else
Msgbox ''Browser is maximized''
 End If 
Marked as spam
Posted by (Questions: 6, Answers: 167)
Answered on February 21, 2011 11:00 pm
So color me stupid but I can't get this to work either. When/iF QTP sees IE as a window and not a browser, GetROProperty(''maximized'') is always FALSE. What the heck am I missing here? Where's my WinRunner...
( at March 1, 2011 5:30 pm)
The problem is Windows has IE running all the time in the background. You need to use the index call to make sure you get the correct one. I add ''index:=1'' to your code and it works for QTP 11\10 and IE 7 and 8 This code works

wHandle = Window(''regexpwndtitle:=Windows Internet Explorer'', ''nativeclass:=IEFrame'', ''index:=1'').GetROProperty(''hwnd'')

If Window(''regexpwndtitle:=Windows Internet Explorer'',  ''nativeclass:=IEFrame'', ''index:=1'').GetROProperty(''maximized'')=''False'' Then 
     Msgbox ''Browser is NOT maximized'' 
Else
   Msgbox ''Browser is maximized'' 
End If

( at March 7, 2011 7:25 pm)
8
Private answer

Full screen is confusing because most get confused between Maximized and Theater Mode. Pressing F11 makes the browser go to Theater Mode(FullScreen). Below is code for working with TheaterMode. The FullScreen Attribute is always false for me. If you want to look at Maximized please look at post above.


myScreen=Browser(''Google'').object.TheaterMode

If myScreen Then
    msgbox ''IE is in Theater Mode (Full Screen)''
else
    msgbox ''IE is NOT in Theater Mode (Full Screen)''
End If

browser(''Google'').FullScreen

myScreen=Browser(''Google'').object.TheaterMode

If myScreen Then
    msgbox ''IE is in Theater Mode (Full Screen)''
else
    msgbox ''IE is NOT in Theater Mode (Full Screen)''
End If

browser(''Google'').FullScreen


Marked as spam
Posted by (Questions: 2, Answers: 98)
Answered on March 7, 2011 4:19 pm
Perfect. This was what I needed.
( at March 7, 2011 7:00 pm)
0
Private answer

Fllowing what the former answers are and you will find what you want i think true religion jeans

Marked as spam
Posted by (Questions: 0, Answers: 1)
Answered on March 8, 2011 7:53 am