Enable cookie in phantomjs with java code

391 views
Skip to first unread message

shivam maralay

unread,
Jun 4, 2014, 11:03:38 AM6/4/14
to phan...@googlegroups.com
I am trying to login and getting this error "Please enable cookies" 
Can any one tell me what is the way to enable the cookies with setCapabilities.

DesiredCapabilities caps = DesiredCapabilities.phantomjs();
caps.setCapability(PhantomJSDriverService.PHANTOMJS_EXECUTABLE_PATH_PROPERTY,phantombinary);
driver = new PhantomJSDriver(caps);

thanks
Shivam 


Login.png

Nitu Bafna

unread,
Aug 24, 2016, 10:40:58 AM8/24/16
to phantomjs
what this resolved ever ? I am facing the same issue

Vijay Shukla

unread,
Nov 16, 2016, 10:03:14 AM11/16/16
to phantomjs
Try to set UserAgent
DesiredCapabilities capabilities = new DesiredCapabilities()
capabilities.setCapability(PhantomJSDriverService.PHANTOMJS_PAGE_SETTINGS_PREFIX + "userAgent", "Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36(KHTML, like Gecko) Chrome/41.0.2272.101 Safari/537.36");
capabilities.setBrowserName("chrome");

On Wednesday, June 4, 2014 at 8:33:38 PM UTC+5:30, shivam maralay wrote:
Reply all
Reply to author
Forward
0 new messages