Hi, Once you added the respond attribute as respond: [focus], the focus javascript event will be automatically triggered when you call
typeAndReturn "AlbumUrl", url and you should not call focus "AlbumUrl" explicitly. As a result, please just remove the above line and see what happens. Thanks, Jian On Sat, Jul 4, 2009 at 9:01 AM, messidinho <[email protected]> wrote: > > I've only had a week of experience with Tellurium and I've just hit a > brick wall. The following is the code I'm dealing with: > > public class ListenMusicAlbumsModule extends DslContext { > public void defineUI() { > ui.Button(uid: "Add", clocator: [tag: "button", text: "Add", > type: "button", class: "gwt-Button"]) > ui.InputBox(uid: "AlbumName", clocator: [tag: "input", type: > "text", class: "gwt-TextBox", name: "AlbumName"]) > ui.InputBox(uid: "Artist", clocator: [tag: "input", type: > "text", class: "gwt-TextBox", name: "Artist"]) > ui.InputBox(uid: "AlbumUrl", clocator: [tag: "input", type: > "text", class: "gwt-TextBox", name: "AlbumUrl"], respond: ["focus"]) > } > > public void addMusicAlbumViaEnterKeyPress(String albumName, String > artist, String url) { > click "Add" > type "AlbumName", albumName > type "Artist", artist > focus "AlbumUrl" > typeAndReturn "AlbumUrl", url > pause 2000 > } > } > > I've set "extraEvent = true" in the TelluriumConfig.groovy file as > follows: > > eventhandler{ > checkElement = false > extraEvent = true > } > > What I'm trying to do is test that when the 'Enter/Return' key is > pressed after typing the album URL, the details get submitted. > However, the cursor focus remains on the first field, album name. > Hence, I tried a workaround of setting the cursor focus to be on album > URL (focus "AlbumUrl") before entering the final field value. The > problem that I'm having is when I run the TestNG test class, I get the > following stack trace during the test execution: > > groovy.lang.MissingMethodException: No signature of method: > functional.ListenMusicAlbumsModule.focus() is applicable for argument > types: (java.lang.String) values: [AlbumUrl] > at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.unwrap > (ScriptBytecodeAdapter.java:54) > at > org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.callCurrent > (PogoMetaClassSite.java:78) > at > org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent > (CallSiteArray.java:44) > at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent > (AbstractCallSite.java:143) > at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent > (AbstractCallSite.java:151) > at functional.ListenMusicAlbumsModule.addMusicAlbumViaEnterKeyPress > (ListenMusicAlbumsModule.groovy:69) > at functional.ListenMusicAlbumsTest.testAddAlbumUsingEnterKey > (ListenMusicAlbumsTest.java:84) > > I got this idea about focus events from > http://code.google.com/p/aost/wiki/TopTenTelluriumFeatures > under the heading 'Javascript Events'. > > What else am I'm missing here? > > Thanks. > > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
