Hi Hari,

thanks for ur quick reply.
I have added the method as per your saying :

public class TelluriumLoginTestCase  extends TelluriumJavaTestCase {
    private static TelluriumLoginModule app;

    @BeforeClass
    public static void initUi() {
        app = new TelluriumLoginModule();
        app.defineUi();
        app.enableSelectorCache();
    }

    @Before
      public void setUp() {
             TelluriumLoginTestCase.connectSeleniumServer();
          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() {
        app.loginAdmin("admin","password");
        app.click();
        assertTrue(app.getTitle().contains("Welcome"));

    }

but again i get the same 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...@2e242b]

Please suggest.

On Oct 27, 4:29 pm, Harihara Vinayakaram <[email protected]> wrote:
> U need to add a connectSeleniumServer() before the connectUrl call. Search
> for the connectSeleniumServer in the mail archive and you will references to
> it
>
> Regards
> Hari
>
> On Tue, Oct 27, 2009 at 4:09 PM, 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
-~----------~----~----~----~------~----~------~--~---

Reply via email to