У меня есть следующая функция в user-extensions.js:
Selenium.prototype.doTypeRepeated = function(locator, text) {
// All locator-strategies are automatically handled by "findElement"
var element = this.page().findElement(locator);
// Create the text to type
var valueToType = text + text;
// Replace the element text with the new text
this.page().replaceText(element, valueToType);
};
Я использую Selenium RC с Java. У меня есть класс Java, и я вызвал функцию doTypeRepeated
следующим образом:
selenium.getEval("doTypeRepeated(\"txtAppCode\", \"service5\")");
("txtAppCode"
- текстовое поле, а "service5"
- некоторый текст для ввода / ввода в текстовое поле)
Я получил эту ошибку:
com.thoughtworks.selenium.SeleniumException:
ERROR: Threw an exception: Object expected"
Может кто-нибудь сказать мне, где я делаю неправильно?