ilija_panov
15 years agoContributor
calling script function in code expression parameter in keyword test ?
Hi,
I have started working with JScript in TC and my first task was to write a function for formating a string variable taken from an excel file in the datadriven input of a keyword test.
The idea is to apply this function i have defined in a JScript unit under \scripts:
function index(account)
{
var index;
var regEx ;
regEx = /(\d{1,1})/g, "|[$1]";
index = "[0]" + regEx.replace(account);
return index;
}
The datadriven input variable in a keyword test which looks like "KeywordTests.AAC.Variables.coa("account")". Any ideas how to this in the keyword test Edit Parameter window (maybe Code Expression), or is it neccesary to convert the keyword test to a script as well?
Thanks in advance,
Ilija
I have started working with JScript in TC and my first task was to write a function for formating a string variable taken from an excel file in the datadriven input of a keyword test.
The idea is to apply this function i have defined in a JScript unit under \scripts:
function index(account)
{
var index;
var regEx ;
regEx = /(\d{1,1})/g, "|[$1]";
index = "[0]" + regEx.replace(account);
return index;
}
The datadriven input variable in a keyword test which looks like "KeywordTests.AAC.Variables.coa("account")". Any ideas how to this in the keyword test Edit Parameter window (maybe Code Expression), or is it neccesary to convert the keyword test to a script as well?
Thanks in advance,
Ilija