Thanks, selectByLabel works fine. It allows me to do my tests !!!
Thanks for this great piece of code (Tellurium, of course). I'm a
webtest user
for a while (and Webtest has plenty of great features), but the UI
approach
really stroke me. I needed a while to cope with it, but the more I use
it, the
easier it is to write several tests over the same pages. great
possibilities of encapsulation
You 'll see me wandering on this list often, I think

Bye

Dazz

On Apr 22, 4:35 pm, Jian Fang <[email protected]> wrote:
> selectByValue needs to be fixed in our core code. The fix has already been
> put in the trunk/core code, but
> you need to wait for the code to be cleaned up there. In the meanwhile, you
> can use selectByLabel
> if possible, that method has been tested and should have no problems.
>
> 0.5.0 should have the same problem as the 0.6.0 snapshot one.
>
> On Wed, Apr 22, 2009 at 10:28 AM, dazz_x <[email protected]> wrote:
>
> > No, I mean I used this code to use the selector :
> > selectByValue "form.select2","VALUE_DESIRED"
>
> > I did not try to change the sources.
>
> > I forgot to mention I test it with the 0.6 snapshot
> > I'm trying to downgrade to 0.5 but my TestNG case does'nt work as well
>
> > The value I try to select is the default one for the page, so I can
> > continue my browsing.
> > But I have another selects on the following page, and selectByValue
> > don't work either (whichever
> > method I call on select, the exception is the same : cannot call
> > method on null object. At debugging though, my
> > select object is not null)
>
> > dazz
>
> > On Apr 22, 4:22 pm, Jian Fang <[email protected]> wrote:
> > > You mean you have changed the line to the following?
>
> > >   c(locator, "value=${value}", respondToEvents)
>
> > > On Wed, Apr 22, 2009 at 9:49 AM, dazz_x <[email protected]> wrote:
>
> > > > Thanks for your quick response !!!
>
> > > > sorry to tell you that it doesn't work...
> > > > i've modified the line (i've removed the parenthesis to be more
> > > > groovy ;-) ) but it came to the same result
>
> > > > dazz
>
> > > > On Apr 22, 3:23 pm, Jian Fang <[email protected]> wrote:
> > > > > Hi,
>
> > > > > selectByValue "form.select2","VALUE_DESIRED"
>
> > > > > is the right way to use selector.
>
> > > > > It is complaining about this line
>
> > > > > def selectByValue(String value, Closure c){
>
> > > > >         c(locator, "value=${value}", respondToEvents)()  <-- this
> > line
> > > > >     }
>
> > > > > Seems we have a bug here and should use
>
> > > > > c(locator, "value=${value}", respondToEvents)
>
> > > > > instead.
>
> > > > > I will check in the fix shortly. But the trunk code is not stable at
> > this
> > > > > point because we are adding
> > > > > selenium Grid support and jQuery selector caching capability. Will
> > let
> > > > you
> > > > > know once we clean up
> > > > > the code.
>
> > > > > Thanks,
>
> > > > > Jian
>
> > > > > On Wed, Apr 22, 2009 at 8:22 AM, dazz_x <[email protected]> wrote:
>
> > > > > > Hi,
>
> > > > > > I've just begun to use tellurium, so please be nice with me ;-)
> > > > > > I 'm doing a TestNG test case with tellurium on a site that contain
> > a
> > > > > > <select id="select_id"> tag with several options
> > > > > > I define the ui as follows :
> > > > > >  public void defineUi() {
> > > > > >        ui.UrlLink(uid: "lien", clocator: [tag: "a", href: "/path",
> > > > > > id: "link_id"])
> > > > > >        ui.Container(uid: "form", clocator: [id:"container_id"]){
> > > > > >            RadioButton(uid: "input0", clocator: [tag: "input",
> > type:
> > > > > > "radio", value: "VALUE_1"], respond:["click"])
> > > > > >            RadioButton(uid: "input1", clocator: [tag: "input",
> > type:
> > > > > > "radio", value: "VALUE_2"], respond:["click"])
> > > > > >            Selector(uid: "select2", clocator: [tag: "select",
> > class:
> > > > > > "UNIQUE_CLASS_OF_SELECT"])
> > > > > >        }
> > > > > >  }
> > > > > > then my test is the following :
> > > > > >  public void fillForm(){
>
> > > > > >      waitForElementPresent("form.input0",50000)
> > > > > >      click "form.input0"
> > > > > >      println "Hello world"
> > > > > >      waitForElementPresent("form.input1",50000)
> > > > > >      click "form.input1"
> > > > > >      waitForElementPresent("form.select2",50000)
> > > > > >      def select = getUiElement("form.select2")
> > > > > >      println select // prints org.tellurium.object.selec...@1082277
> > > > > >      selectByValue("form.select2","VALUE_DESIRED") //throws
> > > > > > exception
> > > > > >  }
>
> > > > > > The last line throws an exception :
> > > > > > java.lang.NullPointerException: Cannot invoke method call() on null
> > > > > > object
> > > > > >        at org.codehaus.groovy.runtime.NullObject.invokeMethod
> > > > > > (NullObject.java:77)
> > > > > >        at
> > org.codehaus.groovy.runtime.InvokerHelper.invokePogoMethod
> > > > > > (InvokerHelper.java:743)
> > > > > >        at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod
> > > > > > (InvokerHelper.java:720)
> > > > > >        at org.codehaus.groovy.runtime.callsite.NullCallSite.call
> > > > > > (NullCallSite.java:17)
> > > > > >        at
> > > > > > org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall
> > > > > > (CallSiteArray.java:43)
> > > > > >        at
> > org.codehaus.groovy.runtime.callsite.AbstractCallSite.call
> > > > > > (AbstractCallSite.java:116)
> > > > > >        at
> > org.codehaus.groovy.runtime.callsite.AbstractCallSite.call
> > > > > > (AbstractCallSite.java:120)
> > > > > >        at
> > org.tellurium.object.Selector.selectByValue(Selector.groovy:
> > > > > > 18)
> > > > > >        at org.tellurium.object.Selector$selectByValue.call(Unknown
> > > > > > Source)
> > > > > >        at
> > > > > > org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall
> > > > > > (CallSiteArray.java:43)
> > > > > >        at
> > org.codehaus.groovy.runtime.callsite.AbstractCallSite.call
> > > > > > (AbstractCallSite.java:116)
> > > > > >        at
> > org.codehaus.groovy.runtime.callsite.AbstractCallSite.call
> > > > > > (AbstractCallSite.java:128)
> > > > > >        at
> > > > > > org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe
> > > > > > (AbstractCallSite.java:96)
> > > > > >        at org.tellurium.dsl.BaseDslContext.selectByValue
> > > > > > (BaseDslContext.groovy:226)
> > > > > >        at
> > org.tellurium.dsl.BaseDslContext$selectByValue.callCurrent
> > > > > > (Unknown Source)
> > > > > >        at
>
> > org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallCurrent
> > > > > > (CallSiteArray.java:47)
> > > > > >        at
> > > > > > org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent
> > > > > > (AbstractCallSite.java:142)
> > > > > >        at
> > > > > > org.codehaus.groovy.runtime.callsite.AbstractCallSite.callCurrent
> > > > > > (AbstractCallSite.java:154)
> > > > > >        at module.TestModule.fillForm(TestModule.groovy:36)
> > > > > >        at test.moduleTestCase.myTestSuite(Unknown Source)
>
> > > > > > Do you know what can happens ? I tried several methods, even the
> > > > > > direct way
> > > > > > (select as org.tellurium.object.Selector).selectByValue
> > > > > > ("VALUE_DESIRED")
> > > > > > but this last throws a Method not found exception
>
> > > > > > I really need to understand what happens
>
> > > > > > Thanks for reading
--~--~---------~--~----~------------~-------~--~----~
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