18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
How to set different cookies file for different PhantomJS browsers
OS Name: MAC OS X
Browser Name and version: PhantomJS 1.4
Sahi Build: sahi-v35
Hello!
I use Mink+Sahi+PhantomJS.
PhantomJS supports starting option --cookies-file.
It is possible to set --cookies-file in the browser_types.xml in the <options> node, but I need to set different cookies file for different PhantomJS instances. Can someone tell me how to do it?
As I see Mink manages SAHI through http calls to the SAHI-proxy
[host]:[port]/_s_/dyn/Driver_[command name].
To run new browser instance Mink sends POST-request to localhost:9999/_s_/dyn/Driver_launchPreconfiguredBrowser
with two parameters:
browserType – the name of the browser from browser_types.xml;
sahisid – the unique session identifier.
May be there is opportunity to set --cookies-file and it will be decision of my problem?
But I can not find documentation for this API...
Browser Name and version: PhantomJS 1.4
Sahi Build: sahi-v35
Hello!
I use Mink+Sahi+PhantomJS.
PhantomJS supports starting option --cookies-file.
It is possible to set --cookies-file in the browser_types.xml in the <options> node, but I need to set different cookies file for different PhantomJS instances. Can someone tell me how to do it?
As I see Mink manages SAHI through http calls to the SAHI-proxy
[host]:[port]/_s_/dyn/Driver_[command name].
To run new browser instance Mink sends POST-request to localhost:9999/_s_/dyn/Driver_launchPreconfiguredBrowser
with two parameters:
browserType – the name of the browser from browser_types.xml;
sahisid – the unique session identifier.
May be there is opportunity to set --cookies-file and it will be decision of my problem?
But I can not find documentation for this API...
Comments
Just out of curiosity, why would you want to open the browser with a different cookie every time? For testing an application, you would try to check and validate on cookies created by the application instead of creating it yourself right?
However, if you really wish to do that, you can use the _createCookie API instead.
The syntax is:
Regards,
dkulkarni
I am writing a script which should work instead of the people. I have more than 100 users so the script must work in more than 100 personal cabinets. Many actions in the cabinet are implemented by javascript, so I am trying to use tools such Sahi for browser managment.
At the same time I can run only few browsers, and browsers’ count is less then users’ count, so I need to persist sessions for each user to avoid logining every time when the script must do something.