Shouldn't the commands be as follows? keyType "root.input0", keyword keyType "root.input1", password
"root.input2" is a button and it should not have the keyType method. Thanks, Jian On Tue, Oct 27, 2009 at 6:39 AM, khush <[email protected]> wrote: > > Hi All, > > I am trying to run a test case using junit in idea. But i am getting > the following exception: > > groovy.lang.MissingMethodException: No signature of method: > org.tellurium.object.UiObject.keyType() is applicable for argument > types: (java.lang.String, org.tellurium.dsl.BaseDslContext > $_keyType_closure9) values: [admin, org.tellurium.dsl.BaseDslContext > $_keytype_closu...@1162a9c] > at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native > Method) > at sun.reflect.NativeConstructorAccessorImpl.newInstance > (NativeConstructorAccessorImpl.java:39) > at sun.reflect.DelegatingConstructorAccessorImpl.newInstance > (DelegatingConstructorAccessorImpl.java:27) > at java.lang.reflect.Constructor.newInstance(Constructor.java:513) > at org.codehaus.groovy.reflection.CachedConstructor.invoke > (CachedConstructor.java:77) > at org.codehaus.groovy.runtime.callsite.ConstructorSite > $ConstructorSiteNoUnwrapNoCoerce.callConstructor(ConstructorSite.java: > 107) > at > org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor > (CallSiteArray.java:52) > at > org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor > (AbstractCallSite.java:192) > > Code for my java class is given below: > > > > > public class TelluriumLoginTestCase { > private static TelluriumLoginModule app; > > @BeforeClass > public static void initUi() { > app = new TelluriumLoginModule(); > app.defineUi(); > app.enableSelectorCache(); > } > > @Before > public void setUp() { > //TODO init db > connectUrl("http://localhost:8080/myapps/login.jsp"); > } > > /** > * The actual login logic is moved to the UI module, since login > is the first step for all tests and will be reused. > */ > @Test > public void testLoginAdmin() { > System.out.println("app--->"+app); > app.loginAdmin("admin","password"); > app.click(); > System.out.println("title--->"+app.getTitle()); > assertTrue(app.getTitle().contains("Welcome")); > > > } > > } > > My groovy class is as given below: > > public class TelluriumLoginModule extends DslContext { > > public void defineUi() { > > ui.Form(uid: "root", clocator: [tag: "form", name: "FormName", > method: "post", action: "/action", id: "login_form"]){ > InputBox(uid: "input0", clocator: [tag: "input", type: "text", > name: "j_username", id: "user", class: "TextBox"]) > InputBox(uid: "input1", clocator: [tag: "input", type: > "password", name: "j_password", id: "pass", class: "TextBox"]) > SubmitButton(uid: "input2", clocator: [tag: "input", type: > "submit", value: "Log In", name: "bt_login", id: "login_button", > class: "button"], respond: ["click"]) > } > > > } > > > > public void loginAdmin(String keyword, String password) { > System.out.println("inside loginAdmin"); > keyType "root.input2", keyword > keyType "root.input3", password > > } > > public void click() { > System.out.println("inside click"); > click "root.input0" > waitForPageToLoad 30000 > } > } > > I am not getting why this exception is cominig. Trum is generating the > right code. > > Any idea? > > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
