10-22-2012, 06:22 PM
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
can anyone please help me
Thanks
Tanya
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