views:

15

answers:

1

Selenium has the deleteallvisiblecookies construct which deletes all cookies when the tests run in the same domain.

For products that invoke access control e.g. typically the URL is trapped by the access manager product and the user is redirected to a different domain to log-in and then redirected back to the original URL is the login is successful, this doesn't seem to work

As per the Selenese documentation:

To delete a cookie, you need to delete it using the exact same path and domain that were used to create the cookie. If the path is wrong, or the domain is wrong, the cookie simply won't be deleted.

I can't seem to get all the cookies deleted in this kind of multi-domain environment.

We use Java and Selenium RC to run these tests - typically using Firefox but some IE.

Has anyone got some Java code samples or some suggestions that I could use to resolve this?

A: 

I don't think you can. The Java part of Selenium RC is just controlling the browser using JavaScript that it generates. Everything executes in the browser, so the usual cross-domain rules apply.

The only thing I can think of is making some proxy page that looks like it is coming from the access manager domain and have that one delete "its" cookies. Selenium RC already includes a proxy (that is how it works), maybe there is a way to add some fake pages to the proxied domains.

Thilo