Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Unable to identify unque properties of chrome browser
#1
Not Solved
Hi

My task is to close all the Browsers execpt HP qc and my application browser which is in chrome,

iam using chrome 22

here the code

Code:
fncloseIEBrowsers
fnCloseChromeBrowsers

Function  fnCloseIEBrowsers()

    Dim objDesc, objmyBrowsColl,intItr,strBrowserName

    'systemutil.CloseProcessByName "chrome.exe"

    Set objDesc = Description.Create()
    objDesc("micclass").Value = "Browser"
    objDesc("version").Value ="internet explorer.*"
    objDesc("hasmenubar").value = "True"
    Set objmyBrowsColl = Desktop.ChildObjects(objDesc)
    For intItr =0 to objmyBrowsColl.Count -  1
            strBrowserName = objmyBrowsColl(intItr).GetROProperty("title")
            print  strBrowserName
        If InStr(1,strBrowserName,"HP Quality Center") Then
            Else
                objmyBrowsColl(intItr).Close
            End If
    Next

    Set objmyBrowsColl = Nothing
    Set objDesc = Nothing
  
End Function

Function  fnCloseChromeBrowsers()

    Dim objDesc1, objmyBrowsColl,intItr,strBrowserName1

    Set objDesc1 = Description.Create()
    objDesc1("micclass").Value = "Browser"
    objDesc1("application version").Value ="Chrome 22.0"
    objDesc1("title").Value ="ISL Dashboard"
    Set objmyBrowsColl = Desktop.ChildObjects(objDesc1)
    
    For intItr =0 to objmyBrowsColl.Count - 1
           strBrowserName1 = objmyBrowsColl(intItr).GetROProperty("title")
            
            If InStr(1,strBrowserName1,"ISL Dashboard") Then
                
            else
        objmyBrowsColl(intItr).Close
            End If
    Next
    Set objmyBrowsColl = Nothing
    Set objDesc1 = Nothing
  
End Function


can anyone please help me

Thanks
Tanya
Reply
#2
Not Solved
Hi,

Could you please specify the error msg u r getting.

Regards,
Sankalp
Reply
#3
Not Solved
Hi

Iam getting "unable to identify the object uniquely please add more properties to identify object uniquely
The. Problem is whenever execution starts it identifies hpqc then c
Then throws error

Childobjects count getting wrong
Reply
#4
Not Solved
Hi,

Use the below code 4 reference, it might help u;
Code:
bIndex = 0 'Set Browser index to 0
While Browser("CreationTime:="&bIndex).Exist(1) 'Loop untill the last browser
    bTitle = Browser("CreationTime:="&bIndex).GetROProperty("title") 'Get the browser title
    If InStr(bTitle,"Google") = 0 And InStr(bTitle,"Yahoo") = 0 And InStr(bTitle,"Gmail") = 0 Then
        Browser("CreationTime:="&bIndex).Close 'If the title doesn't contain Google or Gmail or Yahoo, close it
        If bIndex <> 0 Then
            bIndex = bIndex - 1 'If browser index is more than 0 and a browser is closed, decrease the index value by 1
        End If
    Else
        bIndex = bIndex + 1 'If no browser is closed for certain run, increase the index value by 1
    End If


Regards,
Sankalp
Reply
#5
Not Solved
Hi Thanks for the Reply

i have used your code


Code:
'
bIndex = 0 'Set Browser index to 0
While Browser("CreationTime:="&bIndex).Exist(1) 'Loop untill the last browser
bTitle = Browser("CreationTime:="&bIndex).GetROProperty("title") 'Get the browser title
b1Title = Browser("CreationTime:="&bIndex).GetROProperty("text")
  If InStr(b1Title,"HP Quality Center") = 0 And InStr(bTitle,"ISL Dashboard") = 0 Then
     Browser("CreationTime:="&bIndex).Close 'If the title doesn't contain Google or Gmail or Yahoo, close it
             If bIndex <> 0 Then
                                                                                              bIndex = bIndex - 1 'If browser index is more than 0 and a browser is closed, decrease the index value by 1
  End If
    Else
       bIndex = bIndex + 1 'If no browser is closed for certain run, increase the index value by 1
                   End IF

it is able to close the IE browsers sucessfully but not able to close the other opened chrome browsers Sad
Reply
#6
Not Solved
Hi ,

I am also facing the same isssue as discussed above i.e. unable to close google chrome tabs. (successfully closed tabs of IE and mozilla but not of chrome).

Anybody having solution for chrome browser?

Thanks & Regards
Pradeep Singh
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  UFT24.2 and Chrome Browser is not resnponding mode kotaramamohana 0 76 11-12-2024, 05:33 PM
Last Post: kotaramamohana
  Unable to identify multilevel headers of JTable dharanikesav 0 1,456 01-16-2017, 07:09 PM
Last Post: dharanikesav
  Unable to get properties of JavaObject in contextual menu amit25007 1 1,795 12-18-2015, 12:27 PM
Last Post: vinod123
  Cannot find the "[ WebEdit ]" object's parent "[ Browser ]" (class Browser). Verify t Divya Roopa 1 8,474 03-11-2014, 12:13 PM
Last Post: devarapallliramana
Rolleyes QTP 11 not identify PDF Browser laxminaranaya 1 2,399 02-25-2014, 01:34 PM
Last Post: guin.anirban

Forum Jump:


Users browsing this thread: 1 Guest(s)