Within my user-extensions.js
file, I have the following custom function:
file: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 utilizing Selenium RC in conjunction with Java. Specifically, I have a Java class file named "Services_ProcMethodREOI.java". In order to invoke the JavaScript function typeRepeated()
, I included the following line in my Java file:
selenium.getEval("typeRepeated(\"txtAppCode\", \"service5\")");
// txtAppCode refers to a textfield and service5 is the inputted text for that field
However, upon running the Java file in Eclipse, an error message was encountered:
com.thoughtworks.selenium.SeleniumException: ERROR: Threw an exception: Object expected
I would greatly appreciate any suggestions on how to resolve this issue.