It needs extra double quotes? I will take a look tonight. Thanks,
Jian On Wed, Aug 4, 2010 at 1:39 PM, Jade <[email protected]> wrote: > Hi Jian, > > Thanks again for your quick reply. > > I added this call: > > and it is doing the substitution in the action. I think the parse > error is caused by missing double quotes around the action value. When > I added them back like this: > > action: '"' + "${VireoTestConfig.getWebApp()}/password-login" + '"' > > then the error disappeared. > > Here's the JSON: > > [{"obj":{"uid":"DspaceLoginForm","locator":{"tag":"form","attributes": > {"id":"aspect_eperson_PasswordLogin_div_login","action":vireo101/ > password-login,"class":"ds-interactive-div > primary","method":"post"}},"uiType":"Form","metaData": > {"id":"DspaceLoginForm","type":"UiObject"}},"key":"DspaceLoginForm"}, > {"obj":{"uid":"LoginPassword","locator":{"tag":"input","attributes": > > {"id":"aspect_eperson_PasswordLogin_field_login_password","name":"login_password","class":"ds- > password-field","type":"password"}},"uiType":"InputBox","metaData": > > {"id":"LoginPassword","type":"UiObject"}},"key":"DspaceLoginForm.LoginPassword"}, > {"obj":{"uid":"LoginEmail","locator":{"tag":"input","attributes": > > {"id":"aspect_eperson_PasswordLogin_field_login_email","name":"login_email","class":"ds- > text-field","type":"text"}},"uiType":"InputBox","metaData": > {"id":"LoginEmail","type":"UiObject"}},"key":"DspaceLoginForm.LoginEmail"}, > {"obj":{"uid":"Submit","locator":{"tag":"input","attributes": > > {"id":"aspect_eperson_PasswordLogin_field_submit","name":"submit","class":"ds- > button-field","type":"submit"}},"uiType":"SubmitButton","metaData": > {"id":"Submit","type":"UiObject"}},"key":"DspaceLoginForm.Submit"}] > Dump locator information for DspaceLoginForm > > Jade > > On Aug 4, 12:09 pm, Jian Fang <[email protected]> wrote: > > Hi, > > > > I am not sure if GString (${}) will work in UI module definition. Could > you > > call > > > > public String toString(String uid); > > > > to dump out the JSON string representation of the UI module to see if the > > GString got replaced? > > > > If not, $ may be treated as a partial matching symbol by Tellurium. > > > > http://code.google.com/p/aost/wiki/UserGuide070AppendixB#How_to_do_At... > > > > Thanks, > > > > Jian > > > > On Wed, Aug 4, 2010 at 12:08 PM, Jade <[email protected]> wrote: > > > Hi, > > > > > I'm using both data driven tests and Junit tests. I've created a > > > config file to read in certain values such as the baseURL, the > > > testUrl, the webApp, etc. for our application into a class, > > > VireoTestConfig. > > > > > When I refer to this class in the action="" part of the Form of a > > > TelluriumDataDrivenModule, the code runs fine. Here's an example: > > > > > public void defineModule() { > > > > > ui.Form(uid: "DspaceLoginForm", clocator: [tag: "form", > > > method: > > > "post", action: "${VireoTestConfig.getWebApp()}/password-login", > > > class: "ds-interactive-div primary", id: > > > "aspect_eperson_PasswordLogin_div_login"]){ > > > > > However, when I try to do the same in a Module that extends the > > > DslContext, I get a JSON parse error when validating the form or or > > > using the module. > > > > > ui.Form(uid: "DspaceLoginForm", clocator: [tag: "form", method: > > > "post", action: "${VireoTestConfig.getWebApp()}/password-login", > > > class: "ds-interactive-div primary", id: > > > "aspect_eperson_PasswordLogin_div_login"]){ > > > > > but when it's changed back to ui.Form(uid: "DspaceLoginForm", > > > clocator: [tag: "form", method: "post", action: "vireo101/password- > > > login", class: "ds-interactive-div primary", id: > > > "aspect_eperson_PasswordLogin_div_login"]){ > > > > > it gives me a JSON parse error. It seems like it's not correctly > > > substituting the variable before trying to parse the JSON? > > > > > Here's the stack trace: > > > > > com.thoughtworks.selenium.SeleniumException: ERROR: Command execution > > > failure. Please search the Tellurium User Group at > > >http://groups.google.com/group/tellurium-usersfor error details from > > > the log window. The error message is: JSON.parse > > > at > > > > > > com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java: > > > 97) > > > at > > > > > > com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java: > > > 91) > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > at > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > > > 39) > > > 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.NativeMethodAccessorImpl.invoke0(Native Method) > > > at > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > > > 39) > > > 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.NativeMethodAccessorImpl.invoke0(Native Method) > > > at > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > > > 39) > > > 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.NativeMethodAccessorImpl.invoke0(Native Method) > > > at > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > > > 39) > > > 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 > > > groovy.lang.DelegatingMetaClass.invokeMethod(DelegatingMetaClass.java: > > > 149) > > > at groovy.lang.MetaObjectProtocol$invokeMethod.call(Unknown > Source) > > > at > > > > > > org.telluriumsource.component.custom.Extension.methodMissing(Extension.groovy: > > > 20) > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > at > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > > > 39) > > > 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.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: > > > 129) > > > at > > > > > > org.telluriumsource.dsl.BaseDslContext.getUiModuleValidationResult(BaseDslContext.groovy: > > > 1417) > > > at org.telluriumsource.dsl.BaseDslContext > > > $getUiModuleValidationResult.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 > > > org.telluriumsource.dsl.BaseDslContext.validate(BaseDslContext.groovy: > > > 1404) > > > at > test.utils.VireoJunitTestCase.login(VireoJunitTestCase.java:55) > > > at > test.utils.VireoJunitTestCase.setUp(VireoJunitTestCase.java:30) > > > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > > > at > > > > sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java: > > > 39) > > > at > > > > > > sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java: > > > 25) > > > at java.lang.reflect.Method.invoke(Method.java:597) > > > 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.RunBefores.evaluate(RunBefores.java: > > > 27) > > > 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 > > > > ... > > > > read more ยป > > -- > 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.
