Micro Focus QTP (UFT) Forums

Full Version: maximize window function
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've writen a function to maximize browser but i want to make it public so that it can be use for different browser just passing the browser.
but i'm not able to do. here is my code
Code:
Function MaxBrowser()
MaxBrowser = False
If Browser("Gmail: Email from Google").exist(1) Then
   Browser("Gmail: Email from Google").page("Gmail: Email from Google").sync
   Browser("Gmail: Email from Google").fullscreen
endif
endfunction
when i call this function work for only my gmail..I want to make universal like can be used for yahoo,graffiti or different browser by passing browser("Gmail: Email from Google") .How can i pass Gmail: Email from Google as argument?

Thanks.
Try this

Code:
Function MaxBrowser()
MaxBrowser = False
If Browser("CreationTime:=0").exist(1) Then
Browser("CreationTime:=0").page("micClass:=Page").sync
Browser("CreationTime:=0").fullscreen
endif
endfunction