Cleaning cookies for all domains in the middle of scripted browser run

I work on monitor for “reset password” flow of “Scripted Browser” type. Plan was to run “register new user”, start new login process and finally make password reset steps.

Between steps 1 and 2 I need to wipe all the cookies, otherwise user is considered authorized so I don’t get login form shown. Added $browser.manage().deleteAllCookies(); but it does not help.

To my understanding, since it wipes cookies only to current domain and AUTH domain makes redirect immediately - since user is considered authorized - cookies are wiped to URL we are redirected to instead of AUTH domain.

Is there any way to drop all the cookies for all the domains aka getting “fresh browser instance”? Or is there way to pause/disable redirection?

Hi @yevhenkozlov! As far as I understand, you would like to do this procedure in the same monitor. In this case I can advice you to use the $browser.manage().deleteAllCookies() method.

@vpaizs yes, in the same monitor. But how could I postpone redirect from to to clean cookies for first domain, not to the second? To my understanding it does not work to me since .deleteAllCookies() delete cookies only to domain of currently opened address.

Hi there @yevhenkozlov -

I’ve just been reviewing some of our older synthetic script topics. Looking at this, I am wondering if it might be possible to use the waitFor function to let the cookies clear before you switch to the next domain?