You are right, isChecked() is missing. I added it in.
The following test passed.
@Test
public void testIsChecked(){
cbx.check("root.input0");
assertTrue(cbx.isChecked("root.input0"));
cbx.uncheck("root.input0");
assertFalse(cbx.isChecked("root.input0"));
}
Please use the snapshot version
http://maven.kungfuters.org/content/repositories/snapshots/org/telluriumsource/tellurium-core/0.7.0-SNAPSHOT/tellurium-core-0.7.0-20100301.144645-99.jar
Thanks again for reporting this.
Jian
On Mon, Mar 1, 2010 at 9:32 AM, Jian Fang <[email protected]> wrote:
> Let me check it for you.
>
> Thanks,
>
> Jian
>
>
> On Mon, Mar 1, 2010 at 3:41 AM, Ammar <[email protected]> wrote:
>
>> Hi Jian,
>>
>> That's great - getValue() now works for me with the updated jar.
>>
>> I also got a similar exception when I tried to call isChecked() on a
>> checkbox - could this method also be missing?
>>
>> Thanks for the quick response.
>> Ammar.
>>
>> On Mar 1, 3:32 am, Jian Fang <[email protected]> wrote:
>> > Sorry, we forgot to add the getValue() method to the CheckBox object. I
>> just
>> > fixed it on trunk and please use the 0.7.0 snapshot from our Maven repo,
>> or
>> > directly download it from
>> >
>> > http://maven.kungfuters.org/content/repositories/snapshots/org/tellur.
>> ..
>> >
>> > Let us know if you have any further problems.
>> >
>> > Thanks,
>> >
>> > Jian
>> >
>> > On Sun, Feb 28, 2010 at 3:21 PM, Ammar <[email protected]> wrote:
>> > > Hi,
>> >
>> > > I'm having a problem with a straightforward scenario.
>> >
>> > > After clicking on a check box I am trying to call getValue on that
>> > > checkbox to assert that it is now "on".
>> >
>> > > Here's the UI module:
>> >
>> > > import org.telluriumsource.dsl.*;
>> > > class CheckBoxExample extends DslContext
>> > > {
>> > > public void defineUi()
>> > > {
>> > > ui.Form(uid: "root", clocator: [tag: "form", method:
>> "get",
>> > > action:
>> > > "/samples/checkbox.asp"])
>> > > {
>> > > CheckBox(uid: "input0", clocator: [tag:
>> "input",
>> > > type: "checkbox",
>> > > name: "default"])
>> > > }
>> > > }
>> >
>> > > def checkOneBox(String input)
>> > > {
>> > > click input
>> > > }
>> >
>> > > def checkBoxValues(String input)
>> > > {
>> > > getValue(input)
>> > > }
>> > > }
>> >
>> > > Here's the test case:
>> >
>> > > import org.telluriumsource.test.java.*;
>> > > import org.junit.BeforeClass;
>> > > import org.junit.Test;
>> >
>> > > import static org.junit.Assert.assertEquals;
>> >
>> > > public class CheckBoxExampleJavaTestCase extends TelluriumJavaTestCase
>> > > {
>> > > protected static CheckBoxExample cbx;
>> >
>> > > @BeforeClass
>> > > public static void initUi()
>> > > {
>> > > cbx = new CheckBoxExample();
>> > > cbx.defineUi();
>> > > }
>> >
>> > > @Test
>> > > public void testCheckOneBox()
>> > > {
>> > > connectSeleniumServer();
>> > > connectUrl("http://www.asp101.com/samples/checkbox.asp
>> ");
>> > > cbx.checkOneBox("root.input0");
>> > > assertEquals("on", cbx.checkBoxValues("input0"));
>> > > }
>> > > }
>> >
>> > > When I run it as jUnit, I get the following exception:
>> >
>> > > groovy.lang.MissingMethodException: No signature of method:
>> > > org.telluriumsource.ui.object.UiObject.getValue() is applicable for
>> > > argument types: (org.telluriumsource.dsl.BaseDslContext
>> > > $_getValue_closure37) values: [org.telluriumsource.dsl.BaseDslContext
>> > > $_getvalue_closur...@e41d4a]
>> > > Possible solutions: getClass()
>> > > at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>> > > Method)
>> > > at
>> sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown
>> > > Source)
>> > > at
>> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown
>> > > Source)
>> > > at java.lang.reflect.Constructor.newInstance(Unknown Source)
>> > > 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)
>> > > at
>> >
>> > >
>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(AbstractCallSite.java:
>> > > 208)
>> > > at
>> > > org.telluriumsource.ui.object.UiObject.methodMissing(UiObject.groovy:
>> > > 183)
>> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> > > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>> > > at java.lang.reflect.Method.invoke(Unknown Source)
>> > > at
>> > > org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:
>> > > 88)
>> > > at
>> groovy.lang.MetaClassImpl.invokeMissingMethod(MetaClassImpl.java:
>> > > 813)
>> > > at
>> > > groovy.lang.MetaClassImpl.invokePropertyOrMissing(MetaClassImpl.java:
>> > > 1107)
>> > > at
>> groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1060)
>> > > at
>> groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886)
>> > > at
>> >
>> > >
>> org.codehaus.groovy.runtime.callsite.PogoMetaClassSite.call(PogoMetaClassSite.java:
>> > > 39)
>> > > at
>> >
>> > >
>> org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:
>> > > 40)
>> > > at
>> >
>> > >
>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
>> > > 117)
>> > > at
>> >
>> > >
>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:
>> > > 125)
>> > > at
>> >
>> > >
>> org.codehaus.groovy.runtime.callsite.AbstractCallSite.callSafe(AbstractCallSite.java:
>> > > 90)
>> > > at
>> > > org.telluriumsource.dsl.BaseDslContext.getValue(BaseDslContext.groovy:
>> > > 507)
>> > > at org.telluriumsource.dsl.BaseDslContext
>> > > $getValue.callCurrent(Unknown Source)
>> > > 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 CheckBoxExample.checkBoxValues(CheckBoxExample.groovy:20)
>> > > at
>> >
>> > >
>> CheckBoxExampleJavaTestCase.testCheckOneBox(CheckBoxExampleJavaTestCase.java:
>> > > 24)
>> > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>> > > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
>> > > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown
>> Source)
>> > > at java.lang.reflect.Method.invoke(Unknown Source)
>> > > at org.junit.runners.model.FrameworkMethod
>> > > $1.runReflectiveCall(FrameworkMethod.java:44)
>> > > at
>> >
>> > >
>> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:
>> > > 15)
>> > > at
>> >
>> > >
>> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:
>> > > 41)
>> > > at
>> >
>> > >
>> org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:
>> > > 20)
>> > > at
>> >
>> > >
>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
>> > > 76)
>> > > at
>> >
>> > >
>> org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:
>> > > 50)
>> > > at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
>> > > at
>> org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
>> > > at
>> org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
>> > > at
>> org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
>> > > at
>> org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
>> > > at
>> > >
>> org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:
>> > > 28)
>> > > at
>> > >
>> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:
>> > > 31)
>> > > at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
>> > > at
>> >
>> > >
>> org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:
>> > > 46)
>> > > at
>> > >
>> org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:
>> > > 38)
>> > > at
>> >
>> > >
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
>> > > 467)
>> > > at
>> >
>> > >
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:
>> > > 683)
>> > > at
>> >
>> > >
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:
>> > > 390)
>> > > at
>> >
>> > >
>> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:
>> > > 197)
>> >
>> > > Thanks for any help you can provide - I think it's probably going to
>> > > be something really obvious....
>> >
>> > > --
>> > > 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]<tellurium-users%[email protected]>
>> <tellurium-users%[email protected]<tellurium-users%[email protected]>
>> >
>> > > .
>> > > For more options, visit this group at
>> > >http://groups.google.com/group/tellurium-users?hl=en.
>>
>> --
>> 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]<tellurium-users%[email protected]>
>> .
>> For more options, visit this group at
>> http://groups.google.com/group/tellurium-users?hl=en.
>>
>>
>
--
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.