Page 1 of 1

How do you set a cookie in Chrome?

Posted: Fri Oct 23, 2020 12:54 am
by RanoTester
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: https://docs.katalon.com/katalon-studio ... wsers.html

Re: How do you set a cookie in Chrome?

Posted: Fri Oct 23, 2020 7:58 am
by odklizec
Hi,

I'm afraid, there is no simple action to do this. You will have to use some C# code, as described here:
https://stackoverflow.com/questions/254 ... 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:
viewtopic.php?f=4&t=13048&p=51768#p51768
viewtopic.php?f=4&t=6581&p=27235#p27307
And here is an article about how to work with cookies via JavaScript...
https://www.w3schools.com/js/js_cookies.asp