History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: SRC-384
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jennifer Bevan
Reporter: Dan Fabulich
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Selenium Remote Control

WindowsProxyManagerTest.testHidePreexistingCookiesNoDestDirWithPrefix fails

Created: 10/Nov/07 03:28 PM   Updated: Tuesday 06:46 AM
Component/s: Launcher - Internet Explorer
Affects Version/s: None
Fix Version/s: 1.0 beta 1

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown
Environment: WinXP


 Description  « Hide
This code seems to be very troubled on WinXP. I can identify two problems that seem pretty serious when put together:

1) The "cookie:*" files are present in the "Temporary Internet Files" directory on WinXP as well as Windows Vista. Not really sure why this code is marked as Vista-specific.
2) On Windows, you can't use Java to create/copy a file whose name contains a colon ":". It's technically illegal for file names to contain a colon on Windows. The "Temporary Internet Files" directory is a kind-of magic pseudo-directory on WinXP (and I believe on Vista also) that allows for those files to be created.

Anyway, the result of this is that the setup for this test fails when it attempts to create a temporary file whose name starts with "cookie:", as follows.

junit.framework.AssertionFailedError: expected:<1> but was:<0>
at org.openqa.selenium.server.browserlaunchers.WindowsProxyManagerTest.testHidePreexistingCookiesNoDestDirWithPrefix(WindowsProxyManagerTest.java:99)

 All   Comments   Work Log   Change History      Sort Order:
Dan Fabulich - 10/Nov/07 03:29 PM
In revision 2081 I checked in a workaround that uses "cookie" as the cookie prefix instead of the real Vista cookie prefix "cookie:".

Jennifer Bevan - 12/Nov/07 09:57 AM
<*shakes head*>
I can't even begin to describe how much time you just saved me with that bit of knowledge about the colon.
Hmmmph!

So -- in terms of the user cookies then, on WinXP hiding the ones that showed up in the $USERPROFILE/Cookies
directory solved our problem where one test didn't delete its cookies and a successive test tried to log into the
same site with a different username. But on Vista, that directory is not accessible (unless that's just a configuration
issue?), which is why I tried the Temporary Internet Files approach. If you have a smarter way of approaching this,
I'm all ears :)

Thanks,
-Jen

Jennifer Bevan - 27/Nov/07 02:13 PM
I have a possible fix; testing now...

Jennifer Bevan - 30/Nov/07 03:31 PM
the change committed in revision 2090 should fix this problem and addresses Dan's concerns above.
The same tests fail for version 2089 as do in 2090, and all unit tests pass, on both linux and winxp systems.
I should point out that the winxp tests fail only on jason's vmware instance, and the linux tests that fail
are related to SRC-370

Jennifer Bevan - 30/Nov/07 03:33 PM
Changes the approach used to one that actually works properly with WinXP and Vista.
Previously the wrong vista cookies directory was being checked, where in reality the
one linked to the (not accessible) %USERPROFILE/Cookies directory is the correct
folder. Furthermore, only hides files in these directories ending in '.txt', and does not
try to create any file with a colon in the name :P.