Highlighted
Regular Contributor.
Regular Contributor.
4306 views

[UFT 14.03] Browser.close doesn't work anymore

Hi everybody,

on my script, for my needs, i use to open and close a website manually at the end of every  script with this simple command:

While Browser("Browser1").Exist(0)
    Browser("Browser1").Close
Wend

well, this command doesn't work anymore (IE9 and IE11). I'm a bit worried because i'm thinking this program is gong backwards with every new release... if i'm wrong please let me know how to solve this problem.

Thanks a lot.

0 Likes
10 Replies
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: [UFT 14.03] Browser.close doesn't work anymore

Hi,

Can you shed some more details? what does it mean that it is not working anymore?

What is not working? 

Tsachi

P.S. Why do say that this program is going backwards? 

0 Likes
Highlighted
Regular Contributor.
Regular Contributor.

Re: [UFT 14.03] Browser.close doesn't work anymore

Hi, sorry if i've been vague or rude on the previous post, but after i've updated to teh very latest version of UFT (14,03), nothing worked as expected because my script are based on closing by-code.

What i mean is that code doesn't close my browser (in details IE9 or IE11, i'm using these ones); that code loops.

Now i've done the rollback to v14.02 and those statement work perfectly.

What i don't understand is why a basic command like Browser().close doesn't work anymore...there should be more testing on UFT to ensure a better backward compatibility.

Thanks in advance

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: [UFT 14.03] Browser.close doesn't work anymore

Hi,

Let me assure you that UFT is being tested and is supports backwards comptabilitiy.

I've just tested the above code on all the browsers on my machine (IE11, Chrome and FF). It was working as it should. I'm using 14.03.

So a few more questions:

1. You are getting stuck in an inifite loop? Meaning, the code identifies the browser exist, reaches the "Close" line and nothing happens afterward?

2. Is the browser object identified?

Tsachi

Highlighted
Regular Contributor.
Regular Contributor.

Re: [UFT 14.03] Browser.close doesn't work anymore

1. You are getting stuck in an inifite loop? Meaning, the code identifies the browser exist, reaches the "Close" line and nothing happens afterward?

Yes. This is the case.

Many thanks!

0 Likes
Highlighted
Micro Focus Expert
Micro Focus Expert

Re: [UFT 14.03] Browser.close doesn't work anymore

real strange. 

Did something change in the way you are opening the browsers? Can you explain how you are opening the browser?

Can you please check if it is working on other browsers?

thanks,

Tsachi

0 Likes
Highlighted
Regular Contributor.
Regular Contributor.

Re: [UFT 14.03] Browser.close doesn't work anymore

Hi,

i define this at the very beginning of the script, using the global sheet

'define variables
data=mid(now(),7,4)&mid(now(),4,2)&left(now(),2)
get_url=Datatable.Value("URL",dtGlobalSheet)
brows=Datatable.Value("Browser",dtGlobalSheet)
amb=Datatable.Value("Ambiente",dtGlobalSheet)
cur_row=Datatable.GetCurrentRow
i=1

'opening browsers
If brows="IE" Then
    SystemUtil.Run "iexplore.exe" , get_url ,,,3
    Browser("name:=.*").Navigate(get_url)
    Browser("name:=.*").Sync
ElseIf brows="CHROME" Then
    SystemUtil.Run "chrome.exe" , get_url ,,,3
End If

.............................

'closing browsers
While Browser("creationtime:=0").Exist(0)
    Browser("creationtime:=0").Close
Wend

Many thanks.

0 Likes
Highlighted
Super Contributor.
Super Contributor.

Re: [UFT 14.03] Browser.close doesn't work anymore

temp.png

I used above code to a couple runs over 14.03 machine and also cannot reproduce the issue... so could you try more for checkinig:

1. Does it also happen for Chrome?

2. What about trying to change the description from creationtime to "micclass:=browser" ?

Highlighted
Regular Contributor.
Regular Contributor.

Re: [UFT 14.03] Browser.close doesn't work anymore

Hi. Sorry for the delay, i've been away from work.

I've tested deeply this thing, and found out that Firefox 59 and the latest Chrome close automatically, but not for Internet Explorer 9.

I know IE9 is a very very very old browser (if it wasn't for me i'd never do that), but for company policies we need to test their website there too.

You know of a workaround to make IE9 works ?

Thanks a lot.

0 Likes
Highlighted
Regular Contributor.
Regular Contributor.

Re: [UFT 14.03] Browser.close doesn't work anymore

OK, i think i've found something useful to make IE9 works.

Tried to change browser.close with browser.QUIT; i know it's not the same thing but at the moment it does the job.

Thanks a lot.

0 Likes
Highlighted
Knowledge Partner
Knowledge Partner

Re: [UFT 14.03] Browser.close doesn't work anymore

You could also use the commands:

 'Kill any browsers
 SystemUtil.CloseProcessByName("iexplore.exe")
 SystemUtil.CloseProcessByName("firefox.exe")
 SystemUtil.CloseProcessByName("chrome.exe")

Mark Smith.

 

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.