Absent Member.
Absent Member.
2235 views

UFT opening browser with old session for IE Browser

Hi

I am automating a website where a user can login with different roles.But, after performing a operation with a specific roles when i am again opening the browser for another roles then UFT is opening browser with old session.


Note: This issue is occuring if i am running all the test cases in a suite. If i am running the scripts individually then it's working fine.

Moreover, I am also using a function to delete all the cookies and clear caches before opening the browser by using the command "RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255"

Please help on this.

0 Likes
6 Replies
Absent Member.
Absent Member.

Can anyone please help on this...

0 Likes
Absent Member.
Absent Member.

Couple of things you can try -

1. Use systemutil.closeprocessbyname "iexplore.exe" to close

2. In IE browser settings select the option 'delete browsing history on exit'

See if it helps.


Accept as solution/Give Kudos to the author if the piece of information answered/helped you to solve your problem.
All the thoughts here are mine not related to my employer nor anyone.
0 Likes
Absent Member.
Absent Member.

Hi Swaroop,

 

Thanks for yor reply, I 'll try these options as mentioned by you. But, currently i am closing the browser using command "Browser("Browser").Close"

Will try and let you know the result.....

Regards,

Gaurav

0 Likes
Absent Member.
Absent Member.

Hi Swaroop,

I tired both options but no luck...

If i am using systemutil.closeprocessbyname "iexplore.exe" then it's closing all the browser and ALM too but i dont want to close the ALM. For this i am using separate function to close all the browser except ALM.

for second one i tried but still same issue is occurring. Let me exaplain in details what is happening.

Suppose i have 15 test cases for one role and then 15 for others and so on. I have putted then in a sequence that all the 15 for one role will be executed first then i am chaning the role using role change function and then next 15 scripts are started and working fine. But, after some scripts say 7-8 scripts for second role are executed then UFT is opening the browser with first role while it should open browser with latest role. I have tried to run teh suite for several time and everytime it's opening the old session browser for same script.

Please suggest something...

Regards,

Gaurav

 

0 Likes
Absent Member.
Absent Member.

Can anyone has idea why it's happening, what causing UFT to open browser with old session  only if i am running scripts in a suite via ALM whereas all the scripts are working fine individually.

 

0 Likes
Admiral
Admiral


@GauravSaini wrote:

If i am using systemutil.closeprocessbyname "iexplore.exe" then it's closing all the browser and ALM too but i dont want to close the ALM.

 


Guess there may be 2 possible causes for the current behaviour.

1). You are not closing the browser completely but  closing just one of them. I think IE retains the cookies & restores them back.

Read the section Session Cookies here for more info.

https://blogs.msdn.microsoft.com/ie/2008/07/28/ie8-and-reliability/

2). You are trying to clearing the Cookies with the below command, which only clears the cookies in 'Un Protected' IE.

"RunDll32.exe InetCpl.cpl,ClearMyTracksByProcess 255"

 

Guess you are by default running in Protected Mode & hence the command won't delete all the cookies.

You can try the different options to run the command with more premissions as described here.

http://www.winhelponline.com/blog/clear-ie-cache-command-line-rundll32/

 

Alternately you can close all the browsers including ALM and check if that clears the Session Cookies. Why do you need ALM up, when you are running your tests? Can't you run it on another host machine if you want to trigger it yourself?

_____________________
Rajkumar Rajangam
0 Likes
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.