Tuesday 10 February 2015

UFT - QTP How to open a Browser using UFT and VB Script

                                        Link to Mandatory QTP /UFT Interview Questions to read before Interview


'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'Comments
'Author : Sreenu Babu
'Date :-
'Purpose :- To Open a Browser using UFT and VB Script
'Usage :- Call OpenApplication( www.google.com, google)
'~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Function OpenApplication( byval WebURL, byval BrowserTitleName)
BrowserTitleName = TitleName
ApplicationName = WebURL
 Set objIe = createobject("internetexplorer.application")
 objIe.visible = true
 objIe.navigate cstr(ApplicationName)
 wait 3
    If browser("name:=.*"& TitleName  &".*").exist(5) Then
  Reporter.ReportEvent 4,"OpenApplication", "Navigagtion to page  " & ApplicationName
  Reporter.ReportEvent micPass,"OpenApplication" , "Opened Applcaiton "&TitleName
  OpenApplication =0
  else
  Reporter.ReportEvent 4,"OpenApplication", "Navigagtion to page " & ApplicationName
  Reporter.ReportEvent micFail,"OpenApplication","Unable to open page "&TitleName
  OpenApplication =1
 End If
End Function


Regards,
Sreenu Babu

Post that you may be interested in
How to maximize Browser using QTP/UFT



                                        Link to Mandatory QTP /UFT Interview Questions to read before Interview

No comments:

Post a Comment