Issue
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!
Solution
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.
Answered By - user17538629
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.