Sunday, 4 January 2015

Different ways to Maximize and Minimize a Browser using QTP

Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "%{ }"
wait(3)
WshShell.SendKeys " x"
Set WshShell=Nothing
wait(2)


--

mode_Maximized = 3 'Open in maximized mode
mode_Minimized = 2 'Open in minimized mode

Set WshShell = CreateObject("WScript.Shell")
WshShell.Run "iexplore.exe http://www.google.com", mode_Maximized, False
WshShell.Run "iexplore.exe http://www.
google.com", mode_Minimized, False
Set WshShell = Nothing


--

'Create an object of Internet Explorer type
Set oIE= CreateObject("InternetExplorer.Application")
oIE.visible = True
oIE.navigate "http://www.automationrepository.com"
 Wait(5)
'Maximize the Browser Window
Window("hwnd:=" & oIE.HWND).Maximize

'Minimize the Browser Window
Wait(2)
Window("hwnd:=" & oIE.HWND).Minimize

No comments:

Post a Comment