ASE
ASE

Reputation: 355

TestCafe - Possible to set "preserveUrl" to some own value?

I use two roles in my project. In Role1, after a couple of clicks, I come to a page with URL1 "http://acc.comp.se/signing-page". On this page, there is a Button "SignWithCustomer". If I click on that button I will get redirected to a page with URL2 "https://acc.comp.se/LogIn/?returnUrl=webben"

Now, in real life this redirection would be a new tab, i.e. I can always go back to the first tab where URL1 is still present and continue there as if the redirection never happened.

Is there a way to save the URL1, i.e. is it possible to set the preserverUrl to something I want? Like "preserveUrl=ClientFunction(() => window.location.href)"

I want to go back to Url1, the URL just before the last button click. And I want the previous session (before redirect) to be saved.

Upvotes: 1

Views: 321

Answers (1)

Alex Skorkin
Alex Skorkin

Reputation: 4274

Please find our example in the corresponding guthub thread, where we discussed a similar inquiry based on your scenario.

At present, TestCafe supports Multiple Browser Windows. You can try this feature in your scenario.

Upvotes: 1

Related Questions