Highlighted
Trusted Contributor.
Trusted Contributor.
2076 views

Closing Chrome Browser UFT

chrome.PNG

I am trying to close chrome browser pop up. when there are pending changes on the page as a part of test scenario. But I could not get UFT to close chrome browsers. I treid the following

SystemUtil.CloseProcessByName

 

If Window("regexpwndclass:=Chrome_WidgetWin_1").Exist Then
            vHwnd = Window("regexpwndclass:=Chrome_WidgetWin_1").getroproperty("Hwnd")
            Window("hwnd:=" &vHwnd).Close
                        
        End If

chrome.PNG

Please help

Tags (1)
0 Likes
1 Reply
Highlighted
Absent Member.
Absent Member.

Re: Closing Chrome Browser UFT

Hi,

You can try a small shell script:

Dim objshell
Set objshell=CreateObject("WScript.Shell")
objshell.Run "TASKKILL /F /IM "& ProgramName(chrome.exe)
Set objshell=nothing

You can add this snippet at the end of your script or create a function.

+pavan

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.