Header Ads

Get Browser Title in QTP

Here is a small function that can be used to get Browser Title.

Function GetBrowserTitle()
set sbrowser=Description.create()
' we are creating a blank object named as sbrowser.
sbrowser("micclass").value="Browser"
' we are assigning the sbrowser object as "Browser
set obj=Desktop.childObjects(sbrowser)
icount=obj.count
if(icount<>0) then
GetBrowserTitle=Browser("creationtime:="&icount-1).GetROProperty("title")
end if
Set sbrowser=Nothing
set obj=Nothing
End Function


Powered by Blogger.