Tricentis Tosca 16.0 Released on Feb-2023 ----- UFT has been upgraded from UFT 15.0.1 to UFT One 15.0.2, Beginning at November 2020.

Thursday, 2 May 2019

Write Code to get title of all open browsers... ?

Function GettitleAllbrowsers()
  
    GettitleAllbrowsers=""
    Set objBrowser = Description.Create
    objBrowser("micclass").Value = "Browser"
      
    'Get all browsers instances in ObjBrowserLst
    Set objBrowserLst=Desktop.ChildObjects(objBrowser)
         
    'Get the count of all the browsers open
     browsercnt=objBrowserLst.count
     For i = 0 To objBrowserLst.count-1
         'Store title of the Page in a variable 
          GettitleAllbrowsers=GettitleAllbrowsers+Vbnewline&">"+objBrowserLst(i).GetROProperty("title")
     Next
   
     Set objBrowser=nothing
     Set objBrowser=nothing
  
End Function

Call GettitleAllbrowsers()

Msgbox GettitleAllbrowsers



No comments:

Post a Comment

Note: only a member of this blog may post a comment.