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

253
Views
Running JavaScript script inside the Selenium IDE

I am stuck a bit with figuring out how to run the JavaScript inside the Selenium IDE. The goal for this is to be able to send this to the input field, we have a setup in the backend that is also checking for the current time in the input field for testing purposes: Input field that needs to be filled

Seems that this way it does not work at all: Inside the Selenium IDE

What needs to be sent to the input field is string "TEXT" + "hhmm" without ":". (sorry that included hhss in the screenshot, the right is hhmm).

I am trying to get this inside the Selenium IDE. Yet, I am beginning with JavaScript, so maybe there could be some suggestions on some one-liners?

const now = new Date();
console.log(now.getHours() + "" + now.getMinutes());

This is as close as I could get, but I cannot return the whole thing, just a TEST string. Selenium IDE

Thanks a lot for any provided advice!

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Just found the answer to my own question, but sharing this with you and for my own reference too if there is a need for such information as there are not that much examples on the net.

So, in order to return TEST and current time with all the zeros in time we need to run the following line and store it in IDE:

javascript{"TEST" + new Date().toTimeString().split(':').slice(0,2).join('');}

Then as below, echo the ${returnTest} which is a Value of the stored script and then send the information to the input field.

enter image description here

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!