Forum Discussion
- smcmickleContributorNot sure if this is what you mean but... This is what I would do::
var str="Automation Test 1";
function myFunction()
{
var n=str.slice(15,str.length);
// Slices right where the number is, with the number being any amount of digits.
Now, I'm a newby at JScript, but depending on your method of submission, upon submission, just do this ::
n++;
Then to change the string to the next string name::
str = "Automation Test " + n;
}
CAKE :-) - sastoweSuper ContributorJScript is JScript. There is nothing special about JSCript in Test Complete. Google string manipulation for jscript. Pull out the integer piece, incremenet it, and put it back.
- sastoweSuper ContributorOR if you prefer, Test Complete has a string manipulation wrapper object called aqString.
Leanne,
Did Stephanie and Sean's suggestions help you?
BTW, you can vote for the one you decided to use or you like (Was this post helpful? -> Yes).
- Leanne_ZilkaNew ContributorYes, they did. The string slice worked perfectly, and was exactly what I was looking for!