tarleaa
15 years agoContributor
Using functions in KeywordTest
Hello,
how can I return the value of a function to a text box using Keyword Testing?
For example, I have the following function written in javascript that returns a random username :
function random_username()
{
var currentTime = new Date();
var hour = currentTime.getHours();
var min = currentTime.getMinutes();
var sec = currentTime.getSeconds();
var day = currentTime.getDate();
var month = currentTime.getMonth() + 1;
return 'Monthly' + month + day + '_' + hour + min + sec;
}
and I want the returning value to be typed in a textbox from a recorded KeywordTest (see attached image).
Thank you,
Andrei
how can I return the value of a function to a text box using Keyword Testing?
For example, I have the following function written in javascript that returns a random username :
function random_username()
{
var currentTime = new Date();
var hour = currentTime.getHours();
var min = currentTime.getMinutes();
var sec = currentTime.getSeconds();
var day = currentTime.getDate();
var month = currentTime.getMonth() + 1;
return 'Monthly' + month + day + '_' + hour + min + sec;
}
and I want the returning value to be typed in a textbox from a recorded KeywordTest (see attached image).
Thank you,
Andrei