0
一个问题所需的解决方案:生成测试电子邮件ID
编号是固定的“品质保证”我要产生像IDS:1- q.ualityassurance
对于第二次运行ID应该是这样的:2- qu.alityassurance
第三运行它应该是这样的:3- qua.lityassurance
等等直到id的长度。但我不明白如何以增值的方式调用下次运行的函数。
代码是:
Selenium.prototype.doNothing = function(){
// The do in front of Nothing in the function is what tells the system this is a global function
}
Selenium.prototype.doRandomEmail = function(locator, num)
{
var id = “qualityassurancetask”;
var stringLength = id.length;
var randomstring = ”;
var insstring = ‘.’;
var num = 1;
//var rnum = Math.floor(Math.random() * stringLength);
var remainingstring = id.substring(num,id.length);
randomstring += id.substring(0,num).concat(insstring, remainingstring);
randomstring += “@gmail.com”
num= num+1;
selenium.doType(locator,randomstring,num);
}