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

255
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
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