Difference between IE6 and IE7
This article will take you over various differences between Internet Explorer 6 (IE6) and Internet Explorer 7 (IE7). These difference would be from QTP automation perspective
Difference #1 - Alert dialog title
IE6 alert dialog title is “Microsoft Internet Explorer” and for IE7 the alert dialog title is “Windows Internet explorer”
Both windows can be easily supported at the same time in QTP by using regular expression “(Windows|Microsoft) Internet Explorer”. The statement is true whether we use object repository or descriptive programming.
Difference #2 - Multiple Tab windows
IE7 supports multiple tabs. QTP 9.2 supports IE7 but with tabs setting disabled, QTP 9.5 supports testing IE7 with tabs also. So is there any other difference because of these tabs? Because if IE7 tabs QTP now identifies the each tab as a Browser and not the whole window as a Browser. The statement would become clear when we look at the below code
Maximizing IE6 Browser
Dim hwndBrw hwndBrw = Browser("Browser").GetROProperty("hwnd") Window("hwnd:=" & hwndBrw).Maximize |
But when we run the same code in IE7 QTP throws below error
The reason for this error is that the handle of the window that we receive is not the main browser window handle but the sub window handle (TAB) which cannot be maximized. To receive the main window handle we would need to use Windows API
Dim hwndBrw, hwndWindow hwndBrw = Browser("Browser").GetROProperty("hwnd") Const GA_ROOT = 2 'Declare Function GetAncestor Lib "user32.dll" (ByVal hwnd As Long, ByVal gaFlags As Long) As Long Extern.Declare micLong, "GetMainWindow", "user32" ,"GetAncestor",micLong, micLong 'Get the main IE window handle hwndWindow = Extern.GetMainWindow(hwndBrw, GA_ROOT) Window("hwnd:=" & hwndWindow).Maximize |
Note: Above code will work on IE6 as well
Difference #3 - Certificate Security error
The way IE7 present certificate error is completely different from way IE6 does it
Handling the IE7 security error is as easy as it gets
If Browser("KnowledgeInbox").Page("IE7").Link("text:=Continue to this website \(not recommended\)\.").Exist Then Browser("KnowledgeInbox").Page("IE7").Link("text:=Continue to this website \(not recommended\)\.").Click End If |
or
If Browser("KnowledgeInbox").Page("IE7").Link("html id:=overridelink").Exist Then Browser("KnowledgeInbox").Page("IE7").Link("html id:=overridelink").Click End If |
These are 3 key differences IMO which needs to taken care of in case both IE6 and IE7 needs to be supported by QTP scripts.











