How do you set a cookie in Chrome?

Ranorex Studio, Spy, Recorder, and Driver.
Posts: 19
Joined: Mon Jan 14, 2013 7:16 pm

How do you set a cookie in Chrome?

Post by RanoTester » Fri Oct 23, 2020 12:54 am

Currently running Ranorex 9.1.1, will upgrade to the most current version sometime next week.

Any advise on how to set cookies when running Chrome?

There is one specific page in the login sequence to an app that Ranorex logs into. Once that page appears, we need to be able to instruct Ranorex to set a cookie, i.e., so that a Windows level - Username / PW prompt won't potentially appear.

This is how Katalon sets the cookie: ... wsers.html

User avatar
Ranorex Guru
Ranorex Guru
Posts: 7470
Joined: Mon Aug 13, 2012 9:54 am
Location: Zilina, Slovakia

Re: How do you set a cookie in Chrome?

Post by odklizec » Fri Oct 23, 2020 7:58 am


I'm afraid, there is no simple action to do this. You will have to use some C# code, as described here: ... okies-file

Eventually, it may be possible to set/modify cookies via Ranorex ExecuteScript action and some JavaScript code?

Here are some examples of Ranorex ExecuteScript and JavaScript commands:
And here is an article about how to work with cookies via JavaScript...
Pavel Kudrys
Ranorex explorer at Descartes Systems

Please add these details to your questions:
  • Ranorex Snapshot. Learn how to create one >here<
  • Ranorex xPath of problematic element(s)
  • Ranorex version
  • OS version
  • HW configuration