BTW, customUiCall "Google.Input", typeRepeated, input
also works because DslContext has a propertyMissing method, which will convert the missing property to a String. On Fri, Apr 24, 2009 at 9:12 AM, John <[email protected]> wrote: > > Core and engine artifacts are updated again to support user's custom > methods. > Please also update your configuration file from > > > http://tellurium-users.googlegroups.com/web/TelluriumConfig.groovy?gda=MBCxNUgAAACXZPxEX7Ki-M5C2JpeBoXXUUEyN0E1O-Gv6OCu-htM00VXgMGkQSvEGOkXLGPlZ3WsULZohvauKDWce6gQh4fFGjVgdwNi-BwrUzBGT2hOzg&gsc=R8ZLtBYAAAD5i2Ns_h1Jp5oDyHWQWkiblKW9gda2xEqp8GeRYGM_Dg > > Please update the artifacts from Maven repo or our user group. > > To support user custom method class, I added one setting in > TelluriumConfig.groovy > > connector{ > //user's class to hold custom selenium methods associated with > user-extensions.js > //should in full class name, for instance, > "com.mycom.CustomSelenium" > customClass = "org.tellurium.test.MyCommand" <--- "Example" > } > > Your custom class should extend Tellurium > org.tellurium.connector.CustomCommand class > And your code should look like > > public class MyCommand extends CustomCommand{ > > public void typeRepeated(String locator, String text){ > String[] arr = [locator, text]; > commandProcessor.doCommand("typeRepeated", arr); > } > } > > This assumes that you have the following method defined in user- > extensions.js 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); > }; > > Then in the UI module class, you can use > > customUiCall "Google.Input", "typeRepeated", input > > if you need to work on the UI element, or use > > customDirectCall(String method, Object[] args) > > for other direct calls to Selenium server. > > The "customUiCall" is handling all the UI to locator mapping for you > so that you do not need to worry about how to generate the locator at > run time. > > I got this working except that Selenium-server does not honor the > loaded > user-extensions.js file even it is found and loaded in. My solution is > to > unpack the selenium-server jar file, add your custom javascript code > into > the user-extensions.js file directly, then jar the file. > > Please see trunk/core example GoogleSearchModule and > GoogleSearchTestCase > for more details. > > Thanks, > > Jian > > > On Apr 23, 9:12 am, John <[email protected]> wrote: > > BTW, if you are not using Maven, you can download > > > > selenium-server.jar > > tellurium-core-0.6.0-SNAPSHOT.jar > > > > directly from our user group or Maven repo. > > > > On Apr 23, 9:05 am, John <[email protected]> wrote: > > > > > Hi, > > > > > I cleaned up the trunk code and deployed new core and engine > > > artifacts to Maven repo. > > > > > The new update includes > > > > > 1) Fix the List position problem > > > 2) Add partial matching support for the class attribute > > > 3) Fix the selectByValue problem > > > > > Selenium Grid support and jQuery selector caching are included, but > > > you do not need > > > to use them at this point. > > > > > Please add the following Maven dependency for Selenium Grid tool to > > > your project POM file > > > > > <dependency> > > > <groupId>org.openqa.selenium.grid</groupId> > > > <artifactId>selenium-grid-tools</artifactId> > > > <version>1.0.2</version> > > > </dependency> > > > > > Then run > > > > > mvn dependency:purge-local-repository > > > > > to clean up your local repo and pull out the updated artifacts. > > > > > Hari, I will add the support for custom selenium methods soon. > > > > > Thanks, > > > > > Jian > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "tellurium-users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/tellurium-users?hl=en -~----------~----~----~----~------~----~------~--~---
