The ui-examples reference project includes a List example, which you can find from 0.7.0 release tar ball, or from here:
http://code.google.com/p/aost/source/browse/trunk/reference-projects/ui-examples/src/test/groovy/org.telluriumsource.test/ListExampleTestCase.java We will look at your problem and see what was wrong there. From the error message itself, seems the getInputValue(element) function did not return a String, thus, it did not have the trim() method on it. We need to create a mock test case to locate the root cause. Thanks, Jian On Fri, Jul 23, 2010 at 9:48 AM, Jade <[email protected]> wrote: > Hi Jian, > > The issue is that this jquery script timed out even though I'm only > accessing one item so I must either have an error in the script or > something wrong with my environment: > > runScript > ("teJQuery('input:checkbox[name=LIST_COLUMN_ASSIGNED_TO]').click();"); > > I also tried to iterate through the items in the list to individually > click them but I'm having a problem with the syntax for accessing each > item. I've read the Reference documentation many times. If someone on > the team has a chance to include junit or testng tests or tests > written in groovy that access the items defined in the defineUI() > method with each snippet of the module code in the documentation, that > would help newbies a lot with the syntax! > > I'm having problems accessing each list element: > > public void doSetAllCheckboxes(boolean checked) { > > String filterList = > "Formprefs.ListTabOptions.FilterOptionsListFieldset.FilterOptionsList" > int len = getListSize(filterList) > > for (int i = 1; i <= len; ++i) { > if (checked) { > def value = > getValue("Formprefs.ListTabOptions.FilterOptionsListFieldset.FilterOptionsList[2]") > // > for debugging > //def item = filterList[i]; > > // error on next line: SeleniumException: ERROR: Element is not a > toggle-button > if (! > > isChecked("Formprefs.ListTabOptions.FilterOptionsListFieldset.FilterOptionsList[$ > {i}]")) { > click > "Formprefs.ListTabOptions.FilterOptionsListFieldset.FilterOptionsList[$ > {i}]" > pause 300 // for ajax > String script = > > "isChecked(\"Formprefs.ListTabOptions.FilterOptionsListFieldset.FilterOptionsList[$ > {i}]\");"; > waitForCondition script, 30000 > } > } > } > // This times out > //runScript > ("teJQuery('input:checkbox[name=LIST_COLUMN_ASSIGNED_TO]').click();"); > } > > This line: > > def value = > > getValue("Formprefs.ListTabOptions.FilterOptionsListFieldset.FilterOptionsList[2]") > > gives me this stack trace: > > com.thoughtworks.selenium.SeleniumException: ERROR: Command execution > failure. Please search the Tellurium User Group at > http://groups.google.com/group/tellurium-users for error details from > the log window. The error message is: getInputValue(element).trim is > not a function > at > > com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java: > 97) > at > > com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java: > 91) > at sun.reflect.GeneratedMethodAccessor57.invoke(Unknown Source) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: > 25) > at java.lang.reflect.Method.invoke(Method.java:597) > at org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite > $PojoCachedMethodSiteNoUnwrapNoCoerce.invoke(PojoMetaMethodSite.java: > 229) > at > > org.codehaus.groovy.runtime.callsite.PojoMetaMethodSite.call(PojoMetaMethodSite.java: > 52) > at > > org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java: > 129) > at > > org.telluriumsource.component.connector.CustomSelenium.getBundleResponse(CustomSelenium.groovy: > 257) > at sun.reflect.GeneratedMethodAccessor56.invoke(Unknown Source) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: > 25) > at java.lang.reflect.Method.invoke(Method.java:597) > at > org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java: > 88) > at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:233) > at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1058) > at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:886) > at > groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java: > 149) > at groovy.lang.MetaObjectProtocol$invokeMethod.call(Unknown Source) > at > > org.telluriumsource.component.dispatch.Dispatcher.methodMissing(Dispatcher.groovy: > 56) > at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: > 25) > at java.lang.reflect.Method.invoke(Method.java:597) > 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.AbstractCallSite.call(AbstractCallSite.java: > 129) > at > > org.telluriumsource.component.bundle.BundleProcessor.passBundledCommand(BundleProcessor.groovy: > 322) > at org.telluriumsource.component.bundle.BundleProcessor > $passBundledCommand.callCurrent(Unknown Source) > at > > org.telluriumsource.component.bundle.BundleProcessor.process(BundleProcessor.groovy: > 414) > at org.telluriumsource.component.bundle.BundleProcessor > $process.callCurrent(Unknown Source) > at > > org.telluriumsource.component.bundle.BundleProcessor.methodMissing(BundleProcessor.groovy: > 427) > at sun.reflect.GeneratedMethodAccessor43.invoke(Unknown Source) > at > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: > 25) > at java.lang.reflect.Method.invoke(Method.java:597) > 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 > -- 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.
