Not able to switch the window/tab while clicking on a link with javascript bind dynamic url #22555
Unanswered
tausif29
asked this question in
Questions and Help
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I have one scenario where I have to click on one link, that opens a new tab/window, As cypress does not support multiple tabs, I have found below workaround but its not working, It opens the new tab, but not able to switch the new tab and my test is failing with the error :
expected redirect to have been called at least once, but it was never called.
Note: Redirected url is dynamic and bind with the javascript, so not able to fetch the url from console also not able to remove the attribute from the link.
I also checked with the author of the page, As per him, Its creating dynamic form while clicking on the "link" and this form has target attribute so it's opening new tab. And we can not remove/modify the target attribute as its being added from the caller method. And this form gets gets created while we click on the link and gets destroyed immediately after opening a new tab
Below is the sample HTML file, which replicates the issue:
Beta Was this translation helpful? Give feedback.
All reactions