шагов для глобально многоразового решения заключается в следующем
1) Скачать sideflow.js из Download here
2) Добавить следующие строки в него:
Selenium.prototype.doTypeRandomName = function(locator) {
/**
* Sets the value of an input field to a random email id,
* as though you typed it in.
*
* @param locator an <a href="#locators">element locator</a>
*/
// All locator-strategies are automatically handled by "findElement"
var element = this.page().findElement(locator);
/* The following block generates a random email string */
var allowedChars = "abcdefghiklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
var stringLength = 8;
var randomstring = '';
for (var i=0; i<stringLength; i++) {
var rnum = Math.floor(Math.random() * allowedChars.length);
randomstring += allowedChars.substring(rnum,rnum+1);
}
// Replace the element text with the new text
this.browserbot.replaceText(element, randomstring);
};
3) Сохраните файл
4) Перейти к Selenium IDE -> Параметры -> Параметры -> Расширения Selenium Core -> укажите ссылку на свой файл.
5) Теперь ваша функция randomname появится в auto-intellisense и будет как категория команд «typerandomname».
6) Пример использование может быть (если база URL является google.com)
<tr>
<td>open</td>
<td>/</td>
<td></td>
</tr>
<tr>
<td>typerandomname</td>
<td>css=input[class='gbqfif']</td>
<td></td>
</tr>
Надеется, что это помогает вам
Darn это.Я пытался «javascript:». Не знал о синтаксисе '{}'. Благодаря! – mpen