How to start a new IE session with Watin

I need to know how to start a browser instance, but with a new session. I tried to clear the cookies and clear the cache, but that does not give me what I need.

In my case, I add products to the basket, then close the browser, and then use a different URL that adds another product, but always the old products are still in the basket.

+4
source share
6 answers

for IE6-7 you must start a new browser session in a new process, for example:

var ie = new IE("yoururl", true); 

for IE8-9 you must set the no-merge option in the settings class before creating a new instance of IE:

 Settings.MakeNewIe8InstanceNoMerge = true; var ie = new IE("yoururl"); 
+5
source

Make sure you close the browser properly (i.e. close all your tabs and windows, including loading, etc.). Look at the task manager to see if everything works. A session may not be cookie-based (for example, it can be tracked in the same process that processes the request), and clearing the browser cache will not affect open sessions.

Assuming you are developing an asp.net application or website, you can try right-clicking the ASP.NET Development Server icon in the taskbar and stop it, and then restart the project. This should kill all sessions.

0
source

We had the same problem. IE reuses the session in all browser instances. If you want the new session to simply do:

Alt (menu) → File → New Session

Check this blog for more information .

0
source

Sessions are managed by cookies, you can clear all your cookies or just for the corresponding site.

Try Finding IE Cookie Cleaner

0
source

In IE 9, there is another way not to clear all cookies. If you open the "Clear Cookies" dialog box in the "Options" menu in IE 9, you will notice that the first options are "Save Website Data." Leave this unchecked and regular cookie boxes, the browser should work.

Let me know if this helps, I think this should do the trick;)

0
source

I will try to do this soon in WatiN, but just testing with my command line switches, it looks like I can open multiple instances using

 iexplore.exe -private -nomerge 

and each instance will not interfere with the others.

This means that it allows you to log in using different users on the same website, and they will not interfere with each other.

This needs further verification, but so far it works.

update: I found this old patch for WatiN that adds a privacy function to the watin library, it is not currently displayed in the release http://sourceforge.net/tracker/?func=detail&aid=3013950&group_id=167632&atid=843730

0
source

All Articles