Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

371
Views
Url redirects you too many times using Cypress Invoke("removeAttr", "target") command

I'm using this code to handle new tab and getting this error. It's displaying chrome-error //chromewebdata/ in url.

Tried for few other example site and it's working fine. I think mine url is redirecting two times that why facing this issue "redirected too many time". How I can handle it?

cy.get(".store-list-item__action").contains("a","Log in").eq(0).invoke("removeAttr", 'target').then(newUrl=>{
        cy.wrap(newUrl).click()
    })

enter image description here

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

How about you just use this:

cy.contains('a', 'Log in').invoke("removeAttr", 'target').click()
about 4 years ago · Juan Pablo Isaza Report

0

.invoke("removeAttr", 'target')

Above Command will work only if system is moving user to same "href" link, in this case after clicking the link systemis redirecting user to another page/link which cypress doesn't support. So cy.request() method can be used for this scenario to validate data.

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!