I have the following function in 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);
};
I am using Selenium RC with Java. I have a Java class and I called the doTypeRepeated function by following the way:
selenium.getEval("doTypeRepeated(\"txtAppCode\", \"service5\")");
("txtAppCode" is a textbox and "service5" is some text to write/type on the textfield)
I got this error:
com.thoughtworks.selenium.SeleniumException:
ERROR: Threw an exception: Object expected"
Can anyone tell me where am I doing wrong?