https://cypress.io logo
Angualar New Tab
# i-need-help
c
Here is the Scenario : There is button where its open a new tab But due to usage of angular its kind of dynamic . How I can resolve this ? Is there any workaround to catch the URL when I click on this button ? Help me . Plzzzzz

https://cdn.discordapp.com/attachments/1105803599101034556/1105803599222685777/image.png

w
Can you describe what exactly you mean by “catch the url” - what are you trying to do? What is the experience of it being dynamic that is causing a problem? What is your current test code that isn’t doing what you want? These things will help people to make suggestions. It does look like the link doesn’t have an href so maybe it does something else like set a new address with JavaScript. More details will help.
c
Yeah sure . Now i am working on a automation project where they use angular js . And there are several cases where they open a new tab with Form . BUT the button where i click and open the tab , There is no link over there . For that i could not validate that url and open that url in the first tab . Its kind of blocker for me now . If there is any work around for that .
w
Understood, Gleb has some methods for testing this https://glebbahmutov.com/blog/cypress-second-tab/ It depends how the form is implemented, the window.open suggestion might apply to this situation.
c
Thanks a lot . And it helps me