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

177
Views
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 answers
Answer question

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 Report
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!