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

120
Views
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
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!