Using functions in KeywordTest
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2010
10:38 PM
01-26-2010
10:38 PM
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
1 REPLY 1
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-26-2010
11:39 PM
01-26-2010
11:39 PM
Hi Andrei,
You need to use the Run Script Routine operation (see the "Run Script Routine Operation" help topic).
You need to use the Run Script Routine operation (see the "Run Script Routine Operation" help topic).
------
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Yuri
TestComplete Customer Care Engineer
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
