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

179
Vistas
Automating entry of data and clicking a button through Javascript

I’m trying to make a loop to fill a text box on a website with whatever I type then add 0-9 at the end and click submit to guess a keyword. I can see with console.log that the loop works. When the script is run without the button click part I can see it goes to ‘text9’ in the text box so that means this part is also running but when I add the button click part, the loop stops after ‘text0’, the page loads and shows ‘wrong attempt’. How do I keep the loop running after it stops after the first attempt? Sorry for a dumb question, I’ve just started learning.


var str = "text"
var num = -1;
for (var i = 0; i<10; i++) { 
    num++;
    hola= str + num;
    document.getElementsByName('textbox')[0].value= hola

    document.getElementsByClassName('button-done')[0].click()
}

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

0

If you're just getting started with JavaScript testing, I would look into a framework called Jest (Docs). It will get you started with testing programs like you're trying to do in your question!

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