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

126
Vistas
cypress js promise failure

Hello guys I try web scraping with Cypress. I want to take a letter from a website and re type it in the same web site but I get an error.

I get this error:[1]: https://i.stack.imgur.com/5LDMG.png

This is my code:

const { cwd } = require("process");

require("cypress-xpath");
// script.js created with Cypress
//
// Start writing your Cypress tests below!
// If you're unfamiliar with how Cypress works,
// check out the link below and learn how to write your first test:
// https://on.cypress.io/writing-first-test

//submit '//*[@id="login-form"]/div[3]/input'
//password '//*[@id="LoginForm_pw"]'
//username '//*[@id="LoginForm_username"]'
describe("My First Test", () => {
  it("Visits the Kitchen Sink", () => {
    function sleep(ms) {
      return new Promise((resolve) => setTimeout(resolve, ms));
    }
    var newWebsite = "https://at4.typewriter.at/index.php?r=typewriter/runLevel"

    cy.visit("https://at4.typewriter.at/");
    //__________________________________\\
    //____________________________________\\
    cy.get("#LoginForm_username").type("dasda");
    cy.get("#LoginForm_pw").type("asdasd");
    cy.xpath('//*[@id="login-form"]/div[3]/input').click();
    cy.wait(3000);
    
    
    cy.visit(newWebsite);
    
    function loop() {
        let actualLetter = cy.xpath('//*[@id="actualLetter"]').text;
        if (actualLetter!=undefined){
            cy.xpath('//*[@id="textInput"]').type(actualLetter);
        }        
        setInterval(loop, 1000);
        
        
    }
    loop();
   
  });
});

  


  
about 4 years ago · Juan Pablo Isaza
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