Forum Discussion
Dmitry_Nikolaev
15 years agoStaff
Hi Mark,
Here is a sample of how you can accomplish your task:
1. Add the following routines to your project:
2. Create a string project variable with "RandomEmailAddress" name.
3. Insert the Run Script Routine operation to your keyword test with the RandomEmailAddress routine as a parameter.
4. After the operation is executed, the "RandomEmailAddress" variable's value will contain a random e-mail address. This variable can be accessed further in the keyword test.
Here is a sample of how you can accomplish your task:
1. Add the following routines to your project:
function SetRandomEmailAddress() {
Project.Variables.VariableByName("RandomEmailAddress") =
RandomString(16) + "@" + RandomString(16) + "." + RandomString();
}
function RandomString(Length)
{
if(Length == null) {
Length = 3;
}
var SymbolsAndDigits = "abcdefghijklmnopqrstuvwxyz1234567890";
var Result = "";
for(var i = 0; i < Length; i++)
{
Result += aqString.SubString(SymbolsAndDigits, Math.floor(Math.random() * SymbolsAndDigits.length), 1);
}
return Result;
}
2. Create a string project variable with "RandomEmailAddress" name.
3. Insert the Run Script Routine operation to your keyword test with the RandomEmailAddress routine as a parameter.
4. After the operation is executed, the "RandomEmailAddress" variable's value will contain a random e-mail address. This variable can be accessed further in the keyword test.
Related Content
- 4 months agoD0UG
- 10 years agoPaulDonny
- 3 years agoabuTX
- 6 months agosohailalam2696
Recent Discussions
- 8 hours agoSubhraDas
- 22 hours agoJacobjacob44