ghostdriver icon indicating copy to clipboard operation
ghostdriver copied to clipboard

Allow specifying path for storing cookies

Open kasatani opened this issue 8 years ago • 4 comments

In current implementation of ghostdriver there is no way to load cookies when starting a session. Passing --cookies-file to phantomjs doesn't work because ghostdriver's session.js creates a new cookie jar without any argument, which doesn't allow us to load or save cookies.

I have added "phantomjs.cookies.path" capability that lets you specify the path for the cookie jar.

kasatani avatar Jul 20 '17 17:07 kasatani

Thanks for the feedback. I've fixed the behavior when the path is not set, and added the test case.

kasatani avatar Oct 06 '17 12:10 kasatani

@kasatani the test ghostdriver.CookieStoreTest#shouldLoadCookies does not pass when i run it.

to run the test:

cd <ghostdriver project root>/test/java
./gradlew test -Dtest.single=CookieStoreTest  --debug

you may need to modify phantomjs_exec_path in <project root>/test/config.ini to phantomjs on your system.

jesg avatar Oct 23 '17 12:10 jesg

CookieStoreTest passes in my environment. Which version of phantomjs should I use for the testing? I'm using the released phantomjs-2.1.1 on macOS Sierra.

kasatani avatar Oct 30 '17 16:10 kasatani

Which version of phantomjs should I use for the testing?

i normally use a patched version of 2.1.1 but i'm also seeing the error in the official 2.1.1 release. i run the tests on ubuntu 17.

i should be able to take a look on a mac sometime next week.

jesg avatar Nov 03 '17 11:11 jesg