Looking for assistance with converting two snippets of Javascript code to extract date and time in a specific format, transitioning from storeEval to executeScript_Sandbox for use in Selenium Ide Kantu Ui.Vision.
Due to recent updates, storeEval is now deprecated and the new command executeScript_Sandbox must be utilized.
For more information, please refer to:
I require the conversion of these 2 codes from storeEval to executeScript_Sandbox compatible with the latest version of Selenium Ide Kantu Ui.Vision.
The initial code utilizing storeEval (deprecated) is as follows:
var d = new Date();
var m = ((d.getMonth() + 1 ) < 10) ? "0" + (d.getMonth() + 1) : (d.getMonth() + 1);
var day = d.getDate() < 10 ? "0" + d.getDate() : d.getDate();
day + "-" + m + "-" + d.getFullYear();
The second code using storeEval (deprecated) is provided below:
let d = new Date();
let h = d.getHours();
h = h < 10 ? "0" + h : h;
let m = d.getMinutes();
m = m < 10 ? "0" + m : m;
let s = d.getSeconds();
s = s < 10 ? "0" + s : s;
h + "-" + m + "-" + s;