Шаги для глобально многоразового решения следующие:
1) Загрузите файл sideflow.js из Загрузите здесь
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 -> options -> options -> Selenium Core extensions -> укажите ссылку на ваш файл.
5) Теперь ваша функция произвольного имени появится в 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>
Надеюсь, это поможет вам