Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

406
Vistas
How to resolve - Cypress detected a cross origin error?

So i am using cypress to log into google and create a google form. I have gotten through the login, but now that I want to select create new form, I am seeing cross origin errors which seem to be blocking such actions. Can anyone help me out here? Heres my code. Its the click on #1f that is not working see error

'''

 describe('Test', function () {
  it('logs into google', function () {
    Cypress.on('uncaught:exception', (err, runnable) => {
        return false
        })
    cy.visit('http://docs.google.com/forms/u/0')

    cy.xpath("//input[@type='email']").type("userAlktest@gmail.com");
    cy.xpath("//span[contains(text(),'Siguiente')]").click();
    cy.wait(5000);
    cy.xpath("//input[@type='password']").type("1Testagain");
    cy.xpath("//span[contains(text(),'Siguiente')]").click();
    cy.wait(5000);
    ///cy.xpath("//span[contains(text(),'Probar otra manera')]").click();
  ///  cy.wait(5000) 
  ///     cy.xpath("//span[contains(text(),'Confirmar')]").click();
   /// cy.wait(5000)

   //cy.xpath("//span[contains(text(),'Untitled form')]").click();
   //cy.wait(5000)

   cy.get('#:1f').click();
   cy.wait(5000);

'''

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

This is a cypress tradeoff and you can read about it from the cypress docs. In a nutshell, if you want to access two different URLs in one test you cannot. For this scenario, you have to write two tests where each URL is accessed. For e.g.

NOT OK ❌

it('navigates', () => {
  cy.visit('https://apple.com')
  cy.visit('https://google.com') // this will error
})

OK ✅

it('navigates', () => {
  cy.visit('https://apple.com')
})

// split visiting different origin in another test
it('navigates to new origin', () => {
  cy.visit('https://google.com') // yup all good
})
about 4 years ago · Juan Pablo Isaza Denunciar

0

Maybe it would help it would help more if more clarity was provided on what the reason for creating a Google form.

Back to the question, the original domain your test is bounded is https://google.com. I imagine removing the describe() block and having two it() with no describe() could help you out.

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda