Using JavaScript from Selenium RC by Java -
i have following function in user-extensions.js
file:selenium.prototype.dotyperepeated = function(locator, text) { // locator-strategies automatically handled "findelement" var element = this.page().findelement(locator); // create text type var valuetotype = text + text; // replace element text new text this.page().replacetext(element, valuetotype); };
i using selenium rc java. have java class file "services_procmethodreoi.java". used following line in java file call javascript function typerepeated()
:
selenium.geteval("typerepeated(\"txtappcode\", \"service5\")"); //txtappcode textfield , service5 inputted text on textfield
when ran java file using eclipse, found following error:
com.thoughtworks.selenium.seleniumexception: error: threw exception: object expected
pls suggest me how can solve it.
you need use docommand method fire off new command have created. there documentation @ http://seleniumhq.org/docs/08_user_extensions.html#using-user-extensions-with-selenium-rc
Comments
Post a Comment