Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

121
Visualizações
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 à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda